Web Hosting Talk







View Full Version : [Please Help!] Expert Opinion Needed - Which scenario is more resource heavy?


Rich
12-10-2007, 11:53 PM
Hi Everyone,

I am going to describe two scenarios, I need to know which one is better and why, preferrably with a really good explanation.

Let's argue that we're running 600 php/MySQL CMS websites that are entirely database driven. We'll say phpNuke for the sake of this scenario. Most of them are essentially the same anyway.

Now for the scenarios.

Scenario A
You have 600 accounts setup in WHM, each is hosting it's own seperate Nuke installation with a seperate database and seperate set of PHP files.

Scenario B
You have 600 accounts setup in WHM, each has simply index.php and no other php files. Each site has it's own seperate database, but only only index.php which contains the mysql connection info for the sites database, as well as code that connections to the servers RAM disk where the phpNuke files are stored. In this scenario, you are essentially running all 600 sites off one set of phpNuke files from the RAM disk, thereby eliminating redundency in duplicate files.


My thinking: Over the course of maybe 1000, 5000, or 10,000 sites the upwards scalability of the method in Scenario B, hypothetically, seems to really increase because you save on storage space but more importantly seek time and processing power. Because there is little to no seeking, there are less resources used for the CPU/MEM and you should be able to host a lot more sites on the same server.

Which scenario actually is better? In addition to answering my question, can you think of a better solution for efficiently hosting 600 seperate sites off the same files with the same database? Also note that we mention the use of RAM Disk in an effort to both a) reduce seek time and b) make the files accessible to all domains, whereas openbasedir and phpsuexec would have previously made it impossible through standards fread() functionality.

I really appreciate any input you guys can provide. Thanks in advance.

latheesan
12-11-2007, 12:29 AM
You can have 1000 instalation of Nuke or have one central instalation and have 1000 virtual instalation of it. It doesnt really matter. Only resource you might be saving is disk space. Other than that, it doesnt really make any difference at all.

foobic
12-11-2007, 01:26 AM
Just for convenience (software updates) and avoiding wasted disk space scenario B has to be preferred. On a regular file system I think those may be the only advantages but using a ram disk should also give you some performance benefit, although perhaps not as much as you're expecting - a lot of the work will be going on in the database anyway. Also remember that most CMSs work better when they can cache to file, so you might try to give each account some space of its own on the shared disk.

Hard work to set up but with a huge number of accounts probably worth it.

holmesa
12-14-2007, 06:56 PM
With the scenario B, if something goes wrong - all your website will be down. And you will not be able to split them easily if you need to go another server.

Even if scenario B may be a little better from the performance view, you may loose much more time and money on managing this thing.

mwaseem
12-15-2007, 01:54 AM
Scenario B seems preferable as you'll only have to spend all your efforts to just 1 centrally managed database and have it tuned up for better performance. Schedule a regular backup of the DB.