如何找出 django 进程正在(或将要)占用多少应用程序内存?
在名为 webfaction 的 django 友好托管中,有不同的“应用程序内存”选项(如 80MB...200MB),我很困惑应该购买哪一个。
有人可以引导我了解如何计算出我的项目可能需要多少内存(不包括操作系统、主 apache 服务器和数据库服务器内存要求)吗?我知道理论上我需要执行某种负载测试,但我认为可能有一些方法可以通过一些简单/相对容易理解的方法来提前计算。
我不知道他们强制执行应用程序内存使用限制的力度有多大,另一个问题是:如果更多的用户访问该站点并且启动的线程比我预期的多,会发生什么?应用程序会崩溃吗?或者延误会让人感到不舒服吗?
而且 - 不,应用程序尚未准备好(我现在无法测量任何内容)。开发环境如果重要的话是Winodows 7,64位。我认为托管本身就是某种 Linux。
(抱歉,如果这不是 stackoverflow 问题。)
There are different "Application memory" options (like 80MB...200MB) in django-friendly hosting called webfaction and I'm confused deciding which one I should buy.
Could someone please walk me through the ideas on how to figure out how much memory my project might require (excluding operating system, the main apache server and the database servers memory requirements)? I understand in theory I'll need to perform some kind of load testing, but thought there might be ways to calculate that in advance with some simple/relatively easy understandable approach.
I don't know how hard they enforce application memory usage limit, and another question is: what will happen if more users came to the site and more threads started than what I expected? Will the application crash? Or will delays just become uncomfortable?
And - no, application is not ready yet (I can't measure anything right now). Development environment if it matters is Winodows 7, 64-bit. Hosting itself is some kind of Linux I think.
(Sorry if it's not a stackoverflow question.)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
抱歉,在应用程序完全开发之前,您无法透露它将使用的内存类型。我建议您采用他们的“最低”计划,并续订以满足您的需求,或者更好:在完成应用程序开发后获取托管。
另一方面,如果您已经准备好应用程序,您可以使用主机的配置和一些示例数据在 Apache 中运行它,以获得粗略的估计...
Sorry, but until you have the application completely developed, you can't say anything about the kind of memory it'll use. I recommend that you take their "lowest" plan, and renew to it to fit your needs, or still better: get hosting after you finish developing the application.
On the other hand, if you had the application ready, you could just run it in Apache with your host's config and some sample data to get a rough estimate...
我同意,在您的应用程序准备就绪之前,您可以透露很多信息。
作为一个模糊的估计,认为您的主机应该是“django 友好的”,因此一些“基本”应用程序应该可以毫无问题地运行。如果可能的话,稍后尝试升级。
还要考虑您的应用程序处理的数据类型,例如。有一次当我必须处理非常大的图像上传时遇到了麻烦,导致整个网站崩溃。
另请记住,如果您需要一些内存来执行其他进程,例如。内存缓存!
I agree that you can' tell much before your app is ready.
As a vague estimation consider that your host is supposed to be "django-friendly" so some "basic" application should run without problems. Try and upgrade later if that's possible easily.
Also consider the type of data that is processed with your app, I eg. ran into troubles once when I had to process really large image uploads that made the whole site crash.
Also keep in mind if you need some ram for additional processes eg. memcache!
Webfaction 确实是 Django 友好的主机,如果您的应用程序开始需要比您支付的内存更多的内存,它肯定不会崩溃。将会发生的情况是,您将被允许使用少量的额外内存,但如果您持续超出限制,他们会向您发送一封礼貌的电子邮件,要求您减少负载或支付更多费用。
Webfaction are indeed a Django-friendly host, and your application will certainly not crash if it starts needing more memory than you have paid for. What will happen is that you will be allowed to use small amounts of extra memory, but if you consistently go over the limit they will send you a polite email requesting that you either reduce the load or pay for more.