Django/mod_wsgi:第一页加载非常慢
我正在尝试通过 mod_wsgi 部署我的第一个 django 站点(在也提供 PHP 页面服务的 VPS 上)。一旦加载了第一个 django 页面,网站就会运行得很快,但是加载第一个页面是非常痛苦的 - 至少 15 秒,有时 30 秒以上。
在第一页加载期间,内存 (384MB) 已达到最大其他任务也慢得像爬行一样。我对 django 很陌生,所以不太确定如何解决这个问题。不幸的是,通过它自己的服务器(而不是也提供 PHP 服务的服务器)运行 django 并不是真正可行的。
任何建议表示赞赏。
I'm trying to deploy my first django site through mod_wsgi (on a VPS that also serves PHP pages). Once the first django page is loaded the site runs pretty quick, but loading up that first page is excruciating - at least 15 seconds, sometimes 30 seconds+.
During the first page loadup memory (384MB) is maxed out & other tasks also slow to a crawl. I'm pretty new to django so not quite sure how to solve this. Unfortunately running django through it's own server (as opposed to one that also serves PHP) isn't really feasible.
Any suggestions appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
正如 #django 上的回答,可能是因为使用的是嵌入式模式而不是守护进程模式。这种危险的描述见:
http: //blog.dscpl.com.au/2009/03/load-spikes-and-excessive-memory-usage.html
As answered on #django, likely because embedded mode being used and not daemon mode. Dangers of this described at:
http://blog.dscpl.com.au/2009/03/load-spikes-and-excessive-memory-usage.html