我有一个httpd服务器处理来自大约1k活跃用户的请求,我将PHP内存限制设置为128MB。
由于我的用户活动急剧增加,我的日志中出现以下错误
*`/ usr / sbin / httpd'出错:malloc():内存损坏(快):0x000055aae4918a9f *
Backtrace:
/lib64/libc.so.6(+0x7f5e4)[0x7fc15c81c5e4]
/lib64/libc.so.6(+0x82d00)[0x7fc15c81fd00]
/lib64/libc.so.6(__libc_malloc+0x4c)[0x7fc15c82284c]
/lib64/libcrypto.so.10(CRYPTO_realloc_clean+0x58)[0x7fc1574334d8]
/lib64/libcrypto.so.10(BUF_MEM_grow_clean+0x70)[0x7fc1574dcc50]
/lib64/libcrypto.so.10(+0x1193ad)[0x7fc1574de3ad]
/lib64/libcrypto.so.10(BIO_write+0x6b)[0x7fc1574dd3cb]
/lib64/libcrypto.so.10(+0x1419c2)[0x7fc1575069c2]
/lib64/libcrypto.so.10(+0x141a8e)[0x7fc157506a8e]
/lib64/libcrypto.so.10(+0x141e04)[0x7fc157506e04]
/lib64/libcrypto.so.10(+0x141f8b)[0x7fc157506f8b]
/etc/httpd/modules/mod_ssl.so(+0x259b3)[0x7fc14f9559b3]
/etc/httpd/modules/mod_ssl.so(+0x20a42)[0x7fc14f950a42]
/etc/httpd/modules/mod_ssl.so(+0x22701)[0x7fc14f952701]
/etc/httpd/modules/mod_ssl.so(+0x1c624)[0x7fc14f94c624]
/usr/sbin/httpd(ap_run_fixups+0x40)[0x55aae3edbd70]
/usr/sbin/httpd(ap_process_request_internal+0x2da)[0x55aae3ede6fa]
/usr/sbin/httpd(ap_internal_redirect+0x40)[0x55aae3efb9c0]
/etc/httpd/modules/mod_rewrite.so(+0x4f6c)[0x7fc1549b6f6c]
/usr/sbin/httpd(ap_run_handler+0x40)[0x55aae3ee5a80]
/usr/sbin/httpd(ap_invoke_handler+0x69)[0x55aae3ee5fc9]
/usr/sbin/httpd(ap_process_async_request+0x1ea)[0x55aae3efc6aa]
/usr/sbin/httpd(+0x59a49)[0x55aae3ef8a49]
/usr/sbin/httpd(ap_run_process_connection+0x40)[0x55aae3eefa30]
/etc/httpd/modules/mod_mpm_event.so(+0x685a)[0x7fc151df485a]
/etc/httpd/modules/mod_mpm_event.so(+0x7f44)[0x7fc151df5f44]
/lib64/libpthread.so.0(+0x7de5)[0x7fc15cd75de5]
/lib64/libc.so.6(clone+0x6d)[0x7fc15c89bbad]
我不确定它是否是导致内存泄漏的脚本,或者我是否应该从我的php脚本增加内存限制。如何找到导致apache进程崩溃的脚本?
无论如何,我可以找到这个问题的根源,而无需单独测试每个PHP脚本吗?
答案 0 :(得分:1)
请参阅此php扩展 Memory Profiler https://github.com/arnaud-lb/php-memory-profiler 您可以轻松地转储不同格式的信息