On 15/10/12 06:58, David Gerard wrote:
On 14 October 2012 16:34, Platonides
<Platonides(a)gmail.com> wrote:
On 13/10/12 00:22, David Gerard wrote:
> Apache connections are really pretty damn
cheap these days. Is
> KeepAlive actually a good or bad thing for MediaWiki?
The apache docs say:
In some cases this has been shown to result in an
almost 50% speedup
in latency times for HTML documents with many images.
--
http://httpd.apache.org/docs/2.4/mod/core.html#KeepAlive
I'd keep it on, but with a small KeepAliveTimeout
Mmm. Say YMMV. In our case the constraint is memory (we're fine for
CPU and bandwidth), and our next Reddit-dotting not knocking us over
again. Here's a graph, guess when I switched off KeepAlive:
http://i49.tinypic.com/2jczzht.jpg
That's processes, not memory. I would think that the effect on memory
would not be so large. Disabling keep-alive should be counted as a
fairly desperate measure given the large impact on end user latencies.
I haven't ever had to run a high-traffic wiki apart from Wikipedia,
but if one of my little VPS wikis got slashdotted, I think the first
thing I would do is install Squid. Squid needs a tiny amount of memory
per connection, maybe 1KB. You can let Squid keep the client
connections open for a few minutes, but disable keepalive on Apache.
That way you minimise the number of memory-guzzling Apache processes
with minimal user impact. This is one of the reasons we use Squid at
Wikimedia.
I think it should be possible to run both Apache and Squid on a VPS
with a few hundred MB of RAM. Just have Squid on port 80 and Apache on
some private firewalled port. If you have any RAM left over, you can
allocate it to Squid for caching, and unless your site is enormous,
you can give it whatever disk cache it needs to serve the whole site
without ever contacting the backend.
The MW file cache might be fast, but Squid is always going to be faster.
-- Tim Starling