MyBB Community Forums

Full Version: Domain Sharding-Good idea?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
So I'm in a hurry and won't be able to explain it fully, but domain sharding is basically moving all your static content such as images to a subdomain and having the browser load it from there, which will supposedly boost performance.
Has anyone done this and how much of a performance boost has it given you?
I've done it in the past with previous sites. It looks like I do it on my current site, but I'm using a CDN there to similar effect.

It helps as it reduces the size of packets that are sent as cookies won't be attached to the files (so long as you have cookies configured correctly) and it spreads HTTP requests out so a few can run in parallel (as far as I understand anyway - I could be talking rubbish here).
(2011-05-16, 06:18 PM)euantor Wrote: [ -> ]I've done it in the past with previous sites. It looks like I do it on my current site, but I'm using a CDN there to similar effect.

It helps as it reduces the size of packets that are sent as cookies won't be attached to the files (so long as you have cookies configured correctly) and it spreads HTTP requests out so a few can run in parallel (as far as I understand anyway - I could be talking rubbish here).

You've got it Smile
So would using CloudFlare generate the same effect or will moving the images to a subdomain provide more of a boost?
I don't see the point in this. It might shave 0.001 second off the load times or even increase the load times because the web server has to access all of its configurations twice (once for the main site VHOST and once for the subdomain VHOST) but it's still putting the exact same strain on the server CPU/RAM/Disk/Network.

The only way I can see this working is if you have the subdomain on multiple servers with load balancing and all content completely cached (which can be done on the dedicated server also so this shaves off maybe 0.003 seconds).

There are many, much more cost effective ways of speeding up a website. CDN is great if you're running Twitter, Facebook, or Wikipedia. If you're running a website that is not receiving enough traffic to even peak your 100Mbps port then you probably don't need to setup a CDN.
(2011-05-16, 09:04 PM)KuJoe Wrote: [ -> ]I don't see the point in this. It might shave 0.001 second off the load times or even increase the load times because the web server has to access all of its configurations twice (once for the main site VHOST and once for the subdomain VHOST) but it's still putting the exact same strain on the server CPU/RAM/Disk/Network.

The only way I can see this working is if you have the subdomain on multiple servers with load balancing and all content completely cached (which can be done on the dedicated server also so this shaves off maybe 0.003 seconds).

There are many, much more cost effective ways of speeding up a website. CDN is great if you're running Twitter, Facebook, or Wikipedia. If you're running a website that is not receiving enough traffic to even peak your 100Mbps port then you probably don't need to setup a CDN.

I see your point, but I'm not looking to speed up the server, I'm looking to speed up loading time for the user. According to GTmetrix I could speed it up a bit by loading the images off of a subdomain: http://gtmetrix.com/reports/enigmachs.com/74pZJNIl (see Parallelize downloads across hostnames)
Right now I'm waiting for some credentials before I set up CloudFlare on my server.
Yes you can decrease the load times, but it will be such a small amount, your users might not even notice Confused
(2011-05-16, 10:25 PM)Tom K. Wrote: [ -> ]Yes you can decrease the load times, but it will be such a small amount, your users might not even notice Confused

What about first-time loads where the user hasn't visited the site before or the cache has been cleared?
How fast does your site load now? How fast are you aiming for? A fresh install of MyBB loads in about 2 seconds on a cheap shared hosting server (0.7 seconds on revisit).
In the Big Board Owners section we have an ongoing thread on installing a Nginx web server to server static content only. It runs in parallel to Apache on a different port.

A few of us have done it with acceptable improvements so far. I am however, not sure it was worth the effort.

If you want to do it right, there are several core files changes, several theme changes, usergroups modifications, CSS changes, and a some template changes. Its a decent amount of work to reconfigure MyBB to treat static content differently than dynamic stuff. Not including getting Nginx configured for your system.
plus, what i described above does not even deal with file uploads, it assumes that the two webservers have the same root location on the same box. That way avatar and attachments are uploaded correctly from main server and are then served from the second static content server.

so unless you are going to recode the avatar and attachment upload code to make use of the CDN or other system, you are loosing the benefit of putting those large files off-site.
(2011-05-17, 12:11 AM)KuJoe Wrote: [ -> ]How fast does your site load now? How fast are you aiming for? A fresh install of MyBB loads in about 2 seconds on a cheap shared hosting server (0.7 seconds on revisit).
http://gtmetrix.com/reports/enigmachs.com/p0meEhYV
Loads pretty fast.
(2011-05-17, 12:27 AM)pavemen Wrote: [ -> ]In the Big Board Owners section we have an ongoing thread on installing a Nginx web server to server static content only. It runs in parallel to Apache on a different port.

A few of us have done it with acceptable improvements so far. I am however, not sure it was worth the effort.

If you want to do it right, there are several core files changes, several theme changes, usergroups modifications, CSS changes, and a some template changes. Its a decent amount of work to reconfigure MyBB to treat static content differently than dynamic stuff. Not including getting Nginx configured for your system.
plus, what i described above does not even deal with file uploads, it assumes that the two webservers have the same root location on the same box. That way avatar and attachments are uploaded correctly from main server and are then served from the second static content server.

so unless you are going to recode the avatar and attachment upload code to make use of the CDN or other system, you are loosing the benefit of putting those large files off-site.

It's not a static content server I'm creating, it's just a subdomain, and it will require a lot of template and CSS changes, but it will supposedly make the site load faster.

I might not put all my images on said subdomain, mainly only the large ones and images like the icons I use on the index.
Pages: 1 2