Django:来自运行服务器的内存错误
我正在开发一个网站,该网站在其现有的 wsgi 服务器上运行良好,并且在本地开发中的 runserver 上运行良好。但现在我们正准备将其转移到新服务器,但无法使其正常工作,尽管服务器和设置几乎相同。
在调试过程中,我尝试在新服务器上启动 runserver (当然只是为了测试目的)并收到如下错误:
TypeError: must be (memory error), not str
或者
File "/usr/local/lib/python2.7/SocketServer.py", line 225, in serve_forever
r, w, e = select.select([self], [], [], poll_interval)
MemoryError
显然这与新服务器环境中的某种内存限制有关,但我不知道从这里去哪里。我怀疑如果我能解决这个问题,wsgi 进程将开始正常运行。
建议?谢谢。
I'm working on a site that works fine on its existing wsgi server, and fine with runserver in local dev. But now we're preparing to transfer it to a new server and are having trouble getting it to work, even though both servers and setups are close to identical.
In the process of debugging, I tried to fire up runserver on the new server (just for testing purposes of course) and get errors like:
TypeError: must be (memory error), not str
or
File "/usr/local/lib/python2.7/SocketServer.py", line 225, in serve_forever
r, w, e = select.select([self], [], [], poll_interval)
MemoryError
Clearly this is related to some kind of memory constraints in the new server environment, but I'm not sure where to go from here. I suspect that if I can clear this up, the wsgi process will start running properly.
Suggestions? Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是在 cPanel/WHM 服务器上(我们控制 WHM,即我们有 root)。答案是 WHM 选项“Shell fork 炸弹保护”,它可以防止用户运行 WHM 认为长时间运行的脚本或可能消耗过多资源的脚本。禁用该选项恢复了我们使用 runserver 的能力。
This is on a cPanel/WHM server (and we control WHM, i.e. we have root). The answer turned out to be the WHM option "Shell fork bomb protection," which prevents users from running what WHM perceives to be long-running scripts, or scripts that might consume too many resources. Disabling that option restored our ability to use runserver.