Re: Q: How to improve CGI performance for this?
- From: Juha Laiho <Juha.Laiho@xxxxxx>
- Date: Sun, 14 May 2006 20:26:24 +0000 (UTC)
"avtanski@xxxxxxxxx" <avtanski@xxxxxxxxx> said:
I'm not sure that this is the right group for this question - Googling
for similar questions gave me always "comp.lang.perl.misc", but if this
is OT here, please, let me know.
The problem I'm having is with a CGI script that needs to load and
parse some data from a quite large file, then do some extra processing
based on user form input and return. The slow part is (I guess)
loading and parsing the data from the file.
Glad to see you've been able to improve the situation already.
2) Switching to PHP - this means rewriting everything, what a mess...
Even though people are sceptical on this, it might be one idea.
Not for the language, but for the execution mode. More below.
3) Using something like FastCGI, providing that the hosting provider
have it. Do you think this can help? I don't know much about FastCGI,
can I somehow preload the data in memory and just use it from the
script?
4) Using mod_perl? Don't know much about it too. Can I parse the data
from the file once, have it stored in memory and each time my script is
invoked access it? How much cooperation is required from my provider
for this?
mod_perl and FastCGI require co-operation from your provider. Both
will provide the same effect as switching to PHP most probably would.
The issue is, with perl run as CGI, every time someone accesses your
script, it will be loaded, parsed and compiled. And run.
PHP is much more commonly run as a module, and herein lies the difference.
The page using PHP will be loaded, parsed and compiled once (per server
worker process), which is a huge difference. Every subsequent request
through the same worker process will have a ready-to-run version of
the page. FastCGI will provide the same, as will mod_perl.
--
Wolf a.k.a. Juha Laiho Espoo, Finland
(GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
"...cancel my subscription to the resurrection!" (Jim Morrison)
.
- References:
- Q: How to improve CGI performance for this?
- From: avtanski@xxxxxxxxx
- Q: How to improve CGI performance for this?
- Prev by Date: FAQ 4.26 How do I reformat a paragraph?
- Next by Date: Re: Win32 SerialPort
- Previous by thread: Re: Q: How to improve CGI performance for this?
- Next by thread: FAQ 1.3 Which version of Perl should I use?
- Index(es):
Relevant Pages
|