Django:来自运行服务器的内存错误

发布于 2024-12-03 17:59:55 字数 506 浏览 3 评论 0原文

我正在开发一个网站,该网站在其现有的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

眼藏柔 2024-12-10 17:59:55

这是在 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文