Gentoo Archives: gentoo-user

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

Attachments

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