BTW, one further thing you can experiment with as far as trying to bring down memory use, is if you have access to main Apache configuration file, try setting:
PythonOptimize On at global scope outside of any virtual host containers. This will have the same affect as having supplied '-O -O' option to command line Python. Do note though that this will result in doc strings being discarded, which is where potential for memory savings come from, but some Python modules rely on doc strings to be present to work. Thus, you yo will need to do sufficient testing to ensure you aren't using any Python modules which have a dependency on doc strings being present. Graham On Jun 3, 8:41 am, Graham Dumpleton <[EMAIL PROTECTED]> wrote: > On Jun 3, 5:40 am, chrominance <[EMAIL PROTECTED]> wrote: > > > Epilogue: it looks like the major culprit behind my skyrocketing > > memory usage was indeed my failure to properly restart all the apache > > processes; it looks like the parent process was still storing debug > > info from when I had DEBUG=True in my settings.py, so that setting it > > to False and soft restarting via apachectl had no effect. For the past > > couple of days memory has been sitting between 30-35MB, which is a > > hell of a lot better. > > The problem with that hypothesis is that mod_python in the Apache > parent process never actually imports any of your user code modules > for Django, that is only ever done in the child processes. Thus, there > is no way it could have remembered the setting in the first place. > This is why I couldn't understand why your Apache parent process was > so big, as it effectively doesn't do that much. > > One possibility for child processes being so big is that for some > reason Python was loading the .pyc file for the settings file and it > was produced from settings.py when DEBUG=True was set but for some > reason when it was set to DEBUG=False the .pyc file wasn't regenerated > and Python was still using it for some reason. > > Thus, as a precaution, it may be advisable to delete all .pyc files if > you have run the development Django server and then subsequently using > Apache on the same files. This would especially be required if you had > copied all the .py/.pyc files from another box and not preserved date/ > time stamps as the copy would have set the .py/.pyc files to be the > same and thus Python wouldn't realise the .py file was actually newer. > Do note that although Python running as used by mod_python will > use .pyc files, it will not replace them if Apache runs as a user > different to the owner of the directories/files. > > Graham --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---