PHP-FPM-failed to ptrace(PEEKDATA) pid 123: Input/output error
If you're running PHP-FPM you can see these kind of errors in your PHP-FPM logs.
$ tail -f php-fpm.log
[-Dec- ::] NOTICE: child stopped for tracing
[-Dec- ::] NOTICE: about to trace
[-Dec- ::] ERROR: failed to ptrace(PEEKDATA) pid : Input/output error ()
[-Dec- ::] NOTICE: finished trace of
So, what do they mean?
They are the result of a configuration directive and a flaw in the way PHP-FPM handles requests.
Slowlog stacktraces
If your PHP-FPM configuration contains the request-slowlog-timeout parameter, the PHP-FPM master process will attempt to get a stacktrace of the running process when it exceeds that timeout.
It's a great way to identify 'slow' processes and peek inside the request, to see what happened at that time. It mostly works, too.
On busy servers however, you can see the logs start to fill like this.
[29-Dec-2015 23:03:10] ERROR: failed to ptrace(PEEKDATA) pid 11667: Input/output error (5)
[29-Dec-2015 23:04:10] ERROR: failed to ptrace(PEEKDATA) pid 11668: Input/output error (5)
[29-Dec-2015 23:05:12] ERROR: failed to ptrace(PEEKDATA) pid 11668: Input/output error (5)
...
Avoiding these errors in the logs
First, let me start by saying it's a cosmetic issue: PHP itself isn't having problems. It's not even affected by this. But it can't log the stacktrace that was requested, so it reports this error.
If this bothers you, you can disable it by commenting the following 2 parameters in your PHP-FPM logs:
;slowlog = /var/log/php-fpm/slow.log
;request_slowlog_timeout = 5s
(you comment them by adding a semicolon in front of the line and restarting your PHP-FPM daemon)
That will make the errors disappear. It also stops any kind of slowlogging from ever happening.
What's causing the PEEKDATA error?
I already mentioned it's a result of a flaw in how PHP handles requests. This is explained in more detail here . The gist of it is:
... the worker is free to go when the master is determining slow execution. When stopping to be traced, it may have completed that execution and is in any stage serving another request, so the tracer gets the chance of failure or worse, dumping out the stack of an irrelevant execution.
In other words: when PHP's slowlog tries to get an actual stacktrace, it may send a signal to the master process which in turn finds the child process that is slow (which it fork() 'd). However, by the time that happens, the child may have already finished its request and started serving another one.
Or it's not even handling a request at all, because it's finished and waiting for a new incoming request.
This leads to A) a stacktrace of the wrong process or B) the error you see above, a PEEKDATA error because there was no data to peek into.
So take that into account when reviewing PHP FPM slowlogs, too.
PHP-FPM-failed to ptrace(PEEKDATA) pid 123: Input/output error的更多相关文章
- PHP failed to ptrace(PEEKDATA) pid 13659: Input/output error错误解决方法
PHP failed to ptrace(PEEKDATA) pid 13659: Input/output error错误解决方法 现在改linux内核文件打开限制<pre>ulimit ...
- Spring Boot + Bootstrap 出现"Failed to decode downloaded font"和"OTS parsing error: Failed to convert WOFF 2.0 font to SFNT"
准确来讲,应该是maven项目使用Bootstrap时,出现 "Failed to decode downloaded font"和"OTS parsing error: ...
- Xamarin 示例Standard Controls报错:xamarin Failed to compile interface file. See Build Output for details
Standard Controls 示例下载地址: http://developer.xamarin.com/content/StandardControls/ Xamarin官网上的IOS示例“St ...
- caffe: test code Check failed: K_ == new_K (768 vs. 1024) Input size incompatible with inner product parameters.
I0327 20:24:22.966171 20521 net.cpp:849] Copying source layer drop7I0327 20:24:22.966179 20521 net.c ...
- 安装VMWare WorkStation 10 异常【 Failed to create the requested registry keyKey:Installer Error: 1021】
下载了新的workstation 10,在安装的时候出现了异常Failed to create the requested registry keyKey:Installer Error: 1021. ...
- Failed with exception MetaException(message:javax.jdo.JDODataStoreException: Error(s) were found while auto-creating/validating the datastore for classes.
hive (db_emp)> load data local inpath '/opt/datas/emp.txt' into table emp_part partition(`date`=' ...
- xamarin调试android部署到模拟器错误记录:Deployment failed Mono.AndroidTools.InstallFailedException: Unexpected install output: Error: Could not access the Package Manager. Is the system running?
问题记录: 1.生成 ok. 2.昨天也是能部署到模拟器的. 但是今天部署的时候就报了这样的一个错误 Deployment failed Mono.AndroidTools.InstallFailed ...
- 浏览器警告Failed to decode downloaded font和OTS parsing error: Failed to convert *** font to ***
昨晚,在做一个自己感兴趣的东西时,发现浏览器报警告,Failed to decode downloaded font以及OTS parsing error: Failed to convert *** ...
- getting session bus failed: //bin/dbus-launch terminated abnormally with the following error: Autolaunch error: X11 initialization failed.
今天在调试dbus程序的时候,运行程序出现了getting session bus failed: //bin/dbus-launch terminated abnormally with the f ...
随机推荐
- Canopy使用教程 (2)
1.下载https://reputation.alienvault.com/reputation.data alienvault公司的IP信誉数据库文件到本地,手动或者wget 2.使用 read_c ...
- 文件操作II
<html> <head> <meta charset="utf-8"> </head> <body> <?php ...
- 如何解决火狐FF里Input标签刷新页面后 仍然保存之前输入的内容的方法。
直接在input 标签里 增加 autocomplete="off".火狐默认为 on.
- iOS:测试机添加
一,首先打开开发者首页:https://developer.apple.com/,点击Member Center二,点击certificates,Identifiers & Profiles三 ...
- iOS开发:icon和启动图尺寸
歪果仁的总结: Asset iPhone 6s Plus and iPhone 6 Plus (@3x) iPhone 6s, iPhone 6, and iPhone 5 (@2x) iPhone ...
- 转载:CancellationToken
http://www.cnblogs.com/Abbey/archive/2011/09/12/2174208.html 最近在学习.NET中的线程同步.其中一个重要的技术叫线程的取消(中止),涉及的 ...
- 基于 Qt的聊天工具
主要参考:http://blog.csdn.net/zouxy09/article/details/9140881
- 浅谈github页面域名绑定
来源:http://yanping.me/cn/blog/2011/12/04/github-pages-domain/ 前段时间看到COS上的各位都有博客,也想开个博,给COS的各位管理员发邮件,向 ...
- 一张图让你学会LVM
导读 随着科技的进步,人们不知不觉的就进入了大数据的时代,数据的不断增加我们发现我们的磁盘越来越不够用了,接下来就是令人头疼的事情--加硬盘,数据的备份与还原.LVM就是Linux下专门针对我们数据的 ...
- Sql优化(二) 快速计算Distinct Count
原创文章,始发自本人个人博客站点,转载请务必注明出自http://www.jasongj.com 个人博客上本文链接http://www.jasongj.com/2015/03/15/count_di ...