Home » Performance » MySQL » Poor performance on Intel Core 2 CPU
Poor performance on Intel Core 2 CPU [message #1045] Sun, 08 April 2007 09:56 Go to next message
lapa  is currently offline lapa
Messages: 3
Registered: April 2007
Location: Ukraine
Junior Member
Hi everybody!

I have following MySQL environments:

1. Developer - AMD Sempron based PCs
2. Developer - Intel Core 2 Duo based PCs
3. Server - 4 x Xeon

The performance on Intel machines in comparison with AMD's is poorer in times.

Restoration of 50 GB Database on AMD machine takes up to 30 seconds while on any Intel base PC it takes up to 15 minutes.

Xeon and Intel Core 2 Duo machines are highly loaded with IO (disk) operations while CPU remains almost untouched (3-4%, literally idle).

I've tried default configuration as well as custom tuning of my.ini - no luck.

Any ideas?

My current configuration (AS IS):


[client]
port=3306


[mysql]
default-character-set=utf8


[mysqld]
port=3306

basedir="C:/Program Files/MySQL/MySQL Server 5.1/"
datadir="C:/Program Files/MySQL/MySQL Server 5.1/Data/"

default-character-set=utf8

default-storage-engine=INNODB

sql-mode=" STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTI ON "

max_connections=100

query_cache_size=50M

table_cache=512

tmp_table_size=50M


thread_cache_size=8


#*** MyISAM Specific options
myisam_max_sort_file_size=100G
myisam_max_extra_sort_file_size=100G
myisam_sort_buffer_size=16M
key_buffer_size=9M
read_buffer_size=64K
read_rnd_buffer_size=256K


sort_buffer_size=256K


#*** INNODB Specific options ***
innodb_additional_mem_pool_size=200M
innodb_flush_log_at_trx_commit=1
innodb_log_buffer_size=10M
innodb_buffer_pool_size=512M
innodb_log_file_size=16M
innodb_thread_concurrency=8

[Updated on: Sun, 08 April 2007 10:01]

Re: Poor performance on Intel Core 2 CPU [message #1047 is a reply to message #1045 ] Sun, 08 April 2007 11:11 Go to previous messageGo to next message
sterin  is currently offline sterin
Messages: 324
Registered: March 2007
Location: Sweden
Senior Member
It should be basically almost only IO that limits in that case.

First of all have you compared the ini files between the AMD and the other servers to see if there is any difference?

What kind of disk setup do you have in the different machines?

Do you read the 50Gb file that you are importing from the same disk as your databases are located on?

Are they all the same type of OS?


Because I can tell you that this has nothing to do with if it's an AMD or an Intel CPU in the box.
This is about what disks you have, how they are setup, what cache is activated, how much RAM you have available for OS cache etc.
Re: Poor performance on Intel Core 2 CPU [message #1052 is a reply to message #1045 ] Mon, 09 April 2007 01:13 Go to previous messageGo to next message
seunosewa  is currently offline seunosewa
Messages: 2
Registered: April 2007
Junior Member
Quote:

Xeon and Intel Core 2 Duo machines are highly loaded with IO (disk) operations while CPU remains almost untouched (3-4%, literally idle).

That says it all. The slow performance is a result of the IO operations. Wink
Re: Poor performance on Intel Core 2 CPU [message #1055 is a reply to message #1047 ] Mon, 09 April 2007 10:10 Go to previous messageGo to next message
lapa  is currently offline lapa
Messages: 3
Registered: April 2007
Location: Ukraine
Junior Member
sterin wrote on Sun, 08 April 2007 18:11

It should be basically almost only IO that limits in that case.

First of all have you compared the ini files between the AMD and the other servers to see if there is any difference?

What kind of disk setup do you have in the different machines?

Do you read the 50Gb file that you are importing from the same disk as your databases are located on?

Are they all the same type of OS?


Because I can tell you that this has nothing to do with if it's an AMD or an Intel CPU in the box.
This is about what disks you have, how they are setup, what cache is activated, how much RAM you have available for OS cache etc.


It is clear that IO is the reason.

I am sorry about DB size - it's 50MB not GB.

But the question is: why a performance degradation take place on Intel PC but not happens on AMD PC with the same MySQL settings.


AMD developer machine:
OS: Windows XP 32 SP2
MB: Epox NVidia NForce 3
CPU: AMD Athlon 64 3000+
Drive: Seagate Barracuda EIDE ATA-100, 7200 RPM, 8MB
Single hard drive

Intel developer machine:
OS: Windows XP 32 SP2
MB: MSI P965 NEO, Intel P965
CPU: Intel Core 2 6400 2.13 GHz
Drive: WD Caviar SE16. SATA, 400 GB, 16 MB Cache, 7200 RPM, 300 MB/s
Single hard drive connected through JMicron JMB36x RAID Controller as sole way of using hard drive with Intel P965 mother board logic.

HP Intel Xeon server:
OS: Windows 2003 Standard Server R2
CPU: 2 x Xeon 3.00 GHz
Drive: HP Smart Array 6i (RAID 5)

I've tried same default my.ini on all machines as well as custom tuned my.ini's - no diffrence.

MySQL: 5.1.12-beta
Restoration methods:
1. With MySQL Administrator (from mysql-gui-tools-5.0-r9a-win32.msi)
2. By command: mysql -hlocalhost -u%dbuser% -p%passw% %dbname% backup_file.sql

With the same MySQL configuration Intel machine 30 times slower as against AMD.

AMD machine: High IO load with 40-60% CPU utilization

Intel machines: High IO load with 2-4% CPU utilization

[Updated on: Mon, 09 April 2007 10:16]

Re: Poor performance on Intel Core 2 CPU [message #1058 is a reply to message #1045 ] Mon, 09 April 2007 15:40 Go to previous messageGo to next message
seunosewa  is currently offline seunosewa
Messages: 2
Registered: April 2007
Junior Member
You can try disabling the IO operations on both PCs and then testing the performance again. You can also check the RAM. Wink
Re: Poor performance on Intel Core 2 CPU [message #1059 is a reply to message #1045 ] Tue, 10 April 2007 06:28 Go to previous messageGo to next message
sterin  is currently offline sterin
Messages: 324
Registered: March 2007
Location: Sweden
Senior Member
Try setting:
innodb_flush_log_at_trx_commit=0

and see if things speed up.

If that is set to default 1 it means that the transaction log needs to be flushed to disk after each transaction. And if you are running in autocommit mode then every statement is a transaction.

And basically a disk actually only supports about 167 flushes per second:
Quote:


Wrap several modifications into one transaction. InnoDB must flush the log to disk at each transaction commit if that transaction made modifications to the database. The rotation speed of a disk is typically at most 167 revolutions/second, which constrains the number of commits to the same 167th of a second if the disk does not “fool” the operating system.



So if your disk on the AMD is reporting that it has written it to disk although it only has stored it in cache.
While your Intel machines is waiting for the writing to actually occure it would give two very different figures for speed.

BTW do you have a write cache on the HP RAID installed?

Also:
Quote:


When importing data into InnoDB, make sure that MySQL does not have autocommit mode enabled because that requires a log flush to disk for every insert. To disable autocommit during your import operation, surround it with SET AUTOCOMMIT and COMMIT statements:

SET AUTOCOMMIT=0;
... SQL import statements ...
COMMIT;

If you use the mysqldump option --opt, you get dump files that are fast to import into an InnoDB table, even without wrapping them with the SET AUTOCOMMIT and COMMIT statements.



See here:
http://dev.mysql.com/doc/refman/5.1/en/innodb-tuning.html

[Updated on: Tue, 10 April 2007 06:31]

Re: Poor performance on Intel Core 2 CPU [message #1127 is a reply to message #1059 ] Sat, 21 April 2007 04:36 Go to previous messageGo to next message
lapa  is currently offline lapa
Messages: 3
Registered: April 2007
Location: Ukraine
Junior Member
sterin wrote on Tue, 10 April 2007 13:28

Try setting:
innodb_flush_log_at_trx_commit=0




Your prompt advice had helped me a lot.

Sterin, great thanks!

To Swedish developers
http://upload.wikimedia.org/wikipedia/commons/thumb/4/4c/Flag_of_Sweden.svg/250px-Flag_of_Sweden.svg.png

From Ukrainian developers
http://upload.wikimedia.org/wikipedia/commons/thumb/4/49/Flag_of_Ukraine.svg/250px-Flag_of_Ukraine.svg.png

[Updated on: Sat, 21 April 2007 04:38]

Re: Poor performance on Intel Core 2 CPU [message #1625 is a reply to message #1127 ] Thu, 16 August 2007 11:34 Go to previous messageGo to next message
Peter  is currently offline Peter
Messages: 405
Registered: August 2006
Senior Member
Super Guru
I guess in your case AMD boxes are faking fsync
which means it can be dangerous as database can get corrupted in case of crash.


Peter Zaitsev, MySQL Performance Expert
MySQL Performance Blog - http://www.mysqlperformanceblog.com
MySQL Consulting http://www.mysqlperformanceblog.com/mysql-consulting/
icon14.gif  Re: Poor performance on Intel Core 2 CPU [message #2545 is a reply to message #1059 ] Fri, 25 January 2008 06:00 Go to previous message
kintlawy@gmail.com  is currently offline kintlawy@gmail.com
Messages: 1
Registered: January 2008
Junior Member
Hi,

I just wanted to let you know that aside from being a MySQL demi-God, you are a gentleman and a scholar. Your suggestion here has fixed a slow update problem that has been driving me bananas for two years now (the performance issue was only showing up on *some* of my servers).

Thanks a million from a programmer in France. Laughing Very Happy
Previous Topic:cpu load 100%
Next Topic:mysql restart
Goto Forum:
  


Current Time: Fri Jul 10 06:25:23 EDT 2009

Total time taken to generate the page: 0.00601 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 2.7.7.
Copyright ©2001-2007 FUD Forum Bulletin Board Software

MySQL is a trademark of Sun Microsystems.
InnoDB is a trademark of Oracle Corp.

Percona Performance Forums are a service of Percona, Inc.
Not affiliated with Sun Microsystems or Oracle Corp.