Gentoo Archives: gentoo-user

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

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-user] {OT} RAM & apache MaxClients (rock & a hard place) Michael Mol <mikemol@×××××.com>