我在 Fedora 14 上设置了一个运行 Cherokee 的开发服务器,使用 uWSGI 与我的 WSGI 应用程序交互。
当应用程序被第一个请求击中时,我会生成一个如下进程:
from subprocess import Popen
Popen(['bash']) # bash is just an example; the problem happens with all programs
第一个请求需要 10-15 秒才能完成(后续请求不到一秒)。在没有创建 Popen 对象的情况下,第一个请求只需要大约 2-3 秒即可完成。当我从 Python shell 执行相同的 Popen 请求时,它是瞬时的。
什么可能导致这种行为?我错过了什么明显的东西吗?