Web Hosting Talk







View Full Version : how much can a server handle (load-sharing?)


ememex
09-23-2003, 04:27 PM
okay, i know there are some great tech-heads here so i'd like just a minute from you guys/gals...

i've been running a somewhat-popular website, gets roughly 100,000 pageviews a day. i use php as my web-scripting language, so all these pages would be in php for some simple dynamic scripting (ip-tracking, referrer tracking, picking up xml-feeds based on current page, etc...).

what i did to keep the site fast was to have one server generate all the pages and mysql (P-III 800, 192MB RAM, 20GB IDE, dialtone), and use another server for images and download files (music, zips, other stuff) (p4-2.4, 512MB RAM, 80GB IDE, RS). simple, but effective load sharing :)

now i will be changing the website structure to generate each page from a mysql database based on the url, as the website's structure is in directories (something like yahoo). so all requests will be pushed to a single page, which will generate the appropriate page. each page will generate approx 5 mysql queries, and i will have mysql4's cache enabled.

now i've got a great offer to move to a dual-PIII 800MHz box with 512MB RAM and 18GB SCSI at servermatrix, that will help me cut hosting costs by half. by the way, my server loads for the current two boxes never go above 0.2, apart from when wusage is compiling stats (weekends).

would it be wise to move to this single box? does anyone see any harm in making this move? the dual processor should be able to handle page requests and database queries without any problems, right?

i'd appreciate comments from all whtalkers!

fog
09-23-2003, 05:24 PM
Well as a disclaimer, I don't have experience with load balancing at all. However, if the single box is faster than the sum of the two previous boxes, it sounds like it'd be beneficial.

If you had to go with two boxes, what I'd recommend you did instead would be to have one box as a MySQL server, and one as a webserver -- ie, a page load comes into the webserver, which does the MySQL queries on another box, gets the results, and responds. (Of course, if your boxes are in different data centers, this might cause an enormous slowdown if it has to wait a few seconds to get a response. Ideally you'd want them on a switched LAN.)

However, if you're moving up to SCSI and to a machine more than twice as fast, it seems like it'd work out quite nicely. (EDIT: I just learned how to read, and noticed that the second box was a 2.4 GHz P4 -- so you'd get an overall slowdown. However, if the load averages sit around 0.2, it doesn't sound like you'd run into much of a problem.)

If you're not sure, and have a bit of money to spare, it might be well-worth your money to run both for a month, switching over to the new single box, but keeping the other two as a backup. If all goes well, you can cancel after a week or so, and if not, you can just revert back easily?

ememex
09-23-2003, 05:39 PM
thanks for your input fog!

the only reason i got the RS server was to push the bandwidth-intensive requests out of the way. i'd be more interested in seeing how many page requests (php+mysql) whtalkers can serve on their boxes.

since i have 5 days till my next hosting bill, i'll try out running them parallel for a couple of days and then booting the old servers if the new setup works ;)

racksense
09-24-2003, 06:42 AM
You have a number of aspects that have different resource requirements..

- dynamic content (Apache): primarily RAM for all the apache/PHP handlers
- MySQL: CPU and disk, to handle all the queries
- static content: bandwidth/traffic

So you want to make sure that Apache has enough RAM, that MySQL has enough CPU to serve the queries (and to a lesser extent fast disks, but I don't personally believe there is such a wide gap between IDE and SCSI nowadays) and lastly the static content which doesn't need much resource (perhaps have a look at thttpd for this) apart from the actual bandwidth.

I would guess a dual CPU box (with the right o/s) will help if you are serving the whole lot from one box.. as you won't have MySQL fighting for single CPU resource with the Apache handlers, etc.