gpt4 book ai didi

perl - 为什么 FastCGI 快?

转载 作者:行者123 更新时间:2023-12-04 13:07:33 27 4
gpt4 key购买 nike

很难说出这里问的是什么。这个问题模棱两可、含糊不清、不完整、过于宽泛或言辞激烈,无法以目前的形式合理回答。如需帮助澄清此问题以便可以重新打开,visit the help center .




10年前关闭。




FastCGI provides a way to improve the performance of the thousands of Perl applications that have been written for the Web. -Source



它是如何做到的?

最佳答案

Mark R. Brown 的 whitepaper on the subject声称 FastCGI 的主要好处之一是不同的请求可以共享一个缓存,使缓存变得实用:

Today's most widely deployed Web server APIs are based on a pool-of-processes server model. The Web server consists of a parent process and a pool of child processes. Processes do not share memory. An incoming request is assigned to an idle child at random. The child runs the request to completion before accepting a new request. A typical server has 32 child processes, a large server has 100 or 200.

In-memory caching works very poorly in this server model because processes do not share memory and incoming requests are assigned to processes at random. For instance, to keep a frequently-used file available in memory the server must keep a file copy per child, which wastes memory. When the file is modified all the children need to be notified, which is complex (the APIs don't provide a way to do it).

FastCGI is designed to allow effective in-memory caching. Requests are routed from any child process to a FastCGI application server. The FastCGI application process maintains an in-memory cache.

关于perl - 为什么 FastCGI 快?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6539655/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com