Gentoo Archives: gentoo-user

From: Alan McKinnon <alan.mckinnon@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] {OT} RAM & apache MaxClients (rock & a hard place)
Date: Wed, 06 Mar 2013 21:32:30
Message-Id: 5137B560.9050408@gmail.com
In Reply to: Re: [gentoo-user] {OT} RAM & apache MaxClients (rock & a hard place) by Michael Mol
1 On 06/03/2013 23:22, Michael Mol wrote:
2 > On 03/06/2013 04:07 PM, Alan McKinnon wrote:
3 >> On 06/03/2013 22:59, Michael Mol wrote:
4 >>> On 03/06/2013 03:54 PM, Grant wrote:
5 >>>> I lowered my MaxClients setting in apache a long time ago after
6 >>>> running out of memory a couple times. I recently optimized my
7 >>>> website's code and sped the site way up, and now I find myself
8 >>>> periodically up against MaxClients. Is a RAM upgrade the only
9 >>>> practical way to solve this sort of problem?
10 >>>
11 >>> Use a reverse proxy in caching mode.
12 >>>
13 >>> A request served up by the proxy server is a request not served up by
14 >>> Apache.
15 >>>
16 >>> Squid, nginx and varnish are all decent for the purpose, though squid
17 >>> and nginx are probably the more polished than varnish.
18 >>>
19 >>
20 >> Grant,
21 >>
22 >> If you optimized the site well, I would imagine your RAM needs per page
23 >> request would go down and you could possibly increase MaxClients again.
24 >> Have you given it a try since the optimization? Increase it slowly bit
25 >> by bit comparing the current performance with what it used to be, and
26 >> make your judgement call.
27 >>
28 >> Is there some reason why you can't just add more memory to the server?
29 >> It's a fast and very cheap and very effective performance booster with
30 >> very little downtime. But if your slots are full and you need new
31 >> hardware, that's a different story.
32 >>
33 >> Michael's proxy suggestion is excellent too - I use nginx for this a
34 >> lot. It's amazingly easy to set up, a complete breath of fresh air after
35 >> the gigantic do-all beast that is apache. Performance depends a lot on
36 >> what your sites actually do, if every page is dynamic with changing
37 >> content then a reverse proxy doesn't help much. Only you know what your
38 >> page content is like.
39 >
40 > The thing to remember is that clients request a *lot* of static content,
41 > too. CSS styles, small images, large images...these cache very well, and
42 > (IME) represent the bulk of the request numbers.
43
44 <bang head>
45 Yes, of course. You are perfectly correct, I forget all about that
46 "invisible" stuff in the background
47 </bang head>
48
49
50
51 >
52 > Unfortunately, with the way mod_php and friends work with Apache,
53 > resources consumed by static file requests aren't trivial once you
54 > realize that the big problem is with the number of concurrent
55 > requests...so it's best if those can be snapped up by something else, first.
56 >
57 > I've been running squid in front of my server for a few years. I've been
58 > eyeing CloudFlare, though; they're a CDN that behaves like a reverse
59 > proxy. You point their system at your server, your DNS at their system,
60 > and they'll do the heavy lifting for you. (And far better than having
61 > your own singular caching server would. I've worked at a CDN, and what
62 > they accomplish is pretty slick.)
63 >
64 >
65 >
66
67
68 --
69 Alan McKinnon
70 alan.mckinnon@×××××.com

Replies

Subject Author
Re: [gentoo-user] {OT} RAM & apache MaxClients (rock & a hard place) Florian Philipp <lists@×××××××××××.net>