Apache服务突然停止,查看erorr.log,出现如下报错信息:
[Sat May 01 14:45:18 2010] [warn] pid file /var/run/apache2.pid overwritten -- Unclean shutdown of previous Apache run?
[Sat May 01 14:45:18 2010] [notice] Apache/2.2.11 (Ubuntu) PHP/5.3.2 configured -- resuming normal operations
[Sat May 01 14:45:18 2010] [alert] (11)Resource temporarily unavailable: apr_thread_create: unable to create worker thread
[Sat May 01 14:45:18 2010] [alert] (11)Resource temporarily unavailable: apr_thread_create: unable to create worker thread
[Sat May 01 14:45:20 2010] [alert] No active workers found... Apache is exiting!
我查找相应的链接:
https://serverfault.com/questions/137769/apache2-is-not-starting-my-webserver/137782#137782
其中有这么一段:
On Linux, this is usually due to high ThreadsPerChild + high or unlimited ulimit -s.
On Linux, the default stack size for each thread is ulimit -s value or 8-10 megabytes -- Apache needs about 512 kilobytes of stack space or less under normal use.
This quickly overruns either 32-bit address space size with TPC near 200+, or if you have system memory limits you can run afoul of them as well.
Set ulimit -s 512 in your "envvars" file shipped alongside apachectl -- note that ThreadStackSize does not help here because that sets a minimum.
首先我使用ulimit -s查看服务器是8M
把上面的英文翻译成中文:
这个问题是由于很高的子进程的并发线程数+没有限制或者很高的线程默认的栈空间大小导致的
在Linux上,每个线程的默认栈空间大小为8M或者10M。 Apache需要512K的栈空间大小。
打红色的这段文字的意思是不是apache的每个线程的栈空间只需要设置成512K就可以了 ?
|