Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

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/somescript.pl?parmNod +e=1" -->">Item 1</a></li> <li><a href="/path2/<!--#exec cgi="/cgi-bin/somescript.pl?parmNod +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

Comment on SSI execs for Perl CGI script
Download Code
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?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://859556]
Approved by moritz
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (7)
As of 2014-08-30 13:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (293 votes), past polls