python - 为什么导入 uuid 会导致 uwsgi 守护进程挂起?
问题描述
我可以使用 uwsgi 执行以下 WSGI 程序(当 uwsgi 作为 systemd 运行时)。
def application(env, start_response):
start_response('200 OK', [('Content-Type','text/html')])
return [b"Hello world"]
但是,如果我尝试导入 uuid 模块,程序将挂起并最终超时。但是直接用 uwsgi 运行程序就可以了:
uwsgi --socket 0.0.0.0:8000 --protocol=http -w myapp
为什么 uuid 会导致 uwsgi 挂起?
解决方案
在我的 INI 文件中,设置 threads = 2 是导致导入 uuid 挂起的原因。
推荐阅读
- reactjs - 从另一个组件初始化一个组件的状态并获取状态值
- swift - Swift 常量哪一个更好?
- python - 处理权限和身份验证时出现 DRF 错误
- javascript - 在 react-bootstrap-table2 中添加带有图标的编辑按钮
- android - Nativescript API 级别
- java - 如何将 Lombok 插件添加到 Eclipse
- javascript - 无法使用语义-ui-react 减少 reactjs 中标签的字体大小
- typescript - 打字稿:按值排序对象
- elasticsearch - Elasticsearch - 如何在json文档中搜索具有特殊字符(-)的精确字符串匹配
- android - android API eval 26 中未收到通知