process - Gunicorn:检查正在运行的进程的命令行参数。(高山 Linux)
问题描述
我有一个奇怪的情况。使用任务定义中的命令在 AWS ECS (EC2) 上运行 gunicorn
"command": [
"/usr/local/bin/gunicorn",
"--bind",
"0.0.0.0:8000",
"--timeout",
"60",
"admin.wsgi"
],
timeout 参数是最近添加的,我想检查 gunicorn 是否正确应用了它。
现在,如果我这样做
$ gunicorn --print-config admin.wsgi | grep timeout
graceful_timeout = 30
timeout = 30
它似乎没有被应用,好吧,gunicorn docs(https://docs.gunicorn.org/en/stable/configure.html)不是很清楚,所以可能--print-config
只是打印来自外部配置文件的东西和环境变量。
所以现在我正在尝试从 Alpine linux 访问 cmdline 参数:
~ $ cat /proc/1/cmdline ; echo
gunicorn: master [admin.wsgi]
~ $ cat /proc/7/cmdline ; echo
gunicorn: worker [admin.wsgi]
但这也不是很有帮助:(
最后一枪,gunicorn 启动日志:
2021-10-08 13:41:25[2021-10-08 20:41:25 +0000] [1] [INFO] Starting gunicorn 20.1.0
2021-10-08 13:41:25[2021-10-08 20:41:25 +0000] [1] [INFO] Listening at: http://0.0.0.0:8000 (1)
2021-10-08 13:41:25[2021-10-08 20:41:25 +0000] [1] [INFO] Using worker: sync
2021-10-08 13:41:25[2021-10-08 20:41:25 +0000] [7] [INFO] Booting worker with pid: 7
更多的悲伤。
有什么方法可以查看 gunicorn 进程的当前超时时间(除了篡改代码并让工作人员睡眠 30 多秒以查看它是否是 SIGABRT)?
解决方案
推荐阅读
- r - 如何在我自己的包中使用 data.table::setDTthreads()?
- algorithm - K 个桶中 N 个对象的所有可能组合
- excel - 为什么我的 excel 宏不调用外部程序
- c++ - 模拟鼠标悬停在任何 Windows 应用程序的任何 UI 元素上
- google-sheets - 如何在 x 由单元格值确定的列中打印 1 到 x?
- sql-server - 如何从冒号分隔的平面文件中提取 varchar 中的日期时间?
- python - 默认相关名称模式的 Django 设置
- flutter - 即使不应该显示 Flutter SingleChildScrollView 容器也会显示?
- python-3.x - 在 Python3 中如何关闭使用 asynckivy 开始的任务
- android - 在 Room android 的列上使用忽略