Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to understand FastCGI protocol

2025-04-11 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

Today, I would like to talk to you about how to understand the FastCGI agreement, many people may not know much about it. In order to make you understand better, the editor has summarized the following content for you. I hope you can get something according to this article.

CGI

The full name of CGI is "Public Gateway Interface" (Common Gateway Interface), a tool for HTTP servers to "talk" with programs on your or other machines, which must run on a network server.

The disadvantages of cgi

What's wrong with cgi?

When each request comes in, cgi fork a new process, and then, in the case of php, each request consumes a considerable amount of memory, so that, concurrently, it will be completely GG.

In order to solve this problem, fastCgi is produced.

FastCGI

FastCGI is like a resident (long-live) CGI that can be executed all the time, as long as it is activated and does not take the time to fork every time (this is the most criticized fork-and-execute mode of CGI).

It also supports distributed computing, that is, FastCGI programs can be executed on hosts other than web servers and accept requests from other web servers.

An analysis of a complete http requested by cgi to the backend

Http request:

Request URL: http://demo.inke.cn/server.phpRequest Method: GETStatus Code: 200OKRemote Address: 127.0.0.1:80Referrer Policy: no-referrer-when-downgradeAccept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3Accept-Encoding: gzip, deflateAccept-Language: zh-CN,zh;q=0.9Cache-Control: max-age=0Connection: keep-aliveCookie: aid=fa29caf3-5b18-401c-8abd-677eb1a1c45f S-59804d897bc03a0036dc141c=2a126bda133d4feba4169fa70308f2c7Host: demo.inke.cnUpgrade-Insecure-Requests: 1User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10 / 13 / 4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36

Server.php

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 222

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report