?
Solved

Efficiency with CGIs

Posted on 1998-07-15
4
Medium Priority
?
332 Views
Last Modified: 2013-12-25
As I understand an inherent disadvantage with CGIs is that each each request (let us assume it is form processing) causes a new process to be forked.

1. Do we have an alternate way to process forms
2. Can we somehow circumvent from this drawback
3.Or do we have to live as it is, as that is the only way that things are with form processing

Just to provide you additional info I intend using PERL for form processing..Do you think using something else might be more efficient...a) in case of WINDOWS
                                 b) with UNIX      
0
Comment
Question by:sanjaychopra
  • 2
4 Comments
 

Accepted Solution

by:
ShadowSpawn earned 10 total points
ID: 1830770
In general you're stuck with it.  If you really have a high volumn of form processing, etc. you may want to look into Fast-CGI.  This will allow the script to be "always running" and prevent the load / setup time associated with each execution. This will work fine on a *nix server.  To make a Windows server more efficient simply reformat the drive and install *nix. Worked wonders for me.  

To get more efficiency you may want to move from Perl to C/C++.  A compiled script will execute faster --- assuming your a descent programmer.

0
 
LVL 6

Expert Comment

by:alamo
ID: 1830771
A 'descent' programmer, ShadowSpawn? Perhaps you lost your spellchecker while reformatting your drive 'volumn'.

sanjaychopra:

There are two big factors in speed:

-The inherent speed of the language. Perl scripts are compiled on every single invocation, whereas C/C++ is compiled into a ready-to-run executable. The tradeoff  - the reason people don't just always use C++ for CGI - is that perl is for many tasks so much easier and quicker to program and debug, and most sites don't need the better performance. According to what the Experts Exchange developers have posted here, E-E was itself originally written in perl then once the design was worked out and performance started becoming an issue (as the site got more popular -100,000 hits a day they say) it was converted over to C++.

- How the server invokes the CGI. Normally a server invokes a CGI by cerating a new process, which has significant overhead. This is true for both executables and perl. There are ways to greatly reduce this overhead by including the cgi as part of the server process, so that no external process need be forked. On nix servers such as Apache, Fast-CGI or (for perl) perl-mod does this. On WinNT servers ISAPI does this (by making the CGI into a DLL). There is an ISAPI DLL for perl available for NT.

Hope this was helpful...
0
 

Author Comment

by:sanjaychopra
ID: 1830772
Thanks for the replies..Alamo that reply was really exhaustive enough to satisfy my queries..Thanks...
0
 

Expert Comment

by:ShadowSpawn
ID: 1830773
Like I said ..... C is better.  

Alamo  -- My spell checking dll was somehow flawed by another app!  Next time I spew an 'exhaustive' answer out I'll be sure to try to fix it.  Until then you'll just have to rely on the content of my messages.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Measuring Server's processing rate with a simple powershell command. The differences in processing rate also was recorded in different use-cases, when a server in free and busy states.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Suggested Courses
Course of the Month14 days, 15 hours left to enroll

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question