Skip navigation links

User Comments

Posted by P Otto on January 8 2008 9:57am[Delete] [Edit]

I benchmark my MySQL database regularly using the sysbench facility and I have been testing various software configurations on the same box trying to achieve the best performance. Having found this reference I wish to share my test results I produced over a few months, testing performance while using various compilation options.

The host used for testing was http://www.securitybay.co.uk/ running RedHat Enterprise/Linux Kernel 2.6.9-55.0.2.ELsmp and the 5.0.45 MySQL with the following hardware configuration:
- Dual Intel Xeon Processor 3.4GHz with 2MB Cache
- 8 GB RAM
- Dual 136 GB SCSI Drive

Tests were performed while MySQL server was under insignificant load generated by the Internet traffic during night hours, utilizing no more than a fraction of per cent of the server power at the testing time.

I got these interesting results showing that using pgcc instead of gcc can have a significant impact on the Linux/MySQL server performance.

The testing application was sysbench with the maximum number of requests limited to 10000 for testing.

Benchmark results for the out-of-the box, pre-compiled RedHat Enterprise/MySQL 5.0.45:

OLTP test statistics:
queries performed:
read: 140000
write: 50000
other: 20000
total: 210000
transactions: 10000 (183.60 per sec.)
deadlocks: 0 (0.00 per sec.)
read/write requests: 190000 (3018.38 per sec.)
other operations: 20000 (307.20 per sec.)

Test execution summary:
total time: 62.5700s
total number of events: 10000
total time taken by event execution: 62.2566
per-request statistics:
min: 0.0026s
avg: 0.0062s
max: 0.4933s
approx. 95 percentile: 0.0085s

Threads fairness:
events (avg/stddev): 10000.0000/0.00
execution time (avg/stddev): 62.2566/0.00

Benchmark results for RedHat Enterprise/MySQL 5.0.45 compiled with pgcc and everything with -O6:

OLTP test statistics:
queries performed:
read: 140000
write: 50000
other: 20000
total: 210000
transactions: 10000 (193.30 per sec.)
deadlocks: 0 (0.00 per sec.)
read/write requests: 190000 (3201.42 per sec.)
other operations: 20000 (329.70 per sec.)

Test execution summary:
total time: 59.6500s
total number of events: 10000
total time taken by event execution: 59.3844
per-request statistics:
min: 0.0020s
avg: 0.0061s
max: 0.4522s
approx. 95 percentile: 0.0081s

Threads fairness:
events (avg/stddev): 10000.0000/0.00
execution time (avg/stddev): 59.3844/0.00

The above shows a slight, but visible performance gain when using pgcc instead of the gcc compiler. Further tests only confirmed this observation, and the overall performance increase was between 2% to 6% for the same hardware.

There is a built-in support for some Intel Pentium-specific operations in pgcc compiler, which allow code to be compiled with various Pentium optimizations. Thus the execution speed of the binaries is higher on a Pentium box.

P Otto