[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Efficiency with CGIs

Posted on 1998-07-15
4
Medium Priority
?
330 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

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…
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 …
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…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Suggested Courses

656 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