[Catalyst] server memory usage
Jorge Gonzalez
jorge.gonzalez at daikon.es
Tue Apr 12 12:51:04 GMT 2011
El 12/04/11 12:58, John M. Dlugosz escribió:
> On 4/11/2011 8:54 AM, Jorge Gonzalez jorge.gonzalez-at-daikon.es
> |Catalyst/Allow to home| wrote:
>> You can be assured that it's being done that way. Certainly all
>> modern operating systems do Copy-On-Write on memory pages, which
>> means that several processes with a common set of code will share
>> much of it. This is not being done by Apache/fastcgi/Catalyst, but
>> by the very operating system itself.
>>
> I don't think so. If two different Perl processes are started up, and
> each loads modules and loads data, they will be writing all that to
> separate pages.
>
> Rather, it needs to load all the stuff and _then_ fork, so that the
> stuff is identical and shared.
>
You are right in this case: the pages would be shared just after the
fork, but would probably start to get copied individually for each
process again as soon as the process starts doing something useful. For
perl, which works as some kind of JIT compiler, the script executable
code is just data and probably gets rewritten very often, so each
process would end with its own set of pages.
I'd bet for a KSM capable machine and OS. You can activate and
deactivate it, so benchmarking it with your app would be trivial.
Regards
J.
More information about the Catalyst
mailing list