FastCGI maxrequest,maxspare,minspare,maxchildren使用什么值? [英] What values to use for FastCGI maxrequests, maxspare, minspare, maxchildren?

查看:85
本文介绍了FastCGI maxrequest,maxspare,minspare,maxchildren使用什么值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用FastCGI和lighttpd运行Django应用。

I'm running a Django app using FastCGI and lighttpd.

有人可以解释我在决定对maxrequest,maxspare,minspare使用什么值时应该考虑的问题吗? ,maxchildren?

Can somebody explain me what I should consider when deciding what value to use for maxrequests, maxspare, minspare, maxchildren?

这些选项虽然没有得到很好的记录,但似乎很重要。

These options are not too well documented, but seem quite important.

不仅仅是告诉我他们做什么?我想了解它们有什么蕴涵,以及如何决定要使用的值。

Don't just tell me what they do; I want to understand what implications they have and how I should decide on what values to use.

谢谢。

推荐答案

让我们从定义开始吧


    maxrequests: How many requests does a child server before being killed 
                 and a new one forked
    maxspare   : Maximum number of spare processes to keep running
    minspare   : Minimum number of spare processes to prefork
    maxchildren: Hard limit number of processes in prefork mode

这意味着您最多可以在任意位置运行 maxchildren 个进程给定时间在您的网络服务器中,每个服务器都运行 maxrequests 请求。在服务器启动时,您将获得 minspare 进程,如果有更多请求到来,该进程将持续增长,直到 maxspare (或 maxchildren )。

This means that you'll have at most maxchildren processes running at any given time in your webserver, each running for maxrequests requests. At server start you'll get minspare processes, which will keep growing until maxspare (or maxchildren) if more requests are coming.

因此, minspare 可以让您说您希望至少有多少个并发请求(如果从一个开始,重要的是避免创建流程,这很好(例如10)开始,而 maxspare 则让您说出您的服务器最多要处理多少个并发请求(而不会影响预期的响应时间,等等。需要进行压力测试以进行验证)。 maxrequests 讨论的是每个孩子的寿命,以防万一由于某种约束他们无法永远奔跑。

So, minspare lets you say how many concurrent requests are you expecting at a minimum (important to avoid the process creation if you start with one, it's good to start at, say 10), and maxspare lets you say how many concurrent requests will your server attend to at most (without compromising it's expected response time and so on. Needs a stress test to validate). And maxrequests is talking about the lifetime of each child, in case they cannot run forever due to any kind of constraint.

这篇关于FastCGI maxrequest,maxspare,minspare,maxchildren使用什么值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆