免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1826 | 回复: 1
打印 上一主题 下一主题

[服务应用] Apache报错 Resource temporarily unavailable: apr_thread_create [复制链接]

论坛徽章:
5
程序设计版块每日发帖之星
日期:2016-04-15 06:20:00每日论坛发贴之星
日期:2016-04-15 06:20:0015-16赛季CBA联赛之八一
日期:2016-07-08 09:20:28操作系统版块每日发帖之星
日期:2016-08-03 06:20:002016科比退役纪念章
日期:2016-10-30 13:59:12
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2017-08-17 17:53 |只看该作者 |倒序浏览
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就可以了 ?







论坛徽章:
33
荣誉会员
日期:2011-11-23 16:44:17天秤座
日期:2014-08-26 16:18:20天秤座
日期:2014-08-29 10:12:18丑牛
日期:2014-08-29 16:06:45丑牛
日期:2014-09-03 10:28:58射手座
日期:2014-09-03 16:01:17寅虎
日期:2014-09-11 14:24:21天蝎座
日期:2014-09-17 08:33:55IT运维版块每日发帖之星
日期:2016-04-17 06:23:27操作系统版块每日发帖之星
日期:2016-04-18 06:20:00IT运维版块每日发帖之星
日期:2016-04-24 06:20:0015-16赛季CBA联赛之天津
日期:2016-05-06 12:46:59
2 [报告]
发表于 2017-08-17 21:29 |只看该作者
回复 1# 274920831

[Sat May 01 14:45:18 2010] [warn] pid file /var/run/apache2.pid overwritten -- Unclean shutdown of previous Apache run?
你确定这是最近的问题?


您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP