Welcome to MobyThreads.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in
All support for the MobyThreads Threaded phpBB MOD can now be found on welsolutions at this forum

memory usage with treads vs pref-fork

 
   Web Hosting and Web Master Forums (Home) -> Apache RSS
Next:  apache book  
Author Message
atoonk

External


Since: Jan 19, 2004
Posts: 3



(Msg. 1) Posted: Mon Jan 19, 2004 6:30 pm
Post subject: memory usage with treads vs pref-fork
Archived from groups: alt>apache>configuration (more info?)

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

 >> Stay informed about: memory usage with treads vs pref-fork 
Back to top
Login to vote
x33159

External


Since: Jan 13, 2004
Posts: 23



(Msg. 2) Posted: Tue Jan 20, 2004 4:41 pm
Post subject: Re: memory usage with treads vs pref-fork [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Andree Toonk wrote:
 > 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.
 >

10 MEGABYTE ????? What on earth have you all got in there ? At 80 chars per
line that is 131072 lines! If that is really the case, I would suggest an
alternative setup, with more distributed rulesets for each vhost. I just
read some on that in The Apache Server 2 Bible.

I did not know btw httpd.conf is loaded in separate memory space for all
separate processes, and I can't think of a reason why, since it is one set
of rules for all processes. If it is like you say, I'd be inclined to say
that's a serious waste of ram by apache. But I am no expert on this...

Have you tried testing it in two directions and use top/ps to get an idea ?
(I assume you use a *nix)

jan<!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: memory usage with treads vs pref-fork 
Back to top
Login to vote
atoonk

External


Since: Jan 19, 2004
Posts: 3



(Msg. 3) Posted: Tue Jan 20, 2004 10:21 pm
Post subject: Re: memory usage with threads vs pre-fork [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hi Jan,

"Jan Soldaat" <x33159 RemoveThis @westerterp.com> wrote in message
news:400d21fd$0$325$e4fe514c@news.xs4all.nl...
 > Andree Toonk wrote:
  > > 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.
  > >
 >
 > 10 MEGABYTE ????? What on earth have you all got in there ? At 80 chars
per
 > line that is 131072 lines! If that is really the case, I would suggest an
 > alternative setup, with more distributed rulesets for each vhost. I just
 > read some on that in The Apache Server 2 Bible.

Yep, thatīs my set up. works fine except for the memory usage.
Iīm aware this is not the recommended setup....

 > I did not know btw httpd.conf is loaded in separate memory space for all
 > separate processes, and I can't think of a reason why, since it is one set
 > of rules for all processes. If it is like you say, I'd be inclined to say
 > that's a serious waste of ram by apache. But I am no expert on this...
 >
 > Have you tried testing it in two directions and use top/ps to get an idea
?
 > (I assume you use a *nix)

Nop I didnīt try this (no time Sad )
I was hoping someone could tell me something about this.

-Andree<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: memory usage with treads vs pref-fork 
Back to top
Login to vote
user2649

External


Since: Jan 21, 2004
Posts: 3



(Msg. 4) Posted: Wed Jan 21, 2004 4:41 am
Post subject: Re: memory usage with treads vs pref-fork [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"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 
Back to top
Login to vote
atoonk

External


Since: Jan 19, 2004
Posts: 3



(Msg. 5) Posted: Wed Jan 21, 2004 12:30 pm
Post subject: Re: memory usage with treads vs pref-fork [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hi

"e" <e.RemoveThis@e.e> wrote in message
news:400dd8b6$0$4910$afc38c87@news.easynet.co.uk...
 >
 > 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.

I forgot to mention the webserver is also using the frontpage extensions...
Thatīs what causes the large amount of memory usages..

Andree<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: memory usage with treads vs pref-fork 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Tomcat CPU usage at 100% - Hi all, I am using tomcat 4.0 on HPUX 11.11, jdk1.4. I have a jsp application. The jsp application works fine. The application as such is not finished and so i am the only user. If i keep using the application then there is no problem. Looks like after a...

Apache 2 (crazy CPU usage) and not working - Need to fix this -i got the 2 process runing -1 of them seems ok -the other use 94% cpu -i'm not able to access my webpage through local host or by any other way -i'm assuming this can be fixed cause i had this prob in the past and fixed it...but neve...

Urgent: Memory Leak in 1.3.28 ? - Hi, it seems like I have a problem in compiling apache under debian 3.0. Although everything runs fine I'm having a memory leak, which might be related to compiling apache this way: apache: ../configure --prefix=/opt/apache_1.3.28 --enable-module=expire...

Putting and retrieving data in memory - Hi all, I am currently using Apache and I am using a CGi program to generate my dynamic pages. My CGI is linked to a dll and I am trying to make it an Apache module. The reason is I am trying to keep it in memory, allocate a memory pool so I can....

Apache2 uses huge amount of memory - Hi I got a Apache2/Perl... binary package from http://perl.apache.org/dist/win32-bin/ for my win32 system. Once installed and started it uses about 50 MB of memory without any requests comming in. Is there any possibility to decrease the amount of..
   Web Hosting and Web Master Forums (Home) -> Apache All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]