当前位置:网站首页>简述CGI与FASTCGI区别
简述CGI与FASTCGI区别
2022-06-12 13:42:00 【wwzroom】
CGI:Common Gateway Interface 公共网关接口,是外部扩展应用程序与 Web 服务器交互的一个标准接口,主要是web服务器用于处理动态资源请求时,调用网络服务器的接口。
请求流程:
Client – (http协议) --> httpd – (cgi协议) --> application server (program file) – (mysql协议) --> mysql
web服务器会根据这次请求的内容,然后会 fork 一个新进程来运行外部的 C 程序或者bash,perl脚本等,这个进程会把处理完的数据返回给web服务器,最后web服务器内容发送给用户,刚才fork的进程也随之退出。 如果下次用户还请求改动态脚本,那么web服务器又再次fork一个新进程,周而复始的进行。
fastcgi:FastCGI(Fast Common Gateway Interface)全称是“快速通用网关接口”,是通用网关接口(CGI)的增强版本,由CGI发展改进而来,主要用来提高CGI程序性能,类似于CGI,FastCGI也是一种让交互程序与Web服务器通信的协议。
请求流程:
Client – (http协议) --> httpd – (fastcgi协议) --> fastcgi服务器 – (mysql协议) --> mysql
fastcgi的方式是,web服务器收到一个请求时,不会重新fork一个进程(因为这个进程在web服务器启动时就开启了,而且不会退出),web服务器直接把内容传递给这个进程(进程间通信,但fastcgi使用了别的方式,tcp方式通信),这个进程收到请求后进行处理,把结果返回给web服务器,最后自己接着等待下一个请求的到来,而不是退出
CGI和fastcgi 比较
CGI: 兼职, 一次性的过河拆桥式的服务
FASTCGI: 专职,全周期的持续式的服务


边栏推荐
- Codeforces 1629 E. grid XOR - simple thinking
- Script import CDN link prompt net:: err_ FILE_ NOT_ Found problem
- 颜色编码格式介绍
- 2064: [example 2.1] exchange value
- Successfully rated Tencent t3-2, 10000 word parsing
- Innovation training (x) advanced interface beautification
- 1004: character triangle
- C language structure
- Transmission and response of events and use cases
- 1002: output the second integer
猜你喜欢

Paw advanced user guide

高通平台开发系列讲解(协议篇)QMI简单介绍及使用方法

When the byte jumps, the Chinese 996 is output in the United States

简历 NFT 平台 TrustRecruit 加入章鱼网络成为候选应用链

Application of list and Dict

当字节跳动在美国输出中国式 996

Transmission and response of events and use cases

torch_ About the geometric Mini batch
![Will the next star of PPT for workplace speech be you [perfect summary] at the moment](/img/11/ac67db2641f42ef3d09417b790feb8.png)
Will the next star of PPT for workplace speech be you [perfect summary] at the moment

It is enough to read this article. Web Chinese development
随机推荐
Codeforces 1638 B. odd swap sort - tree array, no, simple thinking
Paw advanced user guide
【SemiDrive源码分析】【X9芯片启动流程】25 - MailBox 核间通信机制介绍(代码分析篇)之 RPMSG-IPCC RTOS & QNX篇
高通平台开发系列讲解(协议篇)QMI简单介绍及使用方法
C language array and pointer
Innovation training (x) advanced interface beautification
Deploy opengauss database based on Huawei cloud Kunpeng elastic ECS [Gauss is not a mathematician this time]
2064: [example 2.1] exchange value
Debug code to quickly locate the error location
jsp跳转问题,不能显示数据库数据,并且不能跳转
Transmission and response of events and use cases
Multi source BFS problem template (with questions)
Tensorrt, onnx to tensorrt in mmclas
A method of quickly creating test window
Seeking magic square of order n with C language
Title: Yanghui triangle
【刷题篇】超级洗衣机
C#DBHelper_ FactoryDB_ GetConn
Seekg, tellg related file operations
Code debugging - print log output to file