"Andree Toonk" <atoonk.RemoveThis@science.uva.nl> wrote in message
news:400bea1e$0$320$e4fe514c@news.xs4all.nl...
> Hello,
>
> I've got a question regarding memory usage with a multi-threading
webserver
> or a pre-forking webserver.
> when there's a webserver with a few hundred virtualhosts and the
httpd.conf
> is, let's say 10MB.
>
> When I use apache (1.3.xx) with pre-forking each proces would consume
> several MBs of memory, at least 10MB because of the config file.
> is this correct?
> Then the webserver should have a lot of memory in order to serve multiple
> clients.
>
> When I would use apache2 with the multi-threading technology, how would
this
> effect the memory usage?
> would this consume the same amount of memory per proces ( a proces exists
of
> several treads)?
>
> Hope someone can explain this to me
> thanks for your advise,
>
> Andree
>
>
Andree,
When apache loads itself into memory it reads the entire conf fie in one
pass and begins to construct a server record tree.
Each virtual host then gets a branch on the tree and inherits the settings
of the server root record.
Any paramters that you then assign to a speciffic Virtual Host overide those
of the parent above it.
In apache, a server record is quite complex but it really isn't that big -
its just a whole load of pointers to various parts of the system and also a
bunch of ints for values like timeouts, port number, etc etc. - its
certainly no bigger than a few KBytes. So even though your conf file may be
10Meg the space in memory required to store this information is minimal.
Each virtual host spawns a heap of child process to acutally handle requests
for pages ect, but each child shares the same server config record.
When you additional bits into the conf file for things like Directory rules
Apache has some extremely fast methods for merging them in on the fly on a
per request basis (this is calledthe request record) so you will see memory
increases as requests are processed but this memory is automatically
released at theend of each request.
Hope this helps
Bex
Ex
..<!-- ~MESSAGE_AFTER~ -->
>> Stay informed about: memory usage with treads vs pref-fork