You are viewing a plain text version of this content. The canonical link for it is here.
Posted to asp@perl.apache.org by youenn <yo...@citb.bull.net> on 2001/10/26 19:33:58 UTC

memory problems

    I'm developping a site which work with apache::asp. It is very nice 
to develop but I have memory problems. I have about 170 asp scripts and 
20 modules. Httpd memory process increase dramactly (30 M-40 M) and I 
can run a lot of httpd process (maxserver). I have tested to load all 
asp script at httpd start but I have always memory lake.
Have you any solution to flush the memory properly ( Now I have a script 
that restart apache when  computer swap) and how you manage her?

Thanks a lot ,Youenn

(excuse me for my english , I'm french )




---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org


Re: memory problems

Posted by Joshua Chamas <jo...@chamas.com>.
youenn wrote:
> 
>     I'm developping a site which work with apache::asp. It is very nice
> to develop but I have memory problems. I have about 170 asp scripts and
> 20 modules. Httpd memory process increase dramactly (30 M-40 M) and I
> can run a lot of httpd process (maxserver). I have tested to load all
> asp script at httpd start but I have always memory lake.
> Have you any solution to flush the memory properly ( Now I have a script
> that restart apache when  computer swap) and how you manage her?

Take all the advice at http://www.apache-asp.org/tuning.html

To avoid swapping, set MaxClients lower ( depends on your system typical 20-100), 
and MaxRequestsPerChild lower ( < 200 I'd recommend, maybe even 100 ).
If MaxClients is too low, try the lingerd server announced on the 
mod_perl list, or go with a dual server setup, like mentioned
at http://perl.apache.org/guide/ ( I favor ProxyPass method personally ).

If you have linux, run your httpd under strace in httpd -X mode, 
to see what your httpd will do post fork ( on the first request ).
Whatever is loading at that time, make sure its loaded in the
parent httpd.  Typically, even for a big site, you can get it to
where each child httpd only takes 5M unshared RAM during its life
up to MaxRequests.

Benchmark your site with ab for a long period, like -c 20 -n 50000
and see if it breaks.  You don't want your system to get anywhere
near swap.  Always have some free RAM. 

If you have any big perl objects you create during the request, make sure 
to explicitly call an $Object->DESTROY(), and define DESTROY to do the 
right thing. You can call this in a 
  $Server->RegisterCleanup( sub { $Object->DESTROY } ) 
You need to do this in case there are extra pointers to your objects,
in which case perl will not DESTOY them.

If you are doing database connections, use Apache::DBI.

If you are precompiling scripts, make sure they are really precompiling
with Debug -3 turned on while testing.  Make sure the scripts aren't
getting reparsed post fork, then something is set wrong.

If you are not precompiling all your scripts, its OK, try the NoCache
setting for lots of scripts that don't get called all the time. If you 
have a core set of includes, make sure to use DynamicIncludes setting.

And if all else fails, hire someone good ( like me :) to make
things better.  

--Josh

_________________________________________________________________
Joshua Chamas                           Chamas Enterprises Inc.
NodeWorks Founder                       Huntington Beach, CA  USA 
http://www.nodeworks.com                1-714-625-4051

---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org


Re: New To Apache ASP

Posted by Joshua Chamas <jo...@chamas.com>.
Promotion 123 Administration wrote:
> 
> Dear Group,
> 
> I have just got a web site where I can use apache ASP.  I am familiar with
> ASP with VBScript, but want to learn apache.  Are there any web sites that
> will help me learn apache????
> 

The big difference with Apache::ASP is its all perl scripting,
and no $Server->CreateObject COM objects ( on unix anyway ).  
So you have got to know perl!  And mod_perl is very important 
to know too, which gives you added abilities.  Check out:

  http://www.apache-asp.org/resources.html

And if you don't know CPAN, get to know it:

  http://www.cpan.org

Its the collected perl works of some 1700 authors.

--Josh
_________________________________________________________________
Joshua Chamas                           Chamas Enterprises Inc.
NodeWorks Founder                       Huntington Beach, CA  USA 
http://www.nodeworks.com                1-714-625-4051

---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org


New To Apache ASP

Posted by Promotion 123 Administration <ad...@promotion123.f2s.com>.
Dear Group,

I have just got a web site where I can use apache ASP.  I am familiar with
ASP with VBScript, but want to learn apache.  Are there any web sites that
will help me learn apache????


--David


---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org