Bob*_*ani 4 php apache memory-leaks memory-management amazon-web-services
我遇到了一个反复出现的问题,为什么在过去两天的大约同一时间我的ubuntu服务器完全无法使用。在崩溃期间,我什至无法通过SSH进入。
Ubuntu服务器在amazon aws t2.micro实例上,在1 gb的ram上运行,Ubuntu 16.04 apache错误日志如下所示
[Wed Aug 30 18:02:23.710072 2017] [autoindex:error] [pid 7505] [client 60.191.38.77:57957] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.html,index.cgi,$
[Wed Aug 30 18:02:23.710126 2017] [:error] [pid 7505] [client 60.xx.xx.xx:57957] script '/var/www/html/404.php' not found or unable to stat
[Wed Aug 30 19:11:54.375001 2017] [autoindex:error] [pid 11307] [client 45.55.21.189:52050] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.html,index.cgi$
[Wed Aug 30 19:11:54.376134 2017] [:error] [pid 11307] [client 45.xx.xx.xx:52050] script '/var/www/html/404.php' not found or unable to stat
mmap() failed: [12] Cannot allocate memory
mmap() failed: [12] Cannot allocate memory
mmap() failed: [12] Cannot allocate memory
mmap() failed: [12] Cannot allocate memory
mmap() failed: [12] Cannot allocate memory
mmap() failed: [12] Cannot allocate memory
mmap() failed: [12] Cannot allocate memory
mmap() failed: [12] Cannot allocate memory
mmap() failed: [12] Cannot allocate memory
[crit] Memory allocation failed, aborting process.
[crit] Memory allocation failed, aborting process.
[Wed Aug 30 20:50:00.570286 2017] [core:notice] [pid 31139] AH00051: child pid 17670 exit signal Aborted (6), possible coredump in /etc/apache2
[crit] Memory allocation failed, aborting process.
[crit] Memory allocation failed, aborting process.
[crit] Memory allocation failed, aborting process.
[crit] Memory allocation failed, aborting process.
[crit] Memory allocation failed, aborting process.
[Wed Aug 30 21:03:27.234926 2017] [core:notice] [pid 31139] AH00051: child pid 18507 exit signal Aborted (6), possible coredump in /etc/apache2
[Wed Aug 30 21:03:27.354905 2017] [core:notice] [pid 31139] AH00051: child pid 18511 exit signal Aborted (6), possible coredump in /etc/apache2
[Wed Aug 30 21:03:27.354927 2017] [core:notice] [pid 31139] AH00051: child pid 18512 exit signal Aborted (6), possible coredump in /etc/apache2
[Wed Aug 30 21:03:42.865027 2017] [core:notice] [pid 31139] AH00051: child pid 18506 exit signal Aborted (6), possible coredump in /etc/apache2
[Wed Aug 30 21:03:46.984235 2017] [core:notice] [pid 31139] AH00051: child pid 18529 exit signal Aborted (6), possible coredump in /etc/apache2
[crit] Memory allocation failed, aborting process.
[crit] Memory allocation failed, aborting process.
[crit] Memory allocation failed, aborting process.
[crit] Memory allocation failed, aborting process.
[Wed Aug 30 21:14:50.194072 2017] [core:notice] [pid 31139] AH00051: child pid 18605 exit signal Segmentation fault (11), possible coredump in /etc/apache2
[Wed Aug 30 21:14:50.482541 2017] [core:notice] [pid 31139] AH00051: child pid 18618 exit signal Aborted (6), possible coredump in /etc/apache2
[Thu Aug 31 07:09:50.271441 2017] [mpm_prefork:notice] [pid 1321] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Thu Aug 31 07:09:50.274044 2017] [core:notice] [pid 1321] AH00094: Command line: '/usr/sbin/apache2'
Run Code Online (Sandbox Code Playgroud)
根据AWS上的日志和流量监控器,服务器将在此时间Wed Aug 30 19:11:54左右无法访问 。
我对Apache在内存和并发连接方面的工作方式了解甚少。我进入的网站访问量低。是否有一些配置文件我可能搞砸了?.BTW memory_limit根据PHP文档是-1无限制, 或者我该怎么做才能找到问题的根源,我正在考虑将服务器文件迁移到AWS Beanstalk实例(一个部署助手加上扩展助手,AFAIK)新的开始。
到处都是我可能知道可能导致崩溃的脚本。我有太多脚本,而且在laravel PHP框架上运行,加上第三方脚本,这真的很难勾勒出哪一个是可疑的。
我将不胜感激一个解释错误log.ie的答案
脚本做到了这一点...
Apache似乎已经做到了...
然后Ubuntu这样做了...
这导致了...
从@arkascha的评论中借用,该崩溃是由于某些脚本占用大量内存且未进行优化而导致的。以下步骤将帮助其他面临类似问题的人。
| 归档时间: |
|
| 查看次数: |
5947 次 |
| 最近记录: |