大网数据广告活动
服务器运维问答

apache httpd process be killed by kernel oom

· 52CE 我爱测

some apache httpd process's memory and cpu usage too high, be killed by kernel, but I don't know why httpd use such many memory. I need some method to analyse or some method to reproduct. some message about the apache and syslog …

问题原文

原帖链接 · user545235 · CC BY-SA 4.0

some apache httpd process's memory and cpu usage too high, be killed by kernel, but I don't know why httpd use such many memory. I need some method to analyse or some method to reproduct.

some message about the apache and syslog

Server version: Apache/2.2.34 (Unix)
Server built:   Aug 17 2017 15:49:40

syslog message

Oct 19 15:28:20 kernel: httpd invoked oom-killer: gfp_mask=0x280da, order=0, oom_adj=0, oom_score_adj=0

Oct 19 15:28:20  kernel: httpd cpuset=/ mems_allowed=0-1

Oct 19 15:28:20  kernel: Pid: 7446, comm: httpd Not tainted 2.6.32_1-12-0-0 #1

Oct 19 15:28:20  kernel: Call Trace:

Oct 19 15:28:20  kernel:  [<ffffffff8108acf6>] ? dump_header+0x7c/0x187

Oct 19 15:28:20  kernel:  [<ffffffff8108b24b>] ? oom_kill_process+0x6c/0x17b

Oct 19 15:28:20  kernel:  [<ffffffff8108b784>] ? out_of_memory+0x32e/0x392

Oct 19 15:28:20  kernel:  [<ffffffff8108f6ce>] ? __alloc_pages_nodemask+0x694/0x7ff

Oct 19 15:28:20  kernel:  [<ffffffff810b60ac>] ? alloc_pages_vma+0x136/0x152

Oct 19 15:28:20  kernel:  [<ffffffff8109f281>] ? handle_pte_fault+0x16f/0x6f0

Oct 19 15:28:20  kernel:  [<ffffffff810033ee>] ? apic_timer_interrupt+0xe/0x20

Oct 19 15:28:20  kernel:  [<ffffffff813c5f70>] ? do_page_fault+0x444/0x46b

Oct 19 15:28:20  kernel:  [<ffffffff810a7984>] ? do_mremap+0x338/0x450

Oct 19 15:28:20  kernel:  [<ffffffff813c389f>] ? page_fault+0x1f/0x30

httpd ps img

Out of memory: Kill process 7446 (httpd) score 422 or sacrifice child

Killed process 7446, UID 500, (httpd) total-vm:922728068kB, anon-rss:28228104kB, file-rss:88kB

社区高分解答

原帖链接 · Zareh Kasparian · CC BY-SA 4.0

This means is that a request to allocate X amount of memory failed. So the Kenrel invoked the OOM killer which will terminates the highest memory consuming applications. System is out of physical and/or swap memory. What can be used as temporary fix, is to increase your swap size, till getting more RAM modules or capacity added to your server.

Also you most likely have configured Apache with mpm_prefork as an Apache module. This setup is slow and not thread safe. Modern web server setups use Apache with mpm_event. This will give you better performance, without eating up all your memory.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2019-10-19)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。