Posted on:
Last modified:
有一台 512M 内存的小机器总是报数据库错误,查看了下日志是 OOM 了
解决方案:
一 Add swap file to cloud instance
http://www.prowebdev.us/2012/05/amazon-ec2-linux-micro-swap-space.html
Some useful command related to SWAP space:
$ swapon -s
$ free -k
$ swapoff -a
$ swapon -a
二 limit mysql buffersize
innodb_buffer_pool_size = 8M
三 limit apache memory cosumption,editing /etc/apache2/mods-enabled/mpm_prefork.conf
<IfModule mpm_prefork_module>
StartServers 3
MinSpareServers 3
MaxSpareServers 5
MaxRequestWorkers 25
MaxConnectionsPerChild 0
</IfModule>
© 2016-2022 Yifei Kong. Powered by ynotes
All contents are under the CC-BY-NC-SA license, if not otherwise specified.
Opinions expressed here are solely my own and do not express the views or opinions of my employer.
友情链接: MySQL 教程站