Re: Perl Run and Load Average
Hi all, Thank you for all your suggestions. Now the load average on my server is back to normal again :) It is around 0.2 - 0.5 now with the same pageviews. Ok not just normal, actually the load average is even lower than when I was using CGI (which was around 0.6 - 1.2). The changes I made: reduced MaxClients value from 300 to 150 in httpd.conf, preloaded CGI module by putting it inside startup.pl, unloaded some DSO modules that I didn't use. This article really helps me a lot: http://perl.apache.org/docs/1.0/guide/performance.html --bk
Re: Perl Run and Load Average
Batara Kesuma wrote: > I will try to move all standard modules to startup.pl. Do I need to delete > the standard modules from the scripts after I moved them to startup.pl? I > mean, after I moved: > use MyModule; > > to startup.pl, do I need to delete it from the scripts? Or Perl Run will > automatically figure out that it has already been loaded and simply ignore > the one in the scripts? > No, no, you shouldn't delete anything at all. Perl uses the %INC hash to track what was loaded already. Perhaps it'll benefit you to read a good perl book or at least this document: http://perl.apache.org/docs/general/perl_reference/perl_reference.html I have this setting on my httpd.conf: StartServers 8 MinSpareServers5 MaxSpareServers 20 ServerLimit 300 MaxClients 300 MaxRequestsPerChild 1000 Any idea on how can I tweak this setting? Please read: http://perl.apache.org/docs/1.0/guide/performance.html in particular http://perl.apache.org/docs/1.0/guide/performance.html#Performance_Tuning_by_Tweaking_Apache_Configuration Since you are running prefork mpm, most of these mod_perl 1 notes apply to your mod_perl 2 setup. I would also run "top -d 1" while your webserver is running without mod_perl to see what scripts are causing the load. Do you have a database running on the same system? Do you know if it might be doing more work? The database server is on another machine, but I think I should try to preload DBI module, and see the result. I just noticed that the load was going down after I restarted httpd. Is this because of my scripts have bugs? I think I have some DBI connect without disconnect in my scripts. I will try to fix this and see how is the result. You can always monitor this using the database tools. Also consider using Apache::DBI. it's all the document I've mentioned above. __ Stas BekmanJAm_pH --> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: Perl Run and Load Average
On Thu, 2003-06-05 at 09:31, Batara Kesuma wrote: > I just noticed that the load was going down after I restarted httpd. Is > this because of my scripts have bugs? I think I have some DBI connect > without disconnect in my scripts. I will try to fix this and see how is > the result. Are your scripts using up all the available memory and sending you into swap? That will shoot the load up quickly, and go away when you restart. As Stas mentioned, you should try to run Registry instead of PerlRun if you can. - Perrin
Re: Perl Run and Load Average
Hi Dale, > Assuming your CGI scripts aren't doing strange things, liking hanging > around after the session has closed and doing clean-up work, you might > check your httpd.conf settings on the number of threads and requests per > threads. Its possible that your httpd threads are short-lived and > restarting more often which now requires a lot more work to start since > Perl is being loaded each time - just an idea. > > MaxRequestsPerChild 1000# if this were too low, say 10 or 50, > you would probably create more load > > # If these were out of wack somehow, it could possibly create some > # unusual > load conditions > MaxSpareServers 20 > MinSpareServers 5 I have this setting on my httpd.conf: StartServers 8 MinSpareServers5 MaxSpareServers 20 ServerLimit 300 MaxClients 300 MaxRequestsPerChild 1000 Any idea on how can I tweak this setting? > I would also run "top -d 1" while your webserver is running without > mod_perl to see what scripts are causing the load. Do you have a > database running on the same system? Do you know if it might be doing > more work? The database server is on another machine, but I think I should try to preload DBI module, and see the result. I just noticed that the load was going down after I restarted httpd. Is this because of my scripts have bugs? I think I have some DBI connect without disconnect in my scripts. I will try to fix this and see how is the result.
Re: Perl Run and Load Average
Assuming your CGI scripts aren't doing strange things, liking hanging around after the session has closed and doing clean-up work, you might check your httpd.conf settings on the number of threads and requests per threads. Its possible that your httpd threads are short-lived and restarting more often which now requires a lot more work to start since Perl is being loaded each time - just an idea. MaxRequestsPerChild 1000# if this were too low, say 10 or 50, you would probably create more load # If these were out of wack somehow, it could possibly create some unusual load conditions MaxSpareServers 20 MinSpareServers 5 I would also run "top -d 1" while your webserver is running without mod_perl to see what scripts are causing the load. Do you have a database running on the same system? Do you know if it might be doing more work? Stas already mentioned the pre-loading of modules which will help, but not much if you have a misconfigured httpd.conf as mentioned above. dale - Original Message - From: "Batara Kesuma" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, June 05, 2003 5:23 AM Subject: Perl Run and Load Average > Hi, > > I have changed all my CGI scripts to run under Perl Run, and now I notice > that the load average of my server (it is a dual CPUs) is very high. It > stays around 2.5 all the time. Before, when I was running plain CGI, it > was around 0.6 - 1.2. I checked the log file and I found that I only have > around 10% more pageviews this week, so the load average shouldn't be that > high. Is this normal? Any advice or comment? Thank you. > > --bk
Re: Perl Run and Load Average
Hi Stas, > Based on your previous questions, my guess is that you are using > mod_perl 1.99_09. Please be more verbose about your setup when asking > questions. Sorry, here is my setup. mod_perl-1.99_09 httpd-2.0.40 > Do you preload the modules that you use at the server startup? Your > PerlRun scripts should be the only ones that get recompiled. Try moving > all the standard modules to startup.pl and see if it gets any better. My startup.pl looks like: #!/usr/bin/perl use Apache2; use Apache::compat (); 1; I will try to move all standard modules to startup.pl. Do I need to delete the standard modules from the scripts after I moved them to startup.pl? I mean, after I moved: use MyModule; to startup.pl, do I need to delete it from the scripts? Or Perl Run will automatically figure out that it has already been loaded and simply ignore the one in the scripts? > Any reason why you don't use ModPerl::Registry? Yes, since the scripts were running under plain CGI, they produce too many errors if run under ModPerl::Registry. I am working on them, and use PerlRun for the moment. PS. Congratulations on the publication of your new book :)
Re: Perl Run and Load Average
Batara Kesuma wrote: Hi, I have changed all my CGI scripts to run under Perl Run, and now I notice that the load average of my server (it is a dual CPUs) is very high. It stays around 2.5 all the time. Before, when I was running plain CGI, it was around 0.6 - 1.2. I checked the log file and I found that I only have around 10% more pageviews this week, so the load average shouldn't be that high. Is this normal? Any advice or comment? Thank you. Based on your previous questions, my guess is that you are using mod_perl 1.99_09. Please be more verbose about your setup when asking questions. Do you preload the modules that you use at the server startup? Your PerlRun scripts should be the only ones that get recompiled. Try moving all the standard modules to startup.pl and see if it gets any better. Any reason why you don't use ModPerl::Registry? __ Stas BekmanJAm_pH --> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Perl Run and Load Average
Hi, I have changed all my CGI scripts to run under Perl Run, and now I notice that the load average of my server (it is a dual CPUs) is very high. It stays around 2.5 all the time. Before, when I was running plain CGI, it was around 0.6 - 1.2. I checked the log file and I found that I only have around 10% more pageviews this week, so the load average shouldn't be that high. Is this normal? Any advice or comment? Thank you. --bk