添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
卖萌的眼镜  ·  yolox-ros-deepstream ...·  2 年前    · 
沉着的米饭  ·  storage class ...·  2 年前    · 

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

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

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

This is usually caused by insufficient swap file space. Without it, the system has to refuse fork operations even if it has sufficient free RAM. – David Schwartz Feb 25 '15 at 9:39 Muruga, post values for "free -m" when this occurs and also when the machine is in healthy state. – tedder42 Feb 25 '15 at 16:15

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 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.

Good luck to you!

Yes, I found that very, very occasionally something would trigger my apache Server (running WP) to peak just over its memory usage. Usually it would be some scraping bot or DDOS attach. This would happen maybe once a week, maybe not for 6 weeks. The solution of allocating 1GB of swap drive (on a 2GB memory T2.small instance) just worked perfectly because it is like a big old safety net meaning you won't run out of memory even if that swap drive isn't used for 99.9% of the time. – Duncan Edwards Feb 6 '17 at 13:27 How does this answer have the most upvotes? Wordpress is written in php, and is normally is run with Apache. Whilst it does use mysql, a java app, jenkins and tomcat have nothing to do with a wordpress memory error. And restarting the instance doesn't actually fix the problem, but postpones it. – Jordan Stewart Jul 18 '17 at 2:45

I had same problem to fix it there is 2 options:

1- move from micro instances to small and this was the change that solved the problem (micro instances on amazon tend to have large cpu steal time)

2- tune the mysql database server configuration and my apache configuration to use a lot less memory.

tuning guide for a low memory situation such as this one: http://www.narga.net/optimizing-apachephpmysql-low-memory-server/ (But don't use the suggestion of MyISAM tables - horrible...)

this 2 options will make the problem much much less happening .. I am still looking for better solution to close the process that are done and kill the ones that hang in there .

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.

site design / logo © 2020 Stack Exchange Inc; user contributions licensed under cc by-sa 4.0 with attribution required. rev 2020.3.13.36287