On Tue, May 02, 2006 at 01:42:28AM -0400, Roberto C. Sanchez wrote: > I get your point. Hopefully you get mine :-)
I hope I get both points. ;) My 20 processes of statically linked MySQL may share memory between themselves (because they were forked from a parent??) but if MySQL was linked with libc, that won't be shared with other dynamically linked programs that use libc. So libc is using double the memory in this case. I was looking at /proc/<pid>/smaps for Apache2, postgresql 8.1, and (the famous statically linked MySQL). I just wrote a little perl script to tally up the various counts -- which is probably meaningless (since you can't add up a bunch of processes' shared memory because it's, well shared). The program displays the /proc/<pid>/smaps info for all processes padded and then shows totals. I've clipped all output except for two pids and the total. $ perl smaps.pl `pidof apache2` (5 pids) [...] [9677] size: 62028K rss: 43140K shared_clean: 4388K shared_dirty: 18500K private_clean: 0K private_dirty: 20252K [9675] size: 56360K rss: 38164K shared_clean: 4472K shared_dirty: 21144K private_clean: 0K private_dirty: 12548K [totals] size: 299780K rss: 206820K shared_clean: 20860K shared_dirty: 97476K private_clean: 0K private_dirty: 88484K So, if all those processes are in physical RAM at the same time can I assume that they use at least 88484K (plus whatever is shared in all)? Now looking at MySQL: $ perl smaps.pl `pidof mysqld--kernis` (21 pids) [...] [9265] size: 145668K rss: 36576K shared_clean: 4040K shared_dirty: 0K private_clean: 0K private_dirty: 32536K [9264] size: 145668K rss: 36576K shared_clean: 4040K shared_dirty: 0K private_clean: 0K private_dirty: 32536K [totals] size: 3059028K rss: 768096K shared_clean: 84840K shared_dirty: 0K private_clean: 0K private_dirty: 683256K Here's where I'm curious. 680MB of private memory. It's likely that not all of that will be in RAM at the same time. (For one thing, the machine does not have that much traffic). But, in general, as connections are made to MySQL don't they basially round-robin. In other words, say 10 of the 20 processes have much of their private memory swapped out. It's not like only the 10 with all their memory still in physical RAM will somehow handle all connections to MySQL. So my guess is: Even with low MySQL traffic having more processed than needed causes swapping to happen since connections to MySQL will cycle through all MySQL processes and potentially bring them in and out of physical RAM. Of course, it's not that simple. ;) -- Bill Moseley [EMAIL PROTECTED] -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]