?
Solved

Efficiency with CGIs

Posted on 1998-07-15
4
Medium Priority
?
329 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

765 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