I know very little about performance tuning of servers etc... so i thought i'd put this up here as i start some research on it, just to get some direction.
I am in the process of migrating from my old server to a new one - both are 64 bit machines. One is a few years old, the other brand new (PowerEdge R410).
The old server spec is: 2 cpus, 3.4GHz Pentiums, 8G of RAM, Fedora 11 currently installed
The new server spec is: 16 cpus, 3.2 GHz Xeon, 16G of RAM, CentOS 6.2 installed. Also RAID10 is on the new server - no RAID on the old one.
Both servers currently have the same database (MySQL) with the same data migrated.
I wrote a Perl script that simply steps through each row of a table in the database (about 18000 rows) and updates a value in that row. Every row in the table is updated.
Out of curiosity i ran this perl script on both machines, just to see how the new server would perform vs. the old one, and it produced interesting results: The old server was twice as fast as the new one to complete.
Looking at the database, both are configured exactly the same (the new one being a dump of the old one...)...
Anyone any ideas why this would be given the hardware gap between both?
As i said i'm about to start some digging, but thought i'd put this up here to maybe get some good direction....
Many thanks in advance..
Edit: 26/9 Thanks for the replies. Anyone have any other suggestions? Strange that only when running a perl script that i see the old server outperform the new one - all other tests showed the new server way ahead...
Edit: 27/9 Ok, i did some benchmarks using Perls benchmark and found that the new server outperforms the old one when i do a simple number crunch tests, but when it comes to interacting with the database, the old server performs far better.
Start Number Crunch Test: timethis 200000: 8 wallclock secs ( 7.51 usr + 0.00 sys = 7.51 CPU) @ 26631.16/s (n=200000) End Number Crunch Test:
Start DB Test: timethis 20000: 163 wallclock secs ( 9.72 usr + 2.78 sys = 12.50 CPU) @ 1600.00/s (n=20000) End DB Test:
Start Number Crunch Test: timethis 200000: 4 wallclock secs ( 4.53 usr + 0.00 sys = 4.53 CPU) @ 44150.11/s (n=200000) End Number Crunch Test.
Start DB Test: timethis 20000: 380 wallclock secs ( 0.86 usr + 0.31 sys = 1.17 CPU) @ 17094.02/s (n=20000) End DB Test:
You can clearly see that the new server performs more calculations per sec than the old one, but still takes longer (alot longer) when it comes to the database test, which is simply updating rows in a table.
Since mysqlslap showed the new server outperforms the old one, would i be wrong in saying that the problem seems to lie with Perls interaction (using DBI) with the database? Also as stated above i did the same test using PHP and the new server performed better, so the problem seems to lie with Perl, specifically when it interacts with the database.
Anyone have any thoughts?