Optimizing a Drupal website by splitting it up into multi-sites
Hi,
I have a general discussion topic about optimizing a Drupal website. This website is complex with a number of different sections each relatively independent of the other and each using half a dozen modules that the others do not use. This site is growing organically according to unfolding requirements of the client and is not being created from a detailed spec, but more and more modules are being added all the time. It seems that the more modules I add the slower it gets and the greater the propensity for errors.
Given that the Drupal hook system tests each occurrence of a hook that is present, my php instincts tell me that if I break my site up into subdomains: section1.mysite.com, section2.mysite.com, section2.mysite.com etc all sharing the same database, and make sure that only the modules that are needed are activated in each subdomain, then my site overall will perform much better. There would also of course be other benefits from doing this: 1. less css and other resources would be required in each subdomain (I recently found ubercart css interfering with other modules and breaking the theme entirely on some pages).
2. not all contrib modules are created equal and some drag the system. I would be able to reduce that influence to only the sections they apply to
Is there a decided benefit from this? Has anyone else tried this? Has this discussion been had elsewhere?
Having asked these questions I have almost decided that I will do it.
Later:
It appears that this is not a task that has been attempted before, so I've implemented it and written a module to go with it. More info can be found on this thread: http://drupal.org/node/147828#comment-1550058. And a working module can be found here: http://webdev.passingphase.co.nz/?q=project/site-splitter

After some Drupal searches I
After some Drupal searches I found a Drupal group that specializes in site optimization, and after reading threads such as: http://groups.drupal.org/node/21454 we installed eAccelerator on the server and got a 100% speed boost. So that keeps us happy for now :)
Splitting into multi-sites seems too much hard work.
Passing Phase Web Development
Despite the work involved,
Despite the work involved, preliminary tests on site splitting indicate that performance can be improved by another 100%. Most site splitting solutions for Drupal do not appear to be done for performance reasons, but to link different and closely related sites. These are your standard multi-site installations where each site has mostly separate tables with only a few shared. I have attempted to share as many tables as possible and only split out the minimum necessary to get optimal performance boost.
Some stats:
Full site = 115 modules (including submodules eg groups, 2, notifications, 3.
Split Site
Main domain = 88 modules 50% faster
subdomain = 38 modules 100% faster
It appears that performance (speed) is directly linked to the number of modules activated.
The tables that I have shared are as follows:
menu
blocks
blocks_roles
boxes
all caches
variable
system
It is possible I may need to split out more tables, but I'm still testing.
Installing singlesignon synchronizes logins between the sites.
There are still issues to be solved regarding primary site-wide menu systems whereby they only need to be edited in one place and in which the correct subdomain is called. This can be solved by creating a module for each subdomain. More on that later.
Passing Phase Web Development
from your post, I think of a
from your post, I think of a basic question..using hooks or not using hooks?
in stead of using a sub-domain solution, u may just dis-able the hooking feature in drupal core (by hacking the drupal core), and add back individual "include function file" will be fine.
performance vs simplicity ....sound interesting.
We go the drupal way. How about you?
http://www.drupalway.com
Good point, but hooks are
Good point, but hooks are used everywhere, in contrib modules as well, including cck. Also to consider are the loading of css files. In this particular site I had a problem with ubercart css interfering with the theme on some form pages, breaking it completely. The only way I could remove it was to edit all the ubercart modules that loaded css on EVERY page. If I split the site I would not have these kinds of problems. If your site is using too many modules splitting provides a means of reducing the site to several smaller more efficient sites, providing that the site can be separated into several distinct areas (eg store, articles, job listings) each of which only use a subset of the total number of modules used on the site.
Anyway I have almost completed a module which enables management of a standard site-wide menu system for a site split into subdomains. Currently testing...
Passing Phase Web Development
Correction to this post,
Correction to this post, should read:
The tables that I have split out (ie not shared) are as follows:
menu
blocks
blocks_roles
boxes
all caches
variable
system
Passing Phase Web Development