Project

General

Profile

Actions

Feature #2205

closed

set server.max-keep-alive-requests = 100

Added by Olaf-van-der-Spek almost 14 years ago. Updated almost 7 years ago.

Status:
Fixed
Priority:
Normal
Category:
core
Target version:
ASK QUESTIONS IN Forums:

Description

http://redmine.lighttpd.net/projects/lighttpd/wiki/Server.max-keep-alive-requestsDetails

Why is the default so low? Could this default be increased?

Actions #1

Updated by stbuehler over 13 years ago

  • Target version changed from 1.4.28 to 1.4.29
Actions #2

Updated by nitrox over 13 years ago

  • Status changed from New to Need Feedback
Actions #3

Updated by nitrox over 13 years ago

Its a variable, so you can set whatever you like and adapt to your needs, other httpd´s set even way lower defaults. Any reasonable facts why this should be changed?

Actions #4

Updated by Olaf-van-der-Spek over 13 years ago

Apache has 100: http://httpd.apache.org/docs/2.2/mod/core.html#maxkeepaliverequests
If you think sensible defaults aren't good for Lighttpd, don't change it. ;)

Actions #6

Updated by lifeofguenter over 13 years ago

it would be great if things don't get changed "just because others do it too", but maybe in a more empirical way. Keep in mind: http://redmine.lighttpd.net/wiki/lighttpd/Docs:Performance#HTTP-Keep-Alive - and nobody told Apache's default settings was good/state-of-the-art

Actions #7

Updated by Olaf-van-der-Spek over 13 years ago

lifeofguenter wrote:

it would be great if things don't get changed "just because others do it too", but maybe in a more empirical way. Keep in mind:

I didn't request it because others do it, but Nitrox brought up Apache as an (invalid) example.

http://redmine.lighttpd.net/wiki/lighttpd/Docs:Performance#HTTP-Keep-Alive - and nobody told Apache's default settings was good/state-of-the-art

I have.

Actions #8

Updated by kayohamid over 13 years ago

Now that all work is to 2.0 version of lighty, I think that we can test if it's better 100 or 16, right? Just set it to 100 and see what happens.

Yes, I know, 1.4.x still is the major release, but they is stable already, we can test it.

Actions #9

Updated by stbuehler about 13 years ago

  • Status changed from Need Feedback to Missing Feedback
  • Target version deleted (1.4.29)

No good reason provided to change it - just set it yourself.

And remember: the optimum is very likely to depend on your own setup, there is no generic "best" value.
16 should be enough so that resources for one page can be loaded without reconnecting (if your site needs more files, fix it :D - or change the value)

Actions #10

Updated by Olaf-van-der-Spek about 13 years ago

stbuehler wrote:

And remember: the optimum is very likely to depend on your own setup, there is no generic "best" value.

What's the disadvantage of a higher value?
More fds needed? That's easily solved by a higher max fd limit.

Actions #11

Updated by Olaf-van-der-Spek about 13 years ago

  • Status changed from Missing Feedback to Reopened
  • Target version set to 1.4.x
Actions #12

Updated by gstrauss about 8 years ago

  • Status changed from Reopened to Missing Feedback

server.max-keep-alive-requests = 16 is the default, but is easily configurable.

There is no reason to change this setting until empirical evidence is presented that there is both a benefit to doing so, and that the typical use case would benefit. Hence, this ticket is being withdrawn "Missing Feedback" and will be withdrawn with the same status if this ticket is reopened without providing empirical data supporting the request. Again, this setting is easily configurable, so this is not a bug and is not broken.

Looking in Apache source control, the DEFAULT_KEEPALIVE 100 setting in include/httpd.h was inherited into the Apache 2.0 branch from Apache 1.3.9 back in 1999. Looking back further into the history of the Apache 1.3 branch, DEFAULT_KEEPALIVE was changed from 5 to 100 back in 1997, in Apache 1.2b5 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x@77500 13f79535-47bb-0310-9956-ffa450edef68

For benchmarks using keep-alive, a higher setting will perform better. On the other hand, for better resource sharing on a busy site which is at or near max-connections, server.max-keep-alive-requests with a lower value is potentially fairer. The current value of 16 in lighttpd strikes a balance between allowing the usefulness of keep-alive and at the same time allowing other clients a chance to connect to a busy site serving peak max-connections.

Actions #13

Updated by stbuehler almost 8 years ago

  • Target version deleted (1.4.x)
Actions #14

Updated by gstrauss almost 7 years ago

  • Subject changed from server.max-keep-alive-requests = 16 to set server.max-keep-alive-requests = 100
  • Status changed from Missing Feedback to Patch Pending
  • Target version set to 1.4.46

In 2014, the average number of objects per page on the top 1000 websites exceeded 100 objects per page.
http://www.websiteoptimization.com/speed/tweak/average-web-page/
http://www.yottaa.com/a-brief-history-of-web-page-size/

https://www.sitepoint.com/average-page-weight-increased-another-16-2015/

The HTTP Archive Report, which collates technical information from half a million of the web’s most popular websites
...
101 HTTP file requests are made — up from 95 a year ago

http://httparchive.org/interesting.php
Total Requests Per Page chart shows median website has 75-100 requests per page, and fewer than 12% of sites have <= 25 requests per page

https://www.thinkwithgoogle.com/articles/mobile-page-speed-new-industry-benchmarks.html
(see slideshow near bottom of article)

.

Given the above, the rise of mobile (where latency is more detrimental), the rise in HTTPS (where latency is more detrimental to setting up new connections due to increased round-trips), I am going to increase the default server.max-keep-alive-requests to 100, the same as is done in Apache and nginx. Even with caching and CDNs, many websites running lighttpd (and not setting server.max-keep-alive-request) will benefit from a large default.

This value is of course still configurable, and admins who find different settings are better for them should use those settings.

Actions #15

Updated by gstrauss almost 7 years ago

  • Status changed from Patch Pending to Fixed
  • % Done changed from 0 to 100
Actions

Also available in: Atom