python - Reducing Django Memory Usage. Low hanging fruit? -


My memory usage increases over time and DJO users do not like to resume.

How am I unsure about the usage of memory usage, but helpful tips will be useful on how to start measuring.

I have noticed that there are some simple steps that can make big profits. To make sure 'debug' is set to 'false' is a clear big deal.

Can someone give other suggestions? How much improvement will the caching on low traffic sites?

In this case I am running with mod_python under Apache 2.x. I have heard that mod_wsgi is a bit slow, but at this level it will be difficult to switch unless I know that the gain will be important.

EDIT: Thanks for the tips yet. How does a suggestion show that what is the use of memory? Are there guides for Python Memory Profiling?

There are a few things that can be difficult to switch to mod_wsgi, so I should get some information of the benefit before moving forward in that direction

Edit: Karl posted a slightly more detailed answer which is readable:

Edit: The best I'm on MPM and mod_wsgi related stuff I've found that rather than debugging memory usage in any app itself Do not provide information though

Last Editing: OK, I am discussing with webfiction to see if they help to reconstruct Apache And his word on this matter is:

"I do not really think that you will get more benefit by switching to an MPMaker + mod_wsgi setup. My guess is that you can save approximately 20 MB , But probably nothing more than that . "

then! It brings me back to my original question (which I am still not intelligent). How is a problem where the identity of the known is known? It's a good thing that you do not optimize without testing that you need to optimize, but Python is very little in the way of tutorials to measure memory usage and is not specific to any of the demos.

Thanks for everyone's help, but I think this question is still open!

Another final edit; -)

I asked it on the Django-user list and found something

Honestly the last update right now!

It's still going on. So far the best solution can be:

Ensure that you are not keeping the global context of data . This dragon prevents garbage collectors from releasing memory. Do not use

mod_python . It loads an interpreter inside Apache If you need to use Apache, use it instead it is not difficult to switch. It is very easy. Easier way than mod_wsgi brain-dead mod_python .

If you can remove Apache with your needs, it will be better than your memory. It seems a new fast scalable way to run python web applications.

Edit : I do not think how switching to mod_wsgi can be " difficult ". This should be a very easy task. Please expand on the problem related to the switch.


Comments