基于CGI-BIN的Web开发的主要缺点是什么?

时间:2021-08-01 07:09:13

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.

我有幸不做任何基于cgi-bin .cgi的web开发。但通常那些似乎没有“错过”那些日子的人。

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.

我最近加入的项目在处理需要与具有基于CGI-BIN的API的遗留系统进行通信的页面时存在性能问题。该系统是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.

我收到的反馈是“COGNOS很慢”,但其他人报告COGNOS取得了巨大成功,我认为它更多地与通过CGI-BIN的访问有关,而不是COGNOS本身的性能。

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

所有这些都说明了基于CGI-BIN的Web开发不具备性能,难度等的主要问题......

4 个解决方案

#1


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:

基于CGI-BIN的系统的基本架构问题是每个HTTP请求都要求服务器启动新进程。这会以多种方式影响性能:

  • It's expensive to start the process, as the OS pages in the program, sets up the process, etc.
  • 启动该过程非常昂贵,因为程序中的OS页面会设置进程等。

  • 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
  • 用户会话状态不能保留在内存中,因此必须与每个请求保持一致

#2


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

对我来说,CGI最大的痛苦是我的CGI程序每次启动时都必须“学习”一切。如果他们经常运行,那当然不是这样的,当然......

#3


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.

主要缺点,恕我直言,与所有低级编码具有相同的缺点 - 而不是在问题域中编程,您必须在实现域中编程。最终结果的核心是相同的 - 基于HTTP请求将HTTP响应发送到客户端。然而,从编程的角度来看,达到这一点要困难得多。

#4


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.

Apache为各种语言(例如mod_perl)提供了几种解决方案,因此脚本只被调用一次,然后保存在内存中以便快速检索。目前仍有大量GCI协议驱动的站点,如果编码和设置良好,其中许多站点的延迟相当低。

#1


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:

基于CGI-BIN的系统的基本架构问题是每个HTTP请求都要求服务器启动新进程。这会以多种方式影响性能:

  • It's expensive to start the process, as the OS pages in the program, sets up the process, etc.
  • 启动该过程非常昂贵,因为程序中的OS页面会设置进程等。

  • 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
  • 用户会话状态不能保留在内存中,因此必须与每个请求保持一致

#2


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

对我来说,CGI最大的痛苦是我的CGI程序每次启动时都必须“学习”一切。如果他们经常运行,那当然不是这样的,当然......

#3


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.

主要缺点,恕我直言,与所有低级编码具有相同的缺点 - 而不是在问题域中编程,您必须在实现域中编程。最终结果的核心是相同的 - 基于HTTP请求将HTTP响应发送到客户端。然而,从编程的角度来看,达到这一点要困难得多。

#4


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.

Apache为各种语言(例如mod_perl)提供了几种解决方案,因此脚本只被调用一次,然后保存在内存中以便快速检索。目前仍有大量GCI协议驱动的站点,如果编码和设置良好,其中许多站点的延迟相当低。