News for hackers. Stuff that matters.
Re:Ask HN: Re-architecting on Slicehost to handle 50+ apache... by jrockway on Thursday April 02, 2009 @01:47PM (#543713)
I assume you need this many Apaches to fully use all of your CPU?

If so, there are a number of approaches to take. If your app is blocking on sending/receiving data to/from the client, it would benefit you to segregate the actual app servers from the frontend servers. You can use mod_fastcgi and run your PHP stuff in FastCGI, or you can use a frontend threaded apache talking to a backend PHP apache via mod_proxy.

If you are blocking on things like database access or other non-web IO, then you need an event loop so your app can do something else while waiting for IO. I don't know what your options are in the PHP world, but this is very easy to do in Perl.

Finally, real threads will probably also solve your problem. I recommend CL or Haskell. (Although I think Slicehost still uses an ancient Xen that can't handle SBCL. Oops.)

Re:Ask HN: Re-architecting on Slicehost to handle 50+ apache... by mandric on Thursday April 02, 2009 @02:25PM (#543801)
Ooh. I didn't think of having two apache configurations on the same server ... one that does media serving and is streamlined and one that does mod_php. I would prefer this over nginx. At least have the sanity of staying in one world. Thanks for that tip.

So I run multiple sites on this server and plan to keep adding more, so that's another reason configuration maintenance is an issue. Not to mention one day I plan to write a web gui to handle all this configuration ... and I don't need nginx's super-duper performance. I need a stable piece of software to configure, apache does everything, I've been using it for years, know all the ins and outs, and memory is cheap. Just mod_php is the bear and you add drupal to that and you have a beast.

I don't know what the bottleneck is really, that is part of the problem. But I know that every now and then when we we get bursts of traffic I can find with a /server-status that 50 apache processing are in a write state.

Re:Ask HN: Re-architecting on Slicehost to handle 50+ apache... by mandric on Thursday April 02, 2009 @02:34PM (#543816)
I also could live with having another slice just doing media serving. If I could share the filesystem or run some rsync script, in some efficient/non-cumbersome manner, between the media server (threaded apache) and app server (main box with php etc) that could work and would allow more parallelism, as they say, for faster web pages.

Then again you have the same problem with things like drupal, that just plop media all over the place and it's up to the client to maintain the separation of media in their code. Drupal users don't do that.

Re:Ask HN: Re-architecting on Slicehost to handle 50+ apache... by blender on Thursday April 02, 2009 @02:44PM (#543836)
"I don't know what the bottleneck is really, that is part of the problem. But I know that every now and then when we we get bursts of traffic I can find with a /server-status that 50 apache processing are in a write state."

I think you do know what the problem is ;-)

What is your PHP Error handling and logging set to? How big are your Apache access_log and error_log files?

Cheers

Re:Ask HN: Re-architecting on Slicehost to handle 50+ apache... by ken on Thursday April 02, 2009 @05:21PM (#544090)
Not that it will help the original poster here any, but I've been running a site on Slicehost using SBCL since last November or so.
Re:Ask HN: Re-architecting on Slicehost to handle 50+ apache... by jrockway on Friday April 03, 2009 @07:12AM (#544761)
Interesting. SBCL immediately kills my slice.