Solved

Efficiency with CGIs

Posted on 1998-07-15
4
326 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
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 fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

735 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