Question
mod_python(?) is eating a lot of ram (about 9mb per worker process). If i open several TRAC pages at once many of them will have an error due to no ram (64mb virtual limit). if i limit the worker threads to 3 i can get by alright. Problem is if no one is accessing TRAC i have A LOT of ram being unused.
Is there a way i can either
- Limit the amount of worker process that can use python?
- Limit the amount of worker process in my trac path?
- Have apache spawn as many worker process or threads it wants but have it only spawn when X amount or ram is free (or when X amount or below is in use by apache)
- Something else ?
Solution
You could configure a second mod_python
apache with minimal worker threads to run only on the local interface and with a different port, i.e. http://127.0.0.1:9000/. Then for your public apache instance on port 80, disable mod_python and tune for optimal ram utilization. Proxy all trac and other python app requests to the local mod_python
instance.
If the public facing apache is left only to serve static content, then consider replacing it with something lightweight such as nginx or lighttpd.