我运行 CentOS vps 来托管一些带有 cPanel/WHM 的网站,但时不时地,我的网站会停止工作,因为它无法建立与 mysql 数据库的连接。
查看消息日志,它显示以下内容:
Oct 16 04:03:07 s97-74-228-8 kernel: [54180237.755824] Out of memory in UB 88299: OOM killed process 413 (spamd child) score 0 vm:232540kB, rss:100696kB, swap:0kB Oct 16 04:03:08 s97-74-228-8 kernel: [54180237.863552] Out of memory in UB 88299: OOM killed process 1060 (spamd child) score 31 vm:231516kB, rss:99536kB, swap:0kB Oct 16 04:03:08 s97-74-228-8 kernel: [54180237.888621] Out of memory in UB 88299: OOM killed process 1061 (spamd) score 31 vm:231516kB, rss:99160kB, swap:0kB Oct 16 04:03:08 s97-74-228-8 kernel: [54180237.898954] Out of memory in UB 88299: OOM killed process 25084 (spamd) score 0 vm:231516kB, rss:100204kB, swap:0kB Oct 16 04:03:08 s97-74-228-8 kernel: [54180238.007397] Out of memory in UB 88299: OOM killed process 29642 (mysqld) score 0 vm:7849012kB, rss:62860kB, swap:0kB Oct 16 04:03:08 s97-74-228-8 kernel: [54180238.165135] Out of memory in UB 88299: OOM killed process 29450 (named) score 0 vm:1786256kB, rss:31192kB, swap:0kB Oct 16 04:03:11 s97-74-228-8 kernel: [54180241.036672] Out of memory in UB 88299: OOM killed process 1191 (mysqld) score 0 vm:1662420kB, rss:42300kB, swap:0kB Oct 16 04:03:12 s97-74-228-8 kernel: [54180242.761161] Out of memory in UB 88299: OOM killed process 1362 (mysqld) score 0 vm:807072kB, rss:40124kB, swap:0kB Oct 16 04:03:16 s97-74-228-8 kernel: [54180246.167647] Out of memory in UB 88299: OOM killed process 1434 (mysqld) score 0 vm:2188788kB, rss:43808kB, swap:0kB Oct 16 04:03:31 s97-74-228-8 kernel: [54180261.056050] Out of memory in UB 88299: OOM killed process 1562 (mysqld) score 0 vm:7980592kB, rss:59692kB, swap:0kB
在我的网站出现故障后,我通过 ssh 登录,但最多只看到使用了 446MB/3072MB 左右的空间。
说实话,不太确定要做什么,任何帮助将不胜感激:)
亚历克斯
答案1
您可以在以下位置创建自定义 my.cnfhttps://tools.percona.com。我通过使用他们的 MySQL 配置向导成功地防止了 OOM。请确保为操作系统、CPanel 以及系统上运行的任何其他内容留出足够的 RAM。