mysql does not start and parallels is not working

I just experienced a major server breakdown in 1and1. MySQL crashed and when I tried to restart it the result would be negative:

 

Then I restarted the server and the problem persisted.

So my third action was to have a look at my Parallels Plesk web panel, and the result was that it would not load, showing a MySQL problem.

I then figured out that the problem could be a lack of memory, so I entered with ssh to the server and started listing directory sizes, using the great “du” linux command:

du -h –max-depth=1

until i found that the problem was in the backups folder:

/var/lib/psa/dumps

then I deleted one of the backup folders and could restart mysql

service mysqld restart

Thanks to this guide for the du parameters: http://www.linfo.org/du.html

 

 

mysql keeps crashing, how to solve it?

I am using a very simple digitalocean basic server with 512mb RAM, and using Ubuntu 12.04 64bits

I tried the recommendations here:

https://www.digitalocean.com/community/questions/mysql-on-ubuntu-keeps-crashing

But still keeps crashing, so I have looked for further information, and this one seems to be a good guide to tweak the server, both apache and mysql:

https://library.linode.com/troubleshooting/memory-networking#sph_apache-2-low-memory-settings

I think that the key point for me is that I chose Ubuntu 64 bits without being aware that 64 bits Ubuntu takes around 50% more memory than 32 bits

So now I guess the solution is to downgrade to a 32bit server, which will be a bit of a pain… but if this solves the performance issue, then I will surely do it.

 

 

how to avoid receiving an email every time a cron task is executed

How can you disable the automatic sending of mails to the sysadmin in linux/unix each time a task is run in the crontab list?

I found the solution thanks to a very useful explanation between adding:

>/dev/null

or

>/dev/null &2>1

to a cron task.

Both of them avoid that an email is sent everytime a task is completed. But in the second case it will also avoid sending error mails.

Read the details here http://www.mydigitallife.info/cron-differences-between-devnull-21-and-devnull/

The mails are sent if you don’t use either of those two at the end of the cron task. I didn’t know it and was receiving tons of alerts, since I have a cron every two minutes!