I have a 64-bit server (with 64-bit OS and MySQL) with 4 gigs of RAM and 2 gigs of swap. We run MySQL 5.0.22 (installed from the CentOS 5.0 RPM). Nothing else runs on the server.
We have a problem where MySQL eats up more and more RAM until it starts swapping, then it eats up the swap until the OS kills it because there is nothing left to be allocated. It takes weeks sometimes for it to creep to the limit, but performance drops over time as well, due to swapping.
The database is extremely write-heavy, uses InnoDB almost exclusively (some logs are stored in MyISAM), and is about 300 gigabytes in size (~90 billion rows total).
MySQL has been up for about six days right now and is using 5770MB of memory. Even with shared libraries and other such memory use, I can’t figure out how it is using that much memory based on that configuration. How can I fix my configuration? Per the InnoDB tuning guide on the blog, I should be able to set the buffer pool size to be 70% of total RAM, which would cause MySQL to crash within hours.
I’d like to work on performance tuning, but as long as MySQL is crashing, I don’t know how I can.
I appreciate any help. I’m sure I’m missing something simple.
Yeah, I looked into the swappiness setting a long while ago. It’s set at the default (60) now. It doesn’t affect performance much since MySQL is the only thing running anyway.
We have the out of memory error come up because the server doesn’t have enough swap (we have 2 gigs of swap for 4 gigs of RAM, which isn’t ideal… if I had a chance to go back and smack the datacenter tech, I probably would). But even still, I just can’t figure out why MySQL is using so much RAM.
I guess I’ll just wait until December when we get new servers anyway. sigh Maybe I’ll look into PostgreSQL )