Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

SSI execs for Perl CGI script

by rpike (Scribe)
on Sep 09, 2010 at 20:08 UTC ( #859556=perlquestion: print w/replies, xml ) Need Help??
rpike has asked for the wisdom of the Perl Monks concerning the following question:

Hi all, I have a webpage that has about 5 SSIs on it. Each SSI points to a perl script that returns some value (character string between 10-15 characters). The script runs relatively fast when run on it's own (i.e. command line or such) but on this html page - numerous times - it tends to cause the page to really load up slowly. What can I do to speed up the processing of the page? Is this slowness due to the number of calls to the script? Something to do with IIS and how it assigns the tasks out? Etc..,? I've ran it on a few Windows machines running IIS and same results. Here's a sample of the code :
<li><a href="/path1/<!--#exec cgi="/cgi-bin/ +e=1" -->">Item 1</a></li> <li><a href="/path2/<!--#exec cgi="/cgi-bin/ +e=2" -->">Item 2</a></li>
The script acts as a generator of values and has to be on plain html pages that aren't able to get parsed. If anyone has any ideas on how to speed up the SSIs in this case I'd love to hear from you with a possible solution or 2 on how to fix it. Thanks. AF

Replies are listed 'Best First'.
Re: SSI execs for Perl CGI script
by moritz (Cardinal) on Sep 09, 2010 at 20:15 UTC
    Without knowing what your script does, and how it does, it's impossible for us to tell what causes the slowness.

    If it accesses a common resource (like a file or a database) that needs to be locked, that would explain why multiple calls at once are much slower that running the script only once.

    The general wisdom is to run a profiler like Devel::NYTProf to find where the slowness is.

    Perl 6 - links to (nearly) everything that is Perl 6.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://859556]
Approved by moritz
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2018-05-27 02:16 GMT
Find Nodes?
    Voting Booth?