From mnordhoff at mattnordhoff.com Wed Apr 26 04:18:57 2006 From: mnordhoff at mattnordhoff.com (Matt Nordhoff) Date: Wed Apr 26 03:19:57 2006 Subject: [Fasterfox] Prefetching isn't the only problem for webmasters - pipelining is evil too In-Reply-To: References: Message-ID: <444F1EE1.9030702@mattnordhoff.com> On 02/06/06 20:00, Story Monitor wrote: > I'm sure you've had endless complaints from webmasters about the problems > prefetching causes for webservers. I've had to block it completely on my > site - assuming you can use the file extension to detect what is and what > isn't dynamic content is not reliable, and in some extreme cases it was > downloading 500 php pages from my site per real user hit. However, at least > you provide a way for us to disable this feature from the server. > > The second major problem your extension causes I cannot see a way for > webmasters to mitigate: Allowing / encouraging unrestricted pipelining is > going to cause denial of service issues if several people use this extension > on a site. > > Apache has a server variable MaxClients which limits the maximum number of > simultaneous connections the server can support. Webmasters cannot set this > too high especially if the site serves database-driven dynamic content, > otherwise Apache could easily consume all the resources on the machine. The > default is 256 and it is impossible to increase this without editing the > source code and recompiling Apache. However, you can and people often do > reduce if via the httpd.conf configuration file. On my site I've reduced it > to 100 as the site is highly database dependent. > > Like most webmasters, in order to provide good performance to visitors, I > have keep-alives enabled on the server, in my case with a 7 second timeout, > but the default is 15. However, your extension allows users to set > ridiculously high levels of pipelining. Unless I'm not reading your > documentation correctly, this means if anyone using this extension hits a > page with 40 images, and they have their pipelining set to 40 or more, > FireFox will make 40 connections to the server, consuming 25% of the > available connection capacity. It will then after receiving those images > continue to hold those 40 connections open for the default 15 second > keep-alive period. By allowing users (who for the most part assume higher = > better even if the documentation says otherwise) to make such changes you > will force webmasters to disable keep-alives in order to keep their sites > running, which has an overall negative impact on the server performance. > There was a good reason why Microsoft hardcoded IE to 2 simultaneous > requests rather than making it a registry setting that could be tweaked. > > With your default setting of 8 piplined requests, all it will take is 32 > visitors to completely fill all slots on a standard Apache server and > provide a denial of service whilst the server sits idle for the keep-alive > period, unless there is something your not mentioning in the documentation > about the way pipeling works with keep-alive requests? At a minimum you > should set an upper limit on how high users can set the pipeling. You should > also disable sending keep-alive headers on any additional connections after > the first if you don't already do this. If you have already catered for > this, you should mention it somewhere on the FAQ. > > If anyone knows of a way to limit the maximum connections per IP address in > apache, please reply. 1.) Gecko (Firefox's rendering engine) treats any pipelining setting higher than 8 as 8. 2.) I don't believe pipelining uses multiple connections. It's a Good Thing. Read W3C's page about it [1]. 3.) (BTW: Regular old prefetching [2] is not bad, as it's opt-in by the website. It's Fasterfox's insane "prefetch everything in the universe" that's bad.) [1] [2] -- Matt Nordhoff