无法分配内存:fork:无法派生新进程? [英] Cannot allocate memory: fork: Unable to fork new process?

查看:710
本文介绍了无法分配内存:fork:无法派生新进程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们在aws中托管我们.最近,在将博客从wordpress移到aws之后,我们发现服务器响应时间明显延迟.主要是在访问博客时.以下是error_log文件的日志,

We have our hosting in aws. Recently after moving our blog from wordpress to aws, we are experiencing noticeable delay in server response time. Mainly while accessing the blog. Below are the logs from the error_log file,

[Wed Feb 25 06:10:10 2015] [error] (12)Cannot allocate memory: fork: Unable to fork new process
[Wed Feb 25 06:12:22 2015] [error] (12)Cannot allocate memory: fork: Unable to fork new process
[Wed Feb 25 06:12:36 2015] [error] (12)Cannot allocate memory: fork: Unable to fork new process
[Wed Feb 25 06:12:50 2015] [error] (12)Cannot allocate memory: fork: Unable to fork new process
[Wed Feb 25 06:13:35 2015] [error] (12)Cannot allocate memory: fork: Unable to fork new process
[error] (12)Cannot allocate memory: fork: Unable to fork new process
[Wed Feb 25 06:27:14 2015] [error] (12)Cannot allocate memory: fork: Unable to fork new process

我们在php.ini文件中将内存大小从256 mb增加到了512 mb.但是,问题仍然存在.

We increased the memory size from 256 to 512 mb in php.ini file. But, still the issue exist.

我们还将KeepAlive更改为开".仍然无法解决.任何建议/解决方案都会有很大帮助.

We also changed the KeepAlive as On. Still it doesn't resolve. Any suggestions / solutions would be of great help.

推荐答案

我在用jenkins,mysql&托管Java应用程序时遇到了这个问题.在AWS虚拟机上的ubuntu上的tomcat.

I've face that problem either while hosting a java app with jenkins, mysql & tomcat on ubuntu on an vm of AWS.

我用来解决重启虚拟机问题的第一步.

First steps I used to solve the problem with restarting a vm.

默认情况下,AWS不会在硬盘驱动器上提供交换内存,因此您最好动手操作.如何执行此操作,您可以在此处找到.需要提及的是:带有交换区域的解决方案(不知道为什么)对我不起作用,我不得不创建一个交换文件.

AWS doesn't give swap memory on a harddrive by default, so you'd better to make it with your hands. How to do this you can find here. Need to mention: the solution with swap zone (have no idea why) haven't work for me, I had to create a swap file.

祝你好运!

这篇关于无法分配内存:fork:无法派生新进程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆