【问题标题】:Why would importing uuid cause uwsgi daemon to hang?为什么导入 uuid 会导致 uwsgi 守护进程挂起?
【发布时间】:2019-01-13 22:30:47
【问题描述】:

我能够使用 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 挂起?

【问题讨论】:

    标签: python uwsgi wsgi


    【解决方案1】:

    在我的 INI 文件中,设置 threads = 2 是导致导入 uuid 挂起的原因。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-06-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-04-25
      • 1970-01-01
      • 2013-03-04
      • 1970-01-01
      相关资源
      最近更新 更多