> I'm using mysql 5.1.24-rc in 5 separate jails.
> 10 clients are pushing queries (10 separate machines). 2 clients to 1 mysql daemon. One client is performing an update on param_stat_short_level_1_0, second on param_stat_short_level_1_1.
> Each client needs to push 150000 queries (client is spawning 15 forks to push the 150000, so each fork is pushing 10000, each fork is opening it's own mysql connection).
> query to push:
> INSERT INTO param_stat_short_level_1_0 SET param = '10311', object = '10311', value = '4283' ON DUPLICATE KEY UPDATE param = '10311', object = '10311', value = '4283', min = IF(4283<min,4283,min), max = IF(4283>max,4283,max), counter = counter+1;
> Always a different param, and object values, value is rand(1,10000).
> Stats for the operations are in http://p1.kei.pl/stats.
> Stats are collected after each clients pushes 150000, 100 times.
> My point here is that MySQL on Linux (p5) performs 150000 queries in an average of 18.1099, when the same queries on FreeBSD (p1) takes 28.7643.
> Did I misconfigured something or this are the proper result and FreeBSD just could not give more?
It would be very helpful if you provided I/O usage as well. I guess the FreeBSD box appears to be I/O-bound. Re-run your benchmarks with noatime mount option on the partition which holds database files (or even make that partition async as some Linux filesystems do).
I think Linux outperforms FreeBSD that much in the test because of it's variable sized disk buffer cache (vs FreeBSD's fixed sized one). You can figure out how much data has to be actually written to disk and set vfs.hibufspace, vfs.lobufspace and vfs.maxbufspace sysctls in the /boot/loader.conf appropriately. Other vfs.* sysctls can also be helpful.
> My configs below, thanks for Your time.