Re: Shared Dirty memory of Apache parent process
André Warnier <[email protected]>
| Newsgroups | gmane.comp.apache.mod-perl |
|---|---|
| Message-ID | <[email protected]> |
Hi. This is a bit beside your question below (for which I do not know the answer anyway). But if it is the case - that you have a number of Apache child processes which all need at start a certain initial table of data of 100-200 MB in size - that each of these children is going to modify that table over time (his own copy of it) - and that the number of child processes of Apache varies over time (which it does not necessarily have to do, but that is what you seem to be saying) Then, if you imagine having at some point 50 child processes, you are going to need something like 50 x 200 MB = 10 GB of memory. That's a lot of memory. And presumably, the biggest part of that is in fact the same, for all the children. So, should you not consider having a separate process which holds a single common table, shared with all the Apache children, and which they all consult and/or modify, over (for example) a TCP connection with that separate process ? Something like "memcached" for instance ? You would save yourself (roughly) 10 GB - 200 MB = 9.8 GB of memory. Even considering the low cost of memory today, you would still save yourself having to *write* 200 MB of memory 49 times (at least), which takes a considerable amount of time. Nageswara rao Gurram wrote: > 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. > > > > On Tue, Sep 16, 2014 at 10:10 PM, Perrin Harkins <[email protected]> wrote: > >> Hi, >> >> Loading data in the parent process is a common strategy for data that you >> won't modify. Do you need to change this data from the child processes? If >> so, does it matter if the other child processes see the changes? >> >> - Perrin >> >> On Tue, Sep 16, 2014 at 10:28 AM, Nageswara rao Gurram < >> [email protected]> wrote: >> >>> Hi, >>> I am new to mod perl environment so this may looks naive. >>> Recenlty I observed my apache processes are getting huge.. When I tried >>> to dig this down I found apache parent process (rss memory , mainly shared >>> dirty) itself is increasing with number of requests it is serving, so when >>> everytime it is creating a new child it is sharing all its memory with >>> childs and they are getting even more bigger and so on.. >>> I am thinking this might be one reason. I decalred a global variable in >>> apache startup (so it'll be shared on across all childs), this variable >>> will be loaded with huge DB data in one of perl modules(after request >>> comes). Will this increase shared dirty of parent ? (After child writes >>> into it, it will no longer shared between parent and child., and parent >>> shared dirty should get decreased .. right ?) >>> At start parent is only 100MB and after some days it's going above 250MB >>> and so childs are going above 400M.. >>> Can anybody help ? >>> >>> Thanks, >>> Rao. >>> >> >