一些 apache httpd 进程的内存和 cpu 使用率过高,被内核杀死,但我不知道为什么 httpd 使用这么多内存。我需要一些方法来分析或一些方法来重现。
关于 apache 和 syslog 的一些消息
Server version: Apache/2.2.34 (Unix)
Server built: Aug 17 2017 15:49:40
Run Code Online (Sandbox Code Playgroud)
系统日志消息
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
Run Code Online (Sandbox Code Playgroud)
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
Run Code Online (Sandbox Code Playgroud)
小智 4
这意味着分配 X 内存量的请求失败。因此,Kenrel 调用了 OOM 杀手,它将终止内存消耗最高的应用程序。系统物理内存和/或交换内存不足。可以用作临时修复的方法是增加交换大小,直到向服务器添加更多 RAM 模块或容量。
此外,您很可能已将 Apache 配置为 mpm_prefork 作为 Apache 模块。这种设置很慢而且不是线程安全的。现代 Web 服务器设置使用 Apache 和 mpm_event。这将为您提供更好的性能,而不会耗尽您的所有内存。
归档时间: |
|
查看次数: |
904 次 |
最近记录: |