Question

I was fortunate enough to not do any cgi-bin .cgi based web development. But generally those who have do not seem to 'miss' those days.

A project I recently joined has a performance issue when dealing with the pages that need to communicate to a legacy system that has a CGI-BIN based API. That system is COGNOS 7.

The feedback I received to date is that 'COGNOS is slow' but others have reported great success with COGNOS, I am thinking it has more to do with the access via CGI-BIN and not the performance of COGNOS in and of itself.

All that said what are the main issues that made CGI-BIN based web development non-performant, difficult, etc...

Was it helpful?

Solution

The fundamental architectural issue with CGI-BIN based systems is that each HTTP request requires the server to start a new process. This affects performance in a number of ways:

  • It's expensive to start the process, as the OS pages in the program, sets up the process, etc.
  • Resources can not be shared across requests, so that any DB connections, etc. have to be set up with each request
  • User session state can not be preserved in memory, so it has to be persisted with each request

OTHER TIPS

For me the biggest pain with CGI is that my CGI programs have to "learn" everything each time they start up. If they were running constantly that wouldn't be the case, of course...

The main disadvantage, IMHO, was the same disadvantage that all lower-level coding has - instead of programming in the problem domain, you had to program in the implementation domain. The end result was, at its core, identical - an HTTP response was sent to a client based on an HTTP request. However, getting to that point was a lot trickier from a programming perspective.

Apache has several solutions to this for various languages (e.g. mod_perl) so that a script is only invoked once, then held in memory for fast retrieval. There are still plenty of GCI-protocol driven sites out there, many of which run with reasonably low latency, if well-coded and set up.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top