View Full Version : High Server Load: Mod_Perl? Adserver ? Mysql Caching`?
DReffects 03-02-2002, 06:10 PM Hello,
since we've relaunched our webpage we're getting high system load... 3 and more.
It's a big problem because we expect about 5 times more visitors in the next weeks. :(
we're running an Perl Based forum called 'Ikonboard'. It is able to use mod_perl but says that the Raq4 from Rackshack has not installed it...
i've read in several other topics that mod_perl is built into the apache core.... but it seems like it does not work for me..
also we use a perl based gallery script which...
on the other hand we have a very high use of mysql database through the ad-management 'PHPMyadsNew' which serves about 60 000 Ads each day...
Others told me that i should optimize my server config files, add caching to mysql, disable the cgi-wrapper, install a new Apache and enable mod_perl....
but i have no clue about all this things.... :(
Please help me :) Thanks in advance!
Daniel
bhalsted 03-02-2002, 06:16 PM I would suggest putting MySQL on a different box if your site uses it a lot.
DReffects 03-02-2002, 06:18 PM hm i have no additional box :(( do you think the adserver is the problem ?
i think the cgis taking all the load...
is there a way to show wich specific FILE need all this CPU power? My RAM is empty....
and ps and top only tell me that's a httpd process *g*
bhalsted 03-02-2002, 06:40 PM If you do a "top -b" top will show you all the processes by scrolling. You will need to ctrl-c out of it tho. That may give a bit more insight.
DReffects 03-02-2002, 06:44 PM hm gives me nothing new:
28744 httpd 17 0 9924 9924 7676 R 0 9.2 3.8 4:31 httpd
5376 httpd 11 0 8848 8848 8080 R 0 5.0 3.4 0:00 httpd
28745 httpd 2 0 9776 9776 7656 S 0 3.7 3.7 4:34 httpd
28761 httpd 3 0 9916 9916 7664 S 0 3.1 3.8 4:23 httpd
can anyone explain how i can install/activate mod_perl or any other thing that could speed up the CGI Processing??
Originally posted by DReffects
hm gives me nothing new:
28744 httpd 17 0 9924 9924 7676 R 0 9.2 3.8 4:31 httpd
5376 httpd 11 0 8848 8848 8080 R 0 5.0 3.4 0:00 httpd
28745 httpd 2 0 9776 9776 7656 S 0 3.7 3.7 4:34 httpd
28761 httpd 3 0 9916 9916 7664 S 0 3.1 3.8 4:23 httpd
can anyone explain how i can install/activate mod_perl or any other thing that could speed up the CGI Processing??
mod_perl is installed by default on the RaQ4.
If you do not "have a clue how to do it" (like you wrote earlier), and this is really important for you, why don't you have someone with a clue look at it? (it's going to be hard for people at WHT to help out, because so many things can have influence on the performance of a server, and it's always easiest to find the solution if you have access to the server).
DReffects 03-02-2002, 07:16 PM hmm the script i use says that i DON'T have mod_perl installed....
i know how to install basic stuff on linux.. but i have no experience in installing a whole new apache :)
so please: help a newbie :) i don't have a friend who knows about webservers... and no money (im a student) to pay an professional....
Originally posted by DReffects
hmm the script i use says that i DON'T have mod_perl installed....
Check your httpd.conf file. It is most probably installed! :-)
qslack 03-02-2002, 07:53 PM To find out for sure if mod_perl is installed or not, cd to your apache folder and run this command:
bin/httpd -l
That lists all of the modules that are compiled into Apache. If it doesn't say mod_perl there, then it's not compiled in.
There are a bunch of good scripts and tutorials to help you install Apache, but I recommend www.apachetoolbox.com.
pgowder 03-02-2002, 08:01 PM You might also try a different bb system like vbulletin.
When I ran a perl based solution--UBB, my load was much higher than with the php/mysql solution.
Thanks
DReffects 03-02-2002, 09:13 PM ok :)
i get this:
[root sbin]# httpd -l
Compiled-in modules:
http_core.c
mod_so.c
mod_perl.c
suexec: enabled; valid wrapper /usr/sbin/suexec
looks like it's in the apache... but not activatet...
i have a mod_perl directory in my etc directory with a file in it called:
httpd80.startup.pl
looks like it's making some entries to the httpd conf... should i run it ? :D
And i found this line in the httpd.conf:
# Extra Modules
#AddModule mod_php.c
#AddModule mod_php3.c
#AddModule mod_perl.c
#AddModule mod_casp2.c
AddModule mod_gzip.c
AddModule mod_php4.c
Ive Uncommentet the Line with Mod Perl and restartet the apache with:
/etc/rc.d/init.d/httpd stop
and then
/etc/rc.d/init.d/httpd start
... ive not restartet the entire webserver....
But my script still says NO mod Perl activatet..... (and the script works *G*)
thanks for your help!!!
Originally posted by DReffects
ok :)
i get this:
[root sbin]# httpd -l
Compiled-in modules:
http_core.c
mod_so.c
mod_perl.c
suexec: enabled; valid wrapper /usr/sbin/suexec
looks like it's in the apache... but not activatet...
i have a mod_perl directory in my etc directory with a file in it called:
httpd80.startup.pl
looks like it's making some entries to the httpd conf... should i run it ? :D
And i found this line in the httpd.conf:
# Extra Modules
#AddModule mod_php.c
#AddModule mod_php3.c
#AddModule mod_perl.c
#AddModule mod_casp2.c
AddModule mod_gzip.c
AddModule mod_php4.c
Ive Uncommentet the Line with Mod Perl and restartet the apache with:
/etc/rc.d/init.d/httpd stop
and then
/etc/rc.d/init.d/httpd start
... ive not restartet the entire webserver....
But my script still says NO mod Perl activatet..... (and the script works *G*)
thanks for your help!!!
Open a connection to your server as root, and type this command:
tail -f /var/log/httpd/error
Then open a new windows with a new connection to your server as root, and type this command:
/etc/rc.d/init.d/httpd restart
Now check the first window - it should show the version numbers of Apache, PHP, etc. - and hopefully mod_perl ?
driverdave 03-02-2002, 09:24 PM cgi/perl based web scripts are CPU hogs. Run top and access your Cobalt GUI and see for yourself.
I've read long stories about people tweaking with cgi/perl based forums to get them running better. I think the solution is a PHP/MySQL based forum. Just my 2 cents.
Originally posted by driverdave
cgi/perl based web scripts are CPU hogs. Run top and access your Cobalt GUI and see for yourself.
I've read long stories about people tweaking with cgi/perl based forums to get them running better. I think the solution is a PHP/MySQL based forum. Just my 2 cents.
Using mod_perl is quite superior to simple cgi/perl-scripts - so the same does not necessarily apply there.
DReffects 03-02-2002, 09:28 PM WOW
every second i get this error :
[Sun Mar 3 02:21:33 2002] [error] mod_gzip: EMPTY FILE [/tmp/_23862_139_40.wrk] in sendfile2
[Sun Mar 3 02:21:33 2002] [error] mod_gzip: Make sure all named directories exist and have the correct permissions.
strange....
Rochen 03-02-2002, 09:29 PM Ikonboard is your problem. It generates VERY high server loads.
Try moving to something like phpBB or VBulletin.
Ikonboard should be okay latter this year when the PHP version of it is released. We will have to wait and see.
DReffects 03-02-2002, 09:31 PM ok i did it...
[Sun Mar 3 02:24:14 2002] [notice] caught SIGTERM, shutting down
[Sun Mar 3 02:24:18 2002] [notice] Apache/1.3.12 Cobalt (Unix) mod_ssl/2.6.4 OpenSSL/0.9.5a PHP/4.1.1 mod_gzip/1.3.19.1a mod_auth_pam/1.0a FrontPage/4.0.4.3 mod_perl/1.24 configured -- resuming normal operations
[Sun Mar 3 02:24:18 2002] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
comes with mod perl... perhaps its' too old?
what about the apache server... its also about 2 years old.. could this be the problem?
i cannot use another board :(( my whole community we've developed for 6 months depends on it :(
DReffects 03-02-2002, 09:33 PM @rochen
matt, the developer from IB told us in their forums that the IB 3 uses much LESS CPu Power than VB does... if you have Mod_Perl activatet.....
so i really need this because i cannot switch to another board :(
Originally posted by DReffects
ok i did it...
[Sun Mar 3 02:24:14 2002] [notice] caught SIGTERM, shutting down
[Sun Mar 3 02:24:18 2002] [notice] Apache/1.3.12 Cobalt (Unix) mod_ssl/2.6.4 OpenSSL/0.9.5a PHP/4.1.1 mod_gzip/1.3.19.1a mod_auth_pam/1.0a FrontPage/4.0.4.3 mod_perl/1.24 configured -- resuming normal operations
[Sun Mar 3 02:24:18 2002] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
comes with mod perl... perhaps its' too old?
what about the apache server... its also about 2 years old.. could this be the problem?
i cannot use another board :(( my whole community we've developed for 6 months depends on it :(
mod_perl is certainly running.
If it's too old is impossible to say, without seeing the script that you're that is saying "no mod_perl is not here".
Rochen 03-02-2002, 09:36 PM Originally posted by DReffects
i cannot use another board :(( my whole community we've developed for 6 months depends on it :(
You can if there is a Ikonboard to vB or Ikonboard to phpBB converter. I am not sure if there is one but you could try searching around the net. This would allow you to convert the MySQL DB.
I would however keep away from phpBB2 until the full version has been released. RC2 is however very stable. If you have a community of the size you are describing I would opt for vB.
Good Luck!
DReffects 03-02-2002, 09:42 PM the problem is that we've connected a chat and many other communites features directly to ikonboard.. so a change would take us weeks or even months...
this code askes for mod perl:
@{[ $ENV{MOD_PERL} ? 'Yes' : 'No' ]}
Originally posted by DReffects
the problem is that we've connected a chat and many other communites features directly to ikonboard.. so a change would take us weeks or even months...
this code askes for mod perl:
@{[ $ENV{MOD_PERL} ? 'Yes' : 'No' ]}
Try writing:
export MOD_PERL=1
And then run the program again :-)
Ever though of just disabling that check and see if it works?
DReffects 03-02-2002, 10:01 PM hmm does not work :D
i have no clue HOW ikonboard tries to activate/use mod_perl...
can you give me an idea to search for the part of code that tries to use it?
i've found a script part in one of the document directories containing this:
##############################
# Start up script for mod_perl
#############################
use strict;
# Compile CGI.pm
use CGI ();
CGI->compile (':all');
# Use the Ikonboard 3 pre-loader script
use lib ("/home/ikonboar/public_html/z_test/Sources");
# Test to make sure we can load it...
{
local ($@);
# Supress warnings
$^W = undef;
eval "require iPerl::mod_perl";
unless ($@) {
use iPerl::mod_perl;
} else {
print STDERR "Could not Preload Ikonboard: $@";
}
}
# That's it...
1;
but this script is not connected in any way with the board....
DReffects 03-02-2002, 10:04 PM just found another one locatet in the sources directory and named
mod_perl.pm
########################################
# Ikonboard mod_perl pre-loader
# by: Matthew Mecham
#
#
# WARNING: Only use this script after
# you have set up your board and you
# know that it works properly!
# If not, your server may not restart...
########################################
package iPerl::mod_perl;
use strict;
use vars qw/$URL $PATH $EXT $MOD_PERL/;
# Are we sure about the mod_perl? It's not fast_cgi is it?
$MOD_PERL = (exists $ENV{GATEWAY_INTERFACE} and ($ENV{GATEWAY_INTERFACE} =~ /^CGI-Perl/)) ? 1 : 0;
BEGIN { if ($MOD_PERL) { require Apache::DBI; } }
# First thing to do is to add in any custom @INC paths.
# Swop what we have here for your own paths - or it will fail!
use lib ('/home/ikonboar/public_html/z_test',
'/home/ikonboar/public_html/z_test/Data',
'/home/ikonboar/public_html/z_test/Sources',
'/home/ikonboar/public_html/z_test/Languages',
'/home/ikonboar/public_html/z_test/Skin'
);
# Other stuff to set up:
#1) What is your URL to the board?
$URL = 'http://www.ikonboard.com/z_test';
#2) What is the full path to your board?
$PATH = '/home/ikonboar/public_html/z_test';
#3) What CGI extension are you using for the ikonboard scripts?
$EXT = '.cgi';
print STDERR "Ikonboard 3 Preloader: Preloading commonly used modules\t\t";
# Preload common modules
use Boards;
use Forum;
use Post;
use Register;
use Search;
use Sessions;
use Topic;
use iTextparser;
use iDatabase::SQL;
use UserCP::Lostpass;
use UserCP::Menu;
use UserCP::Messenger;
print STDERR " (OK)\n";
# Preload the ikonboard.cgi script.
do_load() if ($MOD_PERL and ($Apache::ServerStarting == 1));
sub do_load {
# Uses the Apache::RegistryLoader
require Apache::RegistryLoader;
my $r = Apache::RegistryLoader->new;
$^W = 1; # Turn on warnings
print STDERR "Ikonboard 3 Preloader: Preloading ikonboard.cgi\t\t";
$r->handler("$URL", "$PATH/ikonboard$EXT");
print STDERR " (OK)\n\n Ikonboard preloading complete....\n\n";
}
1;
apache is a bit too old, 1.3.12:eek: jsut download www.apacheoolbox.com which installs apache with haps of modules (inc mod_perl) and PHP. nd upgrade to Perl 4.6.1 as RaQs coe with 5.5.3
DReffects 03-03-2002, 07:55 AM ok :)
but i already have php 4.1.1 installed combinded with image magick....
and the worst thing: my system partition is alreday very full.. i have only 70 MB left.
I already moved the mysql databeses to the home directory and the logfiles too....
any suggestions for freeing up some space?
thanks ;:)
DReffects 03-03-2002, 11:36 AM ive downloaded the apachetoolbox script thing...
it offers me to install php 4.1.2 as well... but i've compiled php in a very specific setup because i use a chat server based on php...
can someone help me in installing it without breaking my admin panel and the previous configuration ?
|