Mark R. Brown.
Open Market, Inc.
If fastcgi applications enjoy significant architectural advantages over API applications, it is no surprise that fastcgi applications run much faster. To understand these structures in greater depth, we measure two scenarios: an API with persistent connections. If you can avoid additional licensing fees, your API application will run much faster.
API 16.0 ms/Request = 61 Request/sec
The answer is: it still can't be as fast as the fastcgi application. Deactivate the cached fastcgi. How much the fastcgi application benefits from its cache. FastCGI 20.1 ms/request = 50 Request/sec
The answer is: extremely large amounts of help, even though database access is fairly straightforward.
These two additional experiments show that if APIs and FASTCGI applications are implemented in exactly the same way-caching database connections without caching user profile data--api applications are slightly faster. This is expected because the FASTCGI application must bear the cost of interprocess communication, which does not exist in API applications.
These two applications are not actually implemented in the same way. FastCGI's architectural advantages lead to higher performance-3 times times in this test. This factor is higher when you use a remote database or a more expensive database access. This factor becomes smaller by using content files that require more processing. 6. Multithreading API
Now, Web servers with multithreaded internal structures (and accompanying APIs) are starting to become more common. These servers do not have all the disadvantages described in chapter 3rd. Does this mean that fastcgi's performance advantages will disappear.
A rough analysis agrees (with this view). API-based applications in a single process, multithreaded server can maintain caching and database connectivity in a FASTCGI application. API based applications are not burdened with the cost of interprocess communication, so API based applications will be slightly faster than fastcgi applications.
A deeper analysis denies (this view). Multithreaded programming is complex because concurrency makes it more difficult to test and debug programs. In the case of multithreaded programming of Web server APIs, the general problems of multithreading are mixed because of the lack of independence between applications and applications and Web servers. With FastCGI, you can write programs in a single thread style, get all the reliability and maintainability of process isolation, and still get very high performance. If you really need multithreading technology, you can write multithreaded fastcgi and still isolate your multithreaded applications from other applications and servers. In short, by excluding relative CGI's choice of fastcgi, multithreaded technology makes the Web server API unsuitable for almost all applications. In that argument the performance winner is obviously fastcgi. 7. Summary
How fast fastcgi is. The answer is: really very fast. Not because it has some specifically accelerated (specially-greased) paths through the operating system, but because its design adapts well to the needs of most applications. We invite you to use fastcgi as a fast, open foundation for your Web server application.