Boost logo

Boost :

Subject: Re: [boost] ACID transactions/flushing/MySQL InnoDB
From: Jose (jmalv04_at_[hidden])
Date: 2009-12-10 20:12:49


On Thu, Dec 10, 2009 at 11:02 PM, Stefan Strasser
<strasser_at_[hidden]> wrote:
>> > what I find surprising is the performance of MySQL for small
>> > transactions. while my library spends 90% of its time waiting for the
>> > disk to flush a transaction, InnoDB uses 100% CPU and barely uses any
>> > disk.

> but, including all the SQL parsing, running 10000 small transactions takes
> about 4 seconds on my system.
> while this little code snippet alone takes 6-7 seconds, with much more disk
> usage:
>
>  int fd=open("test.bin",O_RDWR | O_CREAT | O_NOATIME);
>  for(int c=0;c<10000;++c){
>    write(fd,&data,1);
>    fsync(fd);
>  }
>
> neither fdatasync(), O_WRONLY, nor writing whole sectors instead of just a
> byte make a difference. MySQL also claims to use fsync on the page you
> linked.
>
> do you have an explanation for this?

You should be comparing using msync (not fsync). Also, the high cpu
usage might be caused by innodb gzip compression

regards


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk