Summary of advantages and disadvantages of fastcgi

Source: Internet
Author: User
The first few to interview were asked a question when configuring the PHP environment, fastcgi and modular installation of their respective advantages and disadvantages? Back on the Internet to find some information, do the following summary.

If you want to understand the technical principles of FastCGI, you need to know what a "short lifetime application" is, and what is a "long lifetime application." Starting with CGI technology, the following is the theory of CGI: each time a client requests a CGI, the WEB server requests the operating system to generate a new CGI process. When CGI meets the requirements, the server kills the process. The server repeats this process for each request to the client. And the theory of FastCGI technology is: Once the FastCGI program is produced, he can continue to work, enough to satisfy the customer's request until it is explicitly terminated. If you want to improve the performance of your program through collaborative processing, you can request a WEB server to run a copy of multiple fastcgi applications. CGI is called a short lifetime application, and FastCGI is the so-called long lifetime application. Because the FastCGI program does not need to constantly produce new processes, can greatly reduce the pressure on the server. and has a high application efficiency.

Compared to CGI, FASTCGI has the following characteristics:
1. Breaking the traditional page processing technology
Traditional page processing techniques, programs must be in the same server as the WEB server or application server. This history has been broken by FastCGI technology for the early N years, and FastCGI applications can be installed on any server in the server farm, while communicating with the WEB server via TCP/IP protocol, which is suitable for developing large distributed web groups as well as for efficient database control.

2. Clear mode of request
CGI technology does not have a clear role in the FastCGI program, where the program is given a clear role (responder role, authenticator role, filter role).

3. Reasonable procedural structure
At first, I really hated the structural requirements of FastCGI applications. Never mind, you will like this structure after a period of writing, only this completely normative structure to make your program more efficient.

Then there are the pros and cons of fastcgi.

Advantages of fastcgi:
1, high stability, fastcgi is a separate process pool to run CGI, a single process dead, the system can easily discard, and then redistribute new processes to run the logic.
2, good security, fastcgi and host server completely independent, fastcgi how down will not bring down the server.
2, High-performance, fastcgi dynamic logic processing from the server, the large load of IO processing or left to host server, so that the host server can be dedicated IO, for a normal Dynamic Web page, logic processing may only be a small part of A large number of static IO processing such as pictures do not require the participation of logical programs.
3, good extensibility, fastcgi is a neutral technical standard, can fully support any language written processing procedures.

Disadvantages of fastcgi:
1, for some of the new version of the server support is not good, the distributed load balancing does not require a modular installation is a better choice.
2, the current fastcgi and server communication is not smart enough, a fastcgi process if the execution time is too long will be treated as a dead process to kill a heavy, so in the process of dealing with a long time task is very troublesome. This also makes fastcgi unable to allow online debugging.
3, scgi and other similar technology can replace fastcgi, scgi in Python is very successful, full-featured, and now SCGI also began to support rails with the popularity of rails, an independent mod_rails is possible, and Ruby's own webserver is starting to emerge, and it's possible to make a connection to the mainstream webserver.fastcgi design when you want to be common gatewayinterface (CGI), But the goal now seems to be out of place.

The advantages and disadvantages of modular installation have not been found yet.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.