Gossamer Forum
Home : Products : Gossamer Forum : Discussion :

Benchmarking

Quote Reply
Benchmarking
I am experimenting with the forum under mod_perl and I want to have some sort of benchmark for its performance with or without mod_perl.

From a previous post I gathered that you could use time ./gforum.cgi > /dev/null to measure the time it takes to execute gforum.cgi as a cgi script (not using mod_perl). This gives me something like:
0.77user 0.04system 0:00.81elapsed 99%CPU

I also tried to use ab (apache benchmark), and it gave me something like:
Time per request: 817.00 [ms]

To me this looks like the same time I get with 'time'. I also started apache without mod_perl and I got about the same result.

Does that mean that mod_perl is not properly set up on my server? Or does it mean that the benchmark 'does not feel' mod_perl? (At some point the server with mod_perl would not start up, because of a missing module that is used by gforum. I installed the module and since then it doesn't complain anymore, so I assume the setup is OK).

I am using a fairly out-of-the-box apache configuration (Mandrake 8.2), with mod_perl.

Any help, or hint in the right direction is greatly appreciated.

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] Benchmarking In reply to
Hi,

Goto your admin area and open up FileMan. Click on Preferences and then environment, and if the program is running under mod_perl, you should see:

mod_perl (1)

If you don't see that, then mod_perl is not correctly configured (most likely you aren't telling Apache to run the forum under mod_perl).

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Benchmarking In reply to
Thanks a lot for the quick answer.

I see:
Persistant Env: mod_perl () SpeedyCGI (0)

so that doesn't look good.....

The server is setup as a virtual server on a basically dedicated machine (there are two other domains). I placed the <location> thing in commonhttpd.conf and the 'use lib' thing in addon-modules/proxied-handler.pl (which is the startup script I suppose).

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] Benchmarking In reply to
Do you have mod_perl.so loaded into apache?

You need to add the AddModule and LoadModule lines unless you compiled it into apache.
Quote Reply
Re: [Paul] Benchmarking In reply to
I think it's compiled into apache.

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] Benchmarking In reply to
Try looking through the following directions (from the README.mod_perl file that comes in your GForum package).

Quote:


Gossamer Forum works best under mod_perl. mod_perl is open source software that integrates perl inside of Apache. You can find out more details about mod_perl at:

http://perl.apache.org/guide/

Running mod_perl typically requires your own dedicated server. Gossamer Threads can provide you with pre-configured Gossamer Forum installations running under mod_perl. If you are interested in this, please send us an email at hosting@gossamer-threads.com.

To setup Gossamer Forum using mod_perl, you need to:

1. First, install Gossamer Forum as described in the README.

2. Now, add the following section to your httpd.conf file:

<Location /url/to/gforum>
SetHandler perl-script
PerlHandler Apache::Registry
PerlSendHeader On
Options +ExecCGI
</Location>

You need to change '/url/to/gforum' to the URL where the user cgi script is located. The URL should start with a / and be set from your document root, but does not contain your domain name. For example, if your scripts were at:

http://gossamer-threads.com/perl/gforum/gforum.cgi

You would put: <Location /perl/gforum> in your httpd.conf file.

3. Most mod_perl installations have a startup file for loading perl scripts you
are using when httpd is started. You need to add the following to your startup
file:

use lib '/full/path/to/admin';
require GForum::mod_perl;

where '/full/path/to/admin' is a full system path to your admin directory.

If you don't have a startup file, you should create one by adding to
your httpd.conf file:

PerlRequire /path/to/startup.pl

and adding the above lines into startup.pl.

Congratulations, you are now done! When you restart mod_perl you should see:

Preloading Gossamer Forum modules into mod_perl:
. . . . . . . . . . .
All modules compiled and loaded ok!

That means everything has been pre-loaded and you are ready to go!

If you have any questions or problems, please visit our support section at:

http://gossamer-threads.com/support/

Gossamer Threads Inc.

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Quote Reply
Re: [Alex] Benchmarking In reply to
I found the problem: in this Mandrake setup, apache actually runs two webservers, one without mod_perl and the other one with mod_perl. Perl requests are sent to the mod_perl server by a rewrite rule. In their setup they sent all the requests to /perl and to /cgi-perl to the mod_perl server. I just had to make a rewrite rule for my /forum directory.

Benchmark: a lot faster!
Time per request: 115.41 [ms]

So, everything works fine now. Thanks for your help.

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] Benchmarking In reply to
That's the usual way to do (gossamer-threads.com uses a similar system).

That way if you have some nasty perl scripts that take all of the allowed apache processes, your web site doesn't go down, just the Perl side. For development, I really don't care if mod_perl takes my server down, so I go with the much simpler one-apache-for-everything system.

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Quote Reply
Re: [Jagerman] Benchmarking In reply to
The other big advantadge is you don't have a mod_perl process tied up serving some guy on a 28.8 modem. i.e. if your mod_perl server has to send a 80kb forum page to someone on a 28.8 modem, you end up needing a lot more mod_perl processes (which use more memory).

If you use the proxied system, then the small regular httpd sends the page to the client, and the mod_perl process is freed up immediately to server another request. We typically run 5 or 6 mod_perl processes on Gossamer with 50-60 regular httpds.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Benchmarking In reply to
I just found out one more thing:

on my homepage (which is index.shtml) I use an ssi include virtual command to list the latest post (to gforum.cgi?do=recent_posts_ssi). However, it seems that this include virtual did not go through the mod_perl server. Consequently I have changed the server configuration such that all shtml files (not the html files) go through the mod_perl server (rewrite rule). This measure increased the speed of loading the homepage by about ten times!!!

Is that a reasonable thing to do? Most of my other pages are static (html), so they won't be affected.

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [Alex] Benchmarking In reply to
I tried setting my MaxClients to 150 ....does that sound too high?

I was told that with 512MB RAM it should be 50-100?

Last edited by:

Paul: Apr 4, 2002, 11:59 PM
Quote Reply
Re: [Alex] Benchmarking In reply to
One more problem: since the mod_perl server is behind a proxy, it doesn't get the right remote ip. So in my who's online page, all users show up with the ip set to the host.

Is there a way to pass on the remote_addr to the mod_perl server? Otherwise I won't be able to ban anyone...

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] Benchmarking In reply to
Have a look at:

http://perl.apache.org/...Remote_Server_IP_in_

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Benchmarking In reply to
Thanks.

I don't have time now, but I will have a look at that later.

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [Alex] Benchmarking In reply to
After days of trial and error I finally managed to get it to work....

Thanks for the tip again.

Ivan
-----
Iyengar Yoga Resources / GT Plugins