List:Internals« Previous MessageNext Message »
From:Joseph Benden Date:April 1 2007 8:03pm
Subject:mysqlclient performance with syscalls
View as plain text  
Hello,

I cannot find anyone mentioning this elsewhere on the web or this list 
so I was wondering...

I'm trying to squeeze all the performance possible from every piece of 
my Solaris systems.  The last piece that is bugging me is the high 
number of system calls experienced on the machines.  In analyzing the 
web server, I found the problem was the read() system call.  Next, I 
wanted to know what sizes were being read and where from.  It turns out 
the read()s are from the mysqlclient library and are 4 byte reads.

           value  ------------- Distribution ------------- count
               0 |                                         0
               1 |@@@@@                                    3447
               2 |@                                        616
               4 |@@@@@@@@@@@@@@@@@@@                      12531
               8 |@                                        626
              16 |@@@@@@@@                                 4966
              32 |@@                                       1158
              64 |                                         153
             128 |                                         29
             256 |                                         15
             512 |                                         5
            1024 |                                         17
            2048 |                                         0
            4096 |                                         0
            8192 |@@@@                                     2667
           16384 |                                         0


Upon further research with dtrace, I've found these read()s to 
correspond with the MySQL protocol packet header being read().

I was wondering why a buffered approach wasn't taken.  ie: A general 
buffered read() of everything possible from the wire and the protocol 
code asking for the number of bytes from that buffered area. I feel that 
in doing this many system calls could be reduced, which would increase 
the speed of using the library.

Comments, suggestions, ideas?  Thanks,
-Joseph Benden
Thralling Penguin LLC

Thread
mysqlclient performance with syscallsJoseph Benden1 Apr
  • Re: mysqlclient performance with syscallsMark Callaghan2 Apr
  • Re: mysqlclient performance with syscallsChad MILLER2 Apr