MySQL keeps crashing - Don't know why
Hello,
I'm currently running LAMP on an Amazon instance. The OS is from the Amazon 64 bit image. Basically, every so often MySQL seems to go down. All of my sites fail to connect to their databases. I then have to SSH in and restart mysqld. Heres the last 30 lines of /var/log/mysqld.log Quote:
Thanks! |
Quote:
|
Surely SELinux needs to remain in place? This system was created from the exact same image as another system (so they're identical in terms of configuration). The other system works fine but handles a much lower load. Do you think this could be caused by running out of memory? How can I check this?
Thanks |
As my understand, the above error seems that MySQL cannot create enough threads at startup. Did you take a look at /var/log/messages to see if it has anything relate to mysqld?
I suggest you start MySQL in debug mode for more details: http://forge.mysql.com/wiki/How_to_R...ith_a_Debugger |
I would start by running collectl on the box. When mySQL crashes, go back and plot the collectl data to see which resource was getting starved. If nothing jumps out, drop the monitoring interval to 1 second and try again. There's often a clue in the data somewhere if it's a system/resource problem.
-mark |
Ahh yes, it's a memory issue. Looking at that I can see that several mysqld and httpd processes have been killed off.
When I run 'top' I can see that most of the swap figures are at 0. 0k total, 0k used, 0k free, 24000k cached I'm not great at this, but should I be seeing some figures here? I mean, once memory gets used up doesn't it try using pagefiles? Is there a way that I can prevent the processes from being killed off other than upgrading the memory? Thanks! |
I guess you need to increase the stack size. Run
Code:
ulimit -s Code:
ulimit -s xxxx Regards |
I've got around this with some optimization. I've removed a load of services I don't actually need. I've optimized both httpd and mysqld to be more efficient. It's been running smoothly for a few days now and memory usage is much lower than what it used to be :)
Thanks for all your help! |
All times are GMT -5. The time now is 10:58 AM. |