Jump to content

Web Server Recommendations


Recommended Posts

Posted

I would like to get some information on how some IPB users set up their web servers.

My server's specs are:
2.4ghz quad core xeon
4GB of ram
dual 250GB SATAs
FreeBSD 7.2 (32-bit)

My web server is setup like this:
nginx 0.8.3
PHP 5.2.9 (FastCGI using spawn-fcgi 1.6.2)
APC Cache 3.0.19
Memcached
Sphinx

My issue isn't really with IPB itself, but there are many people who run large web servers here so I hope I can get some advice.

Testing my web server, I hit it with quite a large amount of requests, and when I hit IPB it maxes the CPU out very easily. On average I will hit it with around 300 requests/second, and it will only respond to about ~260 of them, and after this the CPU completely maxes out. Now I imagine that php cannot handle all these requests, and is queueing them all up.

So I have come to the conclusion that I need more php-cgi processes. (I started with 16, moved upto 30), and I have read that some people need 200 (wow!) so I set that. But then the php processes completely lock up in a 'lockf' state.


So I am having some trouble figuring out a good way to configure my web server where it is able to handle the load. I have read that a good solution is to use apache w/ mod_php in the backend, with nginx up front. Does anyone use a setup like this?

I used to run a web server that received quite a lot of visitors, I'm talking about 6,000 unique visitors per day (that may not be large in your eyes, but it's big in mine:]), and I used similar php scripts, IPB setup exactly the same (with a much larger db), and the exact same software setup (minus memcached and sphinx) and I cannot remember the CPU Usage ever going above 10%. Now its hardware was dual quad core clovertowns with 4gb ram, and dual 15k RPM SAS drives.

So beyond all my rambling, am I configuring everything wrong, or am I expecting too much out of my setup. (Please if you can recommend me any alternatives you find good, such as using apache to serve the php

Posted

After running apachebench (on the same machine sadly) my forums return Requests per second: 143.73 [#/sec] (mean). How does this look, my main site gets Requests per second: 1441.77 [#/sec] (mean). So I'm not exactly sure if 143.73 req/s is good.. I've also noticed that the ibf_sessions table gets locked very often during the benchmarking, it is currently using the memory engine, and I even tried innodb to see if it helped, but it did not.

Posted

Give us specs how many posts do you have, how many concurrent visitors. And your database how many QPS does it have? You can check that via mysql s.
Nginx should handle load much better than apache, I know because I use similar web server and speed is not even comparable.
Your sessions should be set to "memory" storage engine instead of "innodb".

I don't have such large board, around 100k 1.3k unique visitors but that board takes almost nothing resources. My specs are same as your server, I only have SAS disks instead of SATA
MySQL QPS ~180

Posted

Right now I have 15,000 posts, my average QPS is 6 (it jumps up to ~60 when I benchmark the forums). I'd say that I probably have around 20 concurrent visitors right now. But on my former site I would have at least 250 concurrent visitors (with peaks of sometimes 500 upto 1,000 visitors, also during this time I'd have another 1,000+ visting my main site) on my forums and it wouldn't experience such high loads. Just to reiterate the load really only gets high when I benchmark it (and it's all php-cgi that is using CPU). But I am afraid that when my website gets as large as it was that it's going to create problems and I would like to find the bottleneck before it becomes a large problem.

I've been doing some testing and reading and noticed that IPB uses quite a large amount of require_once() calls, which cannot be optimized out by an opcode cacher like require() can be. So it would be going to the disks more often to grab these files. Could having 7200 rpm SATA drives make a huge difference in load compared to 15000 rpm SA-SCSI drives?

Posted

First rule is that you do not buy hardware for future, but for now. Later on, when load is high you just upgrade to new server.

Try to benchmark with APC disabled and see if that helps. With this amount of ram you shouldn't even hit hard those hard drives, so SAS drives wouldn't make any difference.

Please while testing paste me top info and do free -m so I can see how much memory you got free. Maybe web server or mysql is miss configured so they are taking all your available physical memory and your server starts to swap.

Like I wrote with same box I server in total 75K unique visitors and my average QPS is 180. Under heavy load My QPS goes to 400-500 area without any slowdowns.

Also try to disable Memcached and Sphinx and see how your server performs, it is never good idea to install so many things, it is hard to find blame of your high loads which your box should handle without any problem. Nginx is also much faster than Apache so your load should be minimal.

Posted

You don't happen to have Zend running as well, do you?

Because if so, APC has known problems with it. The two just don't play well together.


(And on the off-chance you're running APC just to get a progress bar in downloads, PECL:UploadProgress went stable recently. I'd use that instead. I installed it, though 3.0 won't use it. But 2.3.6 does, and very well.)

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...