MySQL Configuration

We spent weeks on tweaking our MySQL database to the maximum. The results were encouraging: performance was up to 3 times higher on our Opteron machines than out of the box. On the Sun machine, the results were even more impressive, especially when we started using MySQL 5.0. MySQL 5 runs horribly slow on the T1 out of the box, but we got up to 5 times more performance out of our T2000 server after getting some excellent tweaking tips from Peter Zaitsev (MySQL) and Luojia Chen (Sun).

All testing was done with InnoDB as our storage engine in MySQL 5.0.21. We optimized for a server with 4 GB of RAM. Here is our MySQL configuration:

[mysqld]
port3306
socket= /tmp/mysql.sock
skip-locking
key_buffer = 1G
max_allowed_packet = 1M
table_cache = 1024
sort_buffer_size = 2M
read_buffer_size = 2M
read_rnd_buffer_size = 8M
thread_cache = 125
max_user_connections = 450
max_connections = 450
thread_concurrency = 16

The "query cache" was off, as we wanted to test worst case performance. Our test database is still the same as in previous articles, about 1GB in size. The workload consists of more than 90% selects, thus this is mostly a "read intensive" workload.

MySQL Results

All numbers are expressed in queries per second.



Notice that the T1 needs about 20-30 MySQL threads to run at full speed; this is clearly a result of it's 8 core "4 thread Gatling gun core" architecture. It must also be noted that the out-of-the box MySQL performance is simply horrible, about 4-5 times lower than the well optimized numbers you see above. There is no escaping the face that you must take the time to read Sun's tunings tips well.

Once you do, the 1 GHz T1 is capable of performing like an Opteron 2.2 GHz, which is pretty amazing. Kudos to Luojia Chen and Peter Zaitsev for a job well done. While the old Xeon which consumed 4 times more power than the T1 to give the same performance looked pretty silly, the new Xeon 5160 easily outperforms the T1. The performance/Watt title will probably go to the low power Woodcrest versions, which we haven't tested yet.

Let us see what a single dual-core Woodcrest can do versus a dual-core Opteron and quad-core Sun T1.



As we were testing with only two cores, we brought back the Dual Xeon Irwindale for the test. We did a few extra tests on this platform as we also had the older Nocona platform in the labs. The additional 1MB cache of Irwindale improved our benchmark numbers by 7-8%, which is quite impressive. Our time investment in tweaking our MySQL database also made the caches and memory system more important. Finally, Hyper-Threading still doesn't pay off in MySQL: we noticed a small slowdown of about 7%.

Java Webserving MySQL Scaling and PostGreSQL
Comments Locked

91 Comments

View All Comments

  • Questar - Thursday, June 8, 2006 - link

    Why? Because AMD got creamed?
  • ashyanbhog - Thursday, June 8, 2006 - link

    and Intel woodcrest may have fantastic performance when compared to earlier xeons,

    but Intel is 3 years late to the party, Opteron was here in 2003!

    also remember, woodcrest is a brand new design from PIII base, manufactured on 65nm process. It is still to make its debut in the market and be available in volumes. Amd its indeed nice to see it being compared to a 3 year old design manufactued on 90nm process.

    AMD still has two product launches to come this year. Move to DDR2 for opterons which should cut some power usage for the total system AND introduction of products manufactured on 65nm at the fag end of the year. Will woodcrest and conroe still retain their performance margins then? if not, for how many months or weeks has Intel grabbed this "performance crown"?
  • zsdersw - Thursday, June 8, 2006 - link

    Consider the following:

    - If comparisons could be made between new products from both companies (i.e., Woodcrest versus K8L), they would be made. In the game of leapfrog that we have betweeen AMD and Intel, the comparisons will always be between existing tech and new tech. Will you be pointing out how AMD is "late to the party" when they release their new stuff?

    - Making its debut and availability in volume is an issue for both AMD and Intel. It's not a valid point unless you make it across the board.

    - 65nm will allow clock speeds of Opterons/A64's to increase.. but Conroe/Woodcrest speeds will be increasing as well.
  • ashyanbhog - Thursday, June 8, 2006 - link

    not because AMD got creamed!

    a 35 billion$ dollar turnover company (Intel) is bound to make a comeback one day.

    it Anandtech's review setup, its full of holes

    the mysql benchmark on Dual Dual core opterons where they see a 30% drop against single core dual processor numbers in this becnhmark contradicts their own earlier benchmark where they see a 10% performance increase.

    http://www.anandtech.com/IT/showdoc.aspx?i=2447&am...">http://www.anandtech.com/IT/showdoc.aspx?i=2447&am...

    they also use a substandard MSI motherboard in one of the Opteron systems and fail to mention which system was used for the benchmarks

    mistakes like this, genuine or intentional, are rife throughout the review report

    the whole thing looks like the rig was setup to push the performance diff b/w woodcrest and Opterons to the max,

    why would anybody two months to tweak settings before they publish the review!
  • Questar - Thursday, June 8, 2006 - link

    Why? Because AMD got creamed?
  • duploxxx - Thursday, June 8, 2006 - link

    yeah right its a workstation motherboard it uses an nforce controller so maybe they rate it as server board it still is a budget board used for workstations, not a real server board or server chipset like they used on the intel woodcrest.

    check the servers like sun galaxy and hp dl385 they have amd chipsets... big difference.
    the nforce has a shared memory bus...
  • zsdersw - Thursday, June 8, 2006 - link

    Yeah, that's one of the 3 Opteron servers. At any rate, the MSI board is a basic server board.. it's still a server board.
  • duploxxx - Thursday, June 8, 2006 - link

    yeah they have done 1 real bench with an hp. all other benches were done with the 2 MSI basic boards...

    still waiting for the wintel benches
  • wolaris - Thursday, June 8, 2006 - link

    In corporate environments, no-one with any hardware budget at all runs webserver and database on the same machine, as it hurts both performance and reliability. This affects T1 most, as its low clock speed and simple cores are not meant for database workloads.
    I think that you should run web serving tests using common, high-performance Opteron DB server and separate webservers, as it would be the case in real-world scenarios.
  • MrKaz - Thursday, June 8, 2006 - link

    So Power consuming of the new Intel processor on .65nm at already high clock speed of 3.0Ghz is already consuming more than the older AMD Opteron on .90nm 2.8Ghz and DDR.

    When AMD releases socket F will go DDR2 (less power) and better .90nm samples (lower power). So then "new" Intel is already getting beaten...

    And those tests where done with Cool&Quite?

    Also don’t forget this tests where done with Woodcrest 3.0Ghz VS Opteron 2.2Ghz and 2.4Ghz, so when AMD releases the 2.8Ghz and 3.0Ghz with socket F the performance lead of Intel will vanish…

    I think the biggest surprise here is how bad Xeon (P4) was (IS!!), and people keep buying it.

Log in

Don't have an account? Sign up now