> From: Nageswara rao Gurram [mailto:nageshgurra...@gmail.com] > Sent: Tuesday, September 16, 2014 10:51 AM > > Hi, > > I am modifying(infact intializing) the global variable > declared in start up with child processes..When every child > process tries to modify it I think it should come as > private memory of child.. But I am wondering why shared > dirty memory of parent process is increasing every time > child tries to modify it.. This is making next child of > parent is getting created with much more shared memory ? > Should I leave it or worry about it ? As even if RSS of > all(combined) apache processes are increasing if I consider > shared dirty in it, it will definitely looks smaller.
You might want to consider another approach if your prefork children are all updating the data... why update it separately? For example, you could use a tied DBM/MLDBM hash, DBD::SQLite or another file-based database with access locking for your cache, and save it in a shared memory filesystem like /dev/shm. It might ultimately be more efficient since the work that other apache processes did will then be immediately available for all, and you will only use the amount of memory once for all processes. Using package vars to cache data is nice for small amounts that don't change in size. If you go too far down that road you run into the problem you described... it's no longer manageable. HTH. Mark Hedges