Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject:
PostPosted: Fri Mar 18, 2011 11:40 am 
Offline
Junior Member
User avatar

Joined: Mon Mar 02, 2009 10:45 pm
Posts: 38
glg wrote:
The other route you can go with Apache is to replace mpm prefork/mod_php with mpm worker/fastcgi.

What are the pros/cons of that?


Top
   
 Post subject:
PostPosted: Fri Mar 18, 2011 2:10 pm 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
Apache doesn't have to load php for every requests including static requests, and mpm_worker is threaded so uses less ram.

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
 Post subject:
PostPosted: Fri Mar 18, 2011 2:35 pm 
Offline
Senior Member

Joined: Fri May 02, 2008 8:44 pm
Posts: 1121
I'd be very careful going the FastCGI route. Apache's PHP FastCGI implementation is a mess. It sorta works if you configure it just right, but the setup is complicated, inelegant, and nowhere near as robust as lighttpd or nginx. Remember, lighty rewrote the book on FastCGI for a good reason.

I got burned pretty bad by Apache/mpm_worker/fastcgi a while ago, and nowaways I prefer to give all my static files to nginx.


Top
   
 Post subject:
PostPosted: Fri Mar 18, 2011 4:58 pm 
Offline
Junior Member
User avatar

Joined: Mon Mar 02, 2009 10:45 pm
Posts: 38
I was able to get it down to about 40ms slower than Lighty with zip and a better wp-super-cache configuration (turns out it wasn't working properly cuz of permissions).

Apache Bench with 10000 connections and 10 concurrent gave a 40ms mean time lead to Lighty, but it's longest attempts were longer than any one attempt on Apache.

The big part seems to be the transfer rate. Lighttpd is transferring at 321 Kbytes/sec and Apache is transferring at 298 Kbytes/sec. Is this really a function of the web server? I would think the web servers would be so fast that transfer rate would be more capped by the link.

But they're both linodes in the same data center, so I would expect the transfer rate to be similar. Is that an incorrect assumption?

.


Top
   
 Post subject:
PostPosted: Sat Mar 19, 2011 3:47 pm 
Offline
Senior Member

Joined: Fri May 02, 2008 8:44 pm
Posts: 1121
Are you running ab from a linode in the same datacenter, or are you running it from home? Your last sentence is a little ambiguous, and 300KB/s sounds suspiciously similar to what you'd get with a crappy "high-speed internet" service in the US.

Also, are you requesting a static resource, such as an image file, or a dynamically generated page, such as the home page? If the request goes through PHP at all, the transfer rate will drop dramatically because of the latency imposed by the PHP interpreter. The transfer rate is meaningless when benchmarking PHP scripts. Requests per second is a better indicator of performance. (The longest attempt takes much longer probably because Apache with mpm_prefork puts extra requests on the waiting list until it's done with previous requests.)

I wouldn't worry too much about 40ms latency differences. What you need to look out for is memory consumption of the server while you're hammering it with lots of concurrent requests. Try upping the concurrency to 50 or even 100. Run htop on the server in a different terminal and keep an eye out for memory consumption. If there's something wrong with your Apache configuration, memory will go up dramatically and the server might grind to a halt. As long as that doesn't happen, you're fine.


Top
   
 Post subject:
PostPosted: Tue Mar 22, 2011 10:34 am 
Offline
Junior Member
User avatar

Joined: Mon Mar 02, 2009 10:45 pm
Posts: 38
I was running ab from home. I started doing so from the datacenter.

In the end, I just couldn't tune Apache to my liking. Rather than learning nginx for this particular server since I was on a deadline, I just stood Lighttpd back up. It outperforms Apache in pretty much every discernible way. I'm sure there must be some reason to use Apache over Lighttpd, but I have convinced myself that I can't see it (especially for my needs).

Thanks for all the help. I certainly learned a lot if nothing else.

Next up on my list is to figure out why my php5-cgi processes are all using so much processing power. Under a typical "heavy load" scenario for my site, they're using 200% processor power in aggregate. Seems excessive just for some PHP.


Top
   
 Post subject:
PostPosted: Tue Mar 22, 2011 11:52 am 
Offline
Senior Member
User avatar

Joined: Tue May 26, 2009 3:29 pm
Posts: 1691
Location: Montreal, QC
What sort of scripts, and what sort of traffic? A bytecode cache like APC can help reduce the CPU usage of PHP, since PHP recompiles scripts every time they're run.


Top
   
 Post subject:
PostPosted: Tue Mar 22, 2011 1:31 pm 
Offline
Junior Member
User avatar

Joined: Mon Mar 02, 2009 10:45 pm
Posts: 38
Guspaz wrote:
What sort of scripts, and what sort of traffic? A bytecode cache like APC can help reduce the CPU usage of PHP, since PHP recompiles scripts every time they're run.

I've got APC running. I'm running Wordpress, Piwigo and Vanilla 2. I suspect that Vanilla 2 is the main culprit but I have nothing to back that up. Just history of problems with forum software being typically more demanding. I've got wp-super-cache on wordpress, so I think that's about as efficient as it can be.

And overall, the site actually runs like a dream. Everything is served up super fast and I couldn't be happier with the performance. I just don't want to upset my neighbors by stealing their processing time.


Top
   
 Post subject:
PostPosted: Tue Mar 22, 2011 1:53 pm 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
You can't steal others processing time, everyone gets an even share and the ability to use unused cpu.

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
 Post subject:
PostPosted: Tue Mar 22, 2011 2:00 pm 
Offline
Junior Member
User avatar

Joined: Mon Mar 02, 2009 10:45 pm
Posts: 38
obs wrote:
You can't steal others processing time, everyone gets an even share and the ability to use unused cpu.

Well that's a relief. I guess I should then worry about not having any unused processing time to borrow and my server getting slow. So far that doesn't seem like it's going to be a problem, but still seems like I should put in my due diligence.


Top
   
 Post subject:
PostPosted: Tue Mar 22, 2011 3:25 pm 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
If you haven't already install something like munin, it allows you to track resource usage over days/weeks/months/years so you can see if it looks like you're bottlenecking some where if/when things slow down.

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group