Hazard's stuff

14 Jan, 2007

OpenVZ hints

— Posted by hazard @ 2007-01-14 05:29
Here are a few useful hints I learned while I was setting up VPS for hazardous-area.org:

  • Default mysql+apache installation WON'T fit into 128 Mb of memory on OpenVZ VPS, and you'll get memory allocation errors. The core of the issue is that OpenVZ apparently takes into account all memory allocated by processes, even if it hasn't been used. To overcome the problem you need to minimize allocated memory use:
    • Use minimal mysqld config (copy my-small.cnf from /usr/share/doc/mysql-server*).
    • Add "skip-innodb" to my.cnf - it will reduce MySQL server memory footprint by about 100 MB.
    • Use lighttpd instead of Apache.
  • openvzmon is a nifty tool which gives more realistic report on CPU and memory usage by your OpenVZ VPS.
  • Also you can get useful stats from /proc/user_beancounters.


Comments


Add comment