Ubuntu mounting /var/run in RAM causes MySQL death
Warning: apparently, Ubuntu decided to mount /var/run as a ramdisk, so if you run MySQL on it, eventually your transaction log (or something stored in /var/run/mysql) will grow so big that it will exhaust /var/run. The result of this is, your MySQL will seize up and die and your website will be unavailable.
However, now that I’ve rigged /var/run to be on disk, I don’t know what the result of holding around all these files will be either, so I may be hosed either way. Thoughts? Comments?
Filesystem Size Used Avail Use% Mounted on
varrun 506M 176K 506M 1% /var/run
And I run MySQL like so:
5032 ? S 0:00 /bin/sh /usr/bin/mysqld_safe
5072 ? Sl 0:00 /usr/sbin/mysqld –basedir=/usr –datadir=/var/lib/mysql –user=mysql –pid-file=/var/run/mysqld/mysqld.pid –skip-external-locking –port=3306 –socket=/var/run/mysqld/mysqld.sock
(K)Ubuntu of course. My idea is that you configure MySQL to store logs somewhere else.
/etc/mysql/my.cnf : log_bin = /var/log/mysql/mysql-bin.log
Change it if you want.
Thorns
23 Oct 07 at 12:22 pm
That just seems wrong, I expect everything under /var to persist across reboots, and I expect /tmp to go byebye (I think solaris is right to mount it in ram).
Ronald Pottol
27 Jan 08 at 10:58 pm
@ronald: The reason is, /var/run holds the pids of all the running services, so mounting /var/run in RAM lets you avoid “server didn’t terminate properly, so initscripts still thinks it’s running”. There’s got to be a better way to do this though…
Paul Betts
5 Feb 08 at 12:23 pm