Make sure you are not keeping global references to data. That prevents the python garbage collector from releasing the memory.
Don’t use mod_python
. It loads an interpreter inside apache. If you need to use apache, use mod_wsgi
instead. It is not tricky to switch. It is very easy. mod_wsgi
is way easier to configure for django than brain-dead mod_python
.
If you can remove apache from your requirements, that would be even better to your memory. spawning
seems to be the new fast scalable way to run python web applications.
EDIT: I don’t see how switching to mod_wsgi could be “tricky“. It should be a very easy task. Please elaborate on the problem you are having with the switch.