speeding up perl script execution under apache

S

stig erikson

Hello.
Even though this might be more of an apache question i will try here.

We have a few perl scripts in production, they run in a web service
environment. We use apache 2 with the mod_cgi module that came with
apache on redhat. We have performance problems.
It is run on a rather slow Pentium II 200Mhz server and it will be
change in some not too far future but we would like to do something
meanwhile.

The entire script (from first to last line) takes about 0.05-0.1 second
to run. When we run it on apache it will take around 2.5 seconds to
execute the entire script.
The overhead from executing perl and "compiling" the script is almost
2.5 seconds. This is the problem. (serving static pages is fast, so the
problem is execution of scripts).
The total execution time ir rather consistant no matter what script is
run. For all scripts we run the overhead time is approximately 2.5 seconds.

We would like to minimize the overhead to gain time.
Preferrably we dont want to change the scripts.
Is there something we can do cut down the overhead time?
Make perl start faster och make the compilation faster?
Even a cut of the overhead from 2.5 to 2.0 seconds would help.

Thank you
Stig
 
A

A. Sinan Unur

Hello.
Even though this might be more of an apache question i will try here.

Rather you asked it in the right place.
The overhead from executing perl and "compiling" the script is almost
2.5 seconds. This is the problem. (serving static pages is fast, so
the problem is execution of scripts).

Then you should look into using mod_perl:

http://perl.apache.org/

http://perl.apache.org/docs/1.0/guide/getwet.html#Porting_Existing_CGI_Scri
pts_to_run_under_mod_perl
We would like to minimize the overhead to gain time.
Preferrably we dont want to change the scripts.

There is no silver bullet. More memory ought to help.

There is really not that much else we can say here. This is a programming
group.

Sinan.
 
G

Gunnar Hjalmarsson

stig said:
The overhead from executing perl and "compiling" the script is almost
2.5 seconds.

We would like to minimize the overhead to gain time. Preferrably we
dont want to change the scripts. Is there something we can do cut
down the overhead time?

You are screaming "mod_perl". Assuming that the scripts are well
written, there is at least not much you need to change to achieve a
significant performance improvement through mod_perl.
 
G

Gregory Toomey

stig said:
Hello.
Even though this might be more of an apache question i will try here.

We have a few perl scripts in production, they run in a web service
environment. We use apache 2 with the mod_cgi module that came with
apache on redhat. We have performance problems.
It is run on a rather slow Pentium II 200Mhz server and it will be
change in some not too far future but we would like to do something
meanwhile.

I've written my own article/chechlist on this!
http://gregorytoomey.com/index.php?option=content&task=view&id=2&Itemid=2

The entire script (from first to last line) takes about 0.05-0.1 second
to run. When we run it on apache it will take around 2.5 seconds to
execute the entire script.
The overhead from executing perl and "compiling" the script is almost
2.5 seconds. This is the problem. (serving static pages is fast, so the
problem is execution of scripts).
The total execution time ir rather consistant no matter what script is
run. For all scripts we run the overhead time is approximately 2.5
seconds.

Your setup is way under powered. My aim is to get my Perl cgi executing
under 0.1 sec. See my article.
We would like to minimize the overhead to gain time.
Preferrably we dont want to change the scripts.
Is there something we can do cut down the overhead time?
Make perl start faster och make the compilation faster?
Even a cut of the overhead from 2.5 to 2.0 seconds would help.

Thank you
Stig

gtoomey
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top