当使用 Paster Web 服务器时,它是否通过创建新线程来服务请求?

发布于 2024-09-18 03:58:53 字数 81 浏览 12 评论 0 原文

Paster 是否为每个请求创建一个新线程?

您可以设置 Paster 使用的最大线程数(即线程池)吗?如果这是可能的,你会怎样做?

Does paster create a new thread per request?

Can you set the maximum number of threads for paster to use i.e. a thread pool? How can you if this is possible?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

殤城〤 2024-09-25 03:58:53

根据文档paster支持不同的服务器选择,具体取决于配置- 包括wsgiutils,“开始支持twisted.web2 ...欢迎补丁”(这将是一个异步服务器),以及“SCGI,FastCGI和AJP协议,用于连接外部Web 服务器(如 Apache)到您的应用程序都可以使用线程版本和分支版本。”

例如,您可以通过专门处理 Apache 配置来配置 Apache 上的最大线程数(和/或分叉进程),并且完全独立于 Paster;显然,如果您选择了 flup/Apache/threaded 组合,那么这就是您想要做的。

在(大致)简单性/功能范围的另一个极端,我不相信 wsgiutils,开箱即用,可以配置为使用线程池(即,如果我没记错的话,围绕最小框架编写新的服务器类型需要 wsgiutil 提供的线程池来使用它)。

显然,如果您需要任何类型的高级配置选项,Apache 的强大功能和灵活性是无与伦比的:-)。

Per the docs, paster supports different server choices, depending on the configuration -- including wsgiutils, "the start of support for twisted.web2 ... patches welcome" (that would be an async server instad), and "SCGI, FastCGI and AJP protocols, for connection an external web server (like Apache) to your application. Both threaded and forking versions are available. This is based on flup."

You can configure maximum number of threads (and/or forked processes) on Apache, for example, and quite independently from paster, by working exclusively on the Apache configuration; clearly that is what you'll want to do if you've picked the flup/Apache/threaded combo.

At (roughly) the other extreme in the simplicity / functionality spectrum, I don't believe wsgiutils, out of the box, can be configured to use a thread pool (i.e., if I'm not mistaken, coding a new server kind around the minimal skeleton that wsgiutil provides would be needed to use a thread pool with it).

Clearly, if you need any kind of advanced configuration options, Apache's enormous power and flexibility are hard to beat:-).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文