What were the main disadvantages of CGI-BIN based

2019-03-29 12:35发布

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...

4条回答
Root(大扎)
2楼-- · 2019-03-29 13:14

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
查看更多
戒情不戒烟
3楼-- · 2019-03-29 13:24

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...

查看更多
Ridiculous、
4楼-- · 2019-03-29 13:25

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.

查看更多
做自己的国王
5楼-- · 2019-03-29 13:26

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.

查看更多
登录 后发表回答