1

I recently bought 512MB, 2.2GHz, 20GB SSD - VPS Server and installed Debian Wheezy 64-bit and it is used as WEB Server. I have installed Apache2, PHP, MySQL, ClamAV, Anti-DDoS, Spam Assain, Postfix, Dovecot and Webmin. Everything is running great except MySQL server which get closed unexpectedly every few hours or minutes sometimes.

I have experienced the same problem on Ubuntu based VPS server with only 256MB RAM long time ago and I fixed it somehow, but I do not remember how, so now I really need help.

Thank you in advance.

xZero
  • 199
  • 2
  • 12

2 Answers2

3

You are probably running into Linux OOM Killer. Try this:

grep -i memory /var/log/syslog

Also, add the output of

free -mt

You may consider buying a larger memory instance or configuring swap space. Alternatively, remove some of the software you have installed.

EDIT:

Try adding/editing my.cnf to say:

innodb_buffer_pool_size = 128M

Then restart mysql.

dmourati
  • 24,720
  • 2
  • 40
  • 69
  • Logs: http://pastebin.com/1HDmwFX3 | I think there must be another alternative because I had 128MB and 256MB server. I experienced this problem on 256MB VPS and fixed it and it worked for a year until I moved to 512MB one. The problem is that I don't remember how I fixed the problem. If I remember correctly, it was something to change in my.conf file. – xZero Dec 31 '13 at 20:02
  • 2
    Out of memory: Kill process 14414 (mysqld) – dmourati Dec 31 '13 at 20:07
  • I followed your advice and modified my.cnf file. Also I created 2GB swap file and set swapines to 3 so swap will be used only if it is really necessary to prevent out-of-memory crashes. The disk is SSD so the performance should not be affected so much in any way. The thing that has really helped me is command for reading log. Firstly I tried to find log manually at /var/log/mysql and I found several empty logs. – xZero Dec 31 '13 at 20:54
0

What kind of virtualization do you use? If it's something like OpenVZ it may 'overbook' memory and in effect do OOM-killer cleanings at the virtual host level, which is beyond your reach.

witkacy26
  • 21
  • 3