【发布时间】:2021-08-26 08:54:45
【问题描述】:
我们有一些 php-fpm 进程在 ECS FARGATE 任务上卡在我们的生产系统中。 我尝试使用“strace -p 50”调试这些服务,其中 50 是我的 php-fpm 子工作进程的 PID,我在 root 用户下运行它,但是收到此错误:
Could not attach to process. If your uid matches the uid of the target
process, check the setting of /proc/sys/kernel/yama/ptrace_scope, or try
again as the root user. For more details, see /etc/sysctl.d/10-ptrace.conf
我已经修改了 /etc/sysctl.d/10-ptrace.conf 中的设置并保存了文件,但是我仍然遇到同样的错误。
另外我想提一下这个问题最有可能与 Docker 相关,因为我们在作为 Docker 容器运行的本地环境中运行 strace 时也遇到了同样的问题。我看到一些以前的 SO 帖子提到在“docker run”命令中添加一些参数来修复它,但不确定是否可以在 ECS 任务中执行。
【问题讨论】:
标签: php amazon-ecs strace fpm