优化openvz 内存
修改/etc/security/limits.conf
www-data hard stack 256
修改/etc/pam.d/common-session
session required pam_limits.so
In CentOS the file to edit would be /etc/pam.d/system-auth
vi /etc/my.cnf
Default MySQL server configuration is quite heavy on resource usage.
Solution:
Update or modify the following settings inside my.cnf (/etc/my.cnf or /etc/mysql/my.cnf)
Code:
[mysqld]
key_buffer = 16K
max_allowed_packet = 1M
table_cache = 4
sort_buffer_size = 64K
read_buffer_size = 256K
read_rnd_buffer_size = 256K
net_buffer_length = 2K
thread_stack = 64K
skip-innodb
# this option may not work - if it doesn't simply omit it.
# known not to work in ubuntu 9.10, and likely other recent distributions as well.
skip-bdbThis performance tuning can reduce MySQL memory usage by over 100 MB (even making it possible to run on our Nano plan).