vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.7 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=228)
-   -   Board Optimization - Dynamically Linked Source - Speed Up Your Multiple Site Network & Upgrades (https://vborg.vbsupport.ru/showthread.php?t=188108)

Jafo232 08-13-2008 10:00 PM

Dynamically Linked Source - Speed Up Your Multiple Site Network & Upgrades
 
For the purposes of this documentation, "Network" refers to a group of forums on a single server or cluster of servers.

When 3.7.1 PL2 was released, I posted over at vbulletin.com lamenting the fact that I had 15 upgrades to perform and how it would be nice to have a multiple site license to lighten the burden of downloading each install separately. In the end, I spent much more time coming up with this system.

Dynamically Linked Source or DLS allows operators of two or more forums on the same server or cluster, for all intents and purposes, to use one set of source code instead of multiple sets. By using one set of source code, Op code caching is much more efficient as only one copy of the source is cached. This greatly reduces the amount of memory used caching the source code, and also makes it more efficient. It will lead to less fragmentation for systems using APC, XCache, eAccelerator, or other such methods of caching Op code.

The method uses symbolic links to a central repository of the source code. Therefore, upgrades to all sites on the network can be done quickly by just replacing the source. For patch level releases, this means the entire network can be patched with one upload. Upgrades to a new version can be done this way, or a new repository can be created and each site can be upgraded one at a time.

The issue of licensing has also been addressed. Once the product file is installed, and assuming the installation instructions were followed, each installation will report the proper license key when salting cookies, or reporting back to Jelsoft as Vbulletin does from time to time (mostly in the AdminCP).

I contacted the development team at Jelsoft and discussed this method before releasing it, and got the OK from Mike. I was initially concerned that it may break licensing or perhaps give away too much of the license reporting methodology, but now that I look back, it really does not do either.

In tests on a rather large network that contains seven forums with about 7 million posts, hundreds of thousands of registered users, and uses three load balanced servers the load has been reduced by almost 40%. You can see in the graph attached to this thread for the particulars.

I have tried to make the readme as clear as possible, but honestly that was never one of my strong points. I cannot emphasize more that before you implement this method, TEST it first in your sandbox. Also, make sure you backup your software and database before you use this.

I also have included a PDF that explains what is happening in greater detail.

Updates:

8/20/08 - This will work with the latest version of VBSEO (3.2.0 at this time). Add all the files to the DLS except the config file, and run the php-clone.php script.

This product was developed for Andy R from Social Knowledge and released here for others to enjoy.


Please don't forget to click install as I have worked quite a while on this. :)

Jafo232 08-14-2008 01:18 PM

Reserved...

Zacarias 08-14-2008 01:26 PM

This is very interesting. I'll be testing this one.

GrendelKhan{TSU 08-14-2008 02:19 PM

awesome. exactly what I need. will test. :D thank you!!


ps. er... how do I sandbox test this for multiple boards? do I ahve to set up a multi-board test as well? :(

nirvana43 08-14-2008 02:22 PM

Installed and rated! ;) thanks a million man.

Jafo232 08-14-2008 02:28 PM

Quote:

Originally Posted by GrendelKhan{TSU (Post 1598499)
awesome. exactly what I need. will test. :D thank you!!


ps. er... how do I sandbox test this for multiple boards? do I ahve to set up a multi-board test as well? :(

Well, you don't HAVE to setup multiple boards in the sandbox, but if you want to test how it works with multiple boards (which is the whole point) then yes. But if you want to see how it works, one will be enough. Once you get it working on one site, you should not have problems getting it to work on multiple sites.

Just remember, BACK UP EVERYTHING! The php-clone.php script DELETES your forum source code files and then replaces them with symbolic links. Should you configure it wrong, you could find yourself with no forum software. :) A quick backup of the source files will correct that quickly.

I also recommend backing up the database, not that this product/method does anything to the database, it is just for prudence sake...

AzzidReign 08-14-2008 03:37 PM

Wow, this is a great idea. I'm going to check this out once I get some free time.

Reeve of shinra 08-14-2008 03:49 PM

This looks great and its going to be a blessing for those running multiple forums. I assume each sites keeps its own DB? How are mods and plugins handled? I assume they are excluded?

Jafo232 08-14-2008 04:17 PM

Quote:

Originally Posted by Reeve of shinra (Post 1598571)
This looks great and its going to be a blessing for those running multiple forums. I assume each sites keeps its own DB? How are mods and plugins handled? I assume they are excluded?

Yes, each site still keeps its own DB, and mods/plugins are handled the same way as they always were or you can include them in the DLS and make them available to the entire network.

You can link any file just by adding it to the DLS source and running the php-clone.php script.

djr 08-14-2008 04:42 PM

*VERY* interesting and I love the out-of-the-box thinking. Truly impressed. Do you know whether this will impact vbSEO? Would it be possible to also include vbSEO in the DLS or isn't that necessary?

Jafo232 08-14-2008 04:49 PM

The sites we tested on were using VBSEO and VBACMPS with no affect. You just have to make sure that you have the latest version of VBSEO..

I will be working on including VBSEO into the DLS. Initial work on it has yet to be of any success..

djr 08-14-2008 04:53 PM

Quote:

Originally Posted by Jafo232 (Post 1598610)
The sites we tested on were using VBSEO and VBACMPS with no affect. You just have to make sure that you have the latest version of VBSEO..

I will be working on including VBSEO into the DLS. Initial work on it has yet to be of any success..

Thanks Jafo! Again, much much respect for this idea. Now off to discuss with my fellow webmaster :cool:

TheInsaneManiac 08-14-2008 05:20 PM

Wait does this mean I only need one VBulletin license for all my domains now or no?

briansol 08-14-2008 05:57 PM

not at all.. you still need your proper licenses.

Jafo232 08-14-2008 06:13 PM

Quote:

Originally Posted by TheInsaneManiac (Post 1598630)
Wait does this mean I only need one VBulletin license for all my domains now or no?

No, you still need all the license #'s. If you read the readme, you will see where you insert the license number(s) (NOT THE CUSTOMER #).

Jafo232 08-15-2008 01:14 AM

Hmm, I got a notification saying someone asked "any chance for memcached support?" but it isn't here. Well, the answer is, it does support memcached.

gigaenvy 08-15-2008 01:36 AM

This is a premium add-on. Great effort and taking things into your own hands as many of us do.

Reeve of shinra 08-15-2008 02:13 AM

Quote:

Originally Posted by Jafo232 (Post 1598875)
Hmm, I got a notification saying someone asked "any chance for memcached support?" but it isn't here. Well, the answer is, it does support memcached.

Off topic but yes, I hit 'new posts' saw a reply on 'page 2'. I clicked on page 1 in new window, read it, click on page 2 and it took me back to page 1. The post was probably deleted but I can't imagine why if thats all it said.

Jafo232 08-15-2008 02:22 AM

I think they did some sort of database restore, because I had a PM I know I read already, yet it showed as new again..

Hornstar 08-15-2008 05:21 AM

wow you have really gone and done a great job here. i currently have 2 forums running on my server, however as I expand I will really have to go and look into this more.

Jafo232 08-15-2008 11:35 AM

Quote:

Originally Posted by hornstar1337 (Post 1598967)
wow you have really gone and done a great job here. i currently have 2 forums running on my server, however as I expand I will really have to go and look into this more.

Even with just 2 forums, by installing this mod, you will cut your memory usage in half (providing your using an opcode cache like APC, Xcache, or eAcc)..

Jafo232 08-15-2008 02:59 PM

I do want to take an opportunity to clarify something I think may be unclear.

When you install this, you define a license key for each site using the DLS system by entering in the license #. This license # that you enter will be used throughout the script for the site it is defined for. This in no way bypasses any licensing methodology in the script. If you enter an invalid license # or a license for a different site than what you defined at vbulletin.com, it will still throw up the red flags for Jelsoft.

The only thing the plugin does is make sure the proper license (as you define it) is returned when called. We contacted the VB team about this and they detailed to us where these areas were so we could build this system without stepping on any licensing issues when it came to their piracy protection schemes.

If you try to use this to have multiple copies of the same license running, it will still be identified exactly the same way it would if they were separate installs.

y2ksw 08-16-2008 08:35 PM

I wonder if this would work on Windows servers ... I suppose not ... (sigh) ;)

Rebecca217 08-16-2008 11:25 PM

This is brilliant. Thank you! :)

Jafo232 08-17-2008 01:14 AM

Quote:

Originally Posted by y2ksw (Post 1600289)
I wonder if this would work on Windows servers ... I suppose not ... (sigh) ;)

Probably not, at least out of the box. I suppose you could use shortcuts instead of symbolic links and then it would work.

Jafo232 08-20-2008 03:16 AM

Quote:

Originally Posted by djr (Post 1598605)
*VERY* interesting and I love the out-of-the-box thinking. Truly impressed. Do you know whether this will impact vbSEO? Would it be possible to also include vbSEO in the DLS or isn't that necessary?

We finally got this working with VBSEO... If you upload all the files for vbSEO to the DLS except for the config file, run the php-clone.php script, you should be all set. Really speeds things up!

KevinL 08-20-2008 03:27 AM

This really sounds great!

Jafo232 08-20-2008 12:51 PM

Quote:

Originally Posted by KevinL (Post 1602792)
This really sounds great!

Great! Don't forget to mark installed if you find it useful. :)

Beermonster 08-21-2008 07:04 PM

Where do you put the path to the forum in? there is one line in php-clone.php that says Path to the forum not forums, which path is this?

Edit: and also how are you able to upgrade the databases or is it just files this updates?

y2ksw 08-21-2008 07:18 PM

Quote:

Originally Posted by Jafo232 (Post 1600434)
Probably not, at least out of the box. I suppose you could use shortcuts instead of symbolic links and then it would work.

I've tried it. Shortcuts won't work. So that's a Linux-only solution ;)

Jafo232 08-21-2008 09:28 PM

Quote:

Originally Posted by Beermonster (Post 1603956)
Where do you put the path to the forum in? there is one line in php-clone.php that says Path to the forum not forums, which path is this?

Edit: and also how are you able to upgrade the databases or is it just files this updates?

Code:

$oldls = './public_html/forums';
you can use relative or absolute when it comes to the path i.e."
Code:

$oldls = '/some/pathto/public_html/forums';
This does nothing to the databases.

AWS 08-23-2008 05:17 PM

Quote:

Originally Posted by y2ksw (Post 1603964)
I've tried it. Shortcuts won't work. So that's a Linux-only solution ;)

What kind of problems are you having with shortcuts?. I use shortcuts to serve up files and resources all the time. Might be a little config tweaking needed.

GoTTi 08-24-2008 08:30 AM

great mod. so if i understand whats going on here, this mod will let me upgrade multiple forums on the same server, under different domain names (or accounts on the server), as long as i input the license information properly, it will upgrade all the forums running the software at one time?

seems like a really great mod here. i am old fashioned and enjoy upgrading the forums one at a time, and download each script for my domains individually. not all forums can be upgraded to the same version, due to hacks/addons from here that might be out dated, and forum owners dont wanna loose them...

but i do need a better understanding of this mod. does the server need any pre-req software or modifications to it or is this a out of the box kind of mod because i am not server smart, i understand real basic stuff, and i see things in here like OP code and that throws me for a loop like am i suppose to look for something to make this work right...the link in your PDF for opcode is not working so i cant get information on it.

anyways, if you could answer my question id appreciate it. this mod just lets me upgrade multiple forums that are installed on the server in 1 shot?

thanks and good job, been a while since i seen a mod like this that really benefits the server instead of its users.

Jafo232 08-26-2008 01:32 PM

You can use it to upgrade multiple forums at once if you want to, but I would recommend creating a new source repository and upgrading your forums one at a time just for the reasons you laid out.

Opcode caching is basically this. When a PHP script is executed on your server, the server reads the script, compiles it, and then executes the compiled code (op code). It does this EVERY time the script is called. Of course, there is a lot of overhead compiling the source over and over so caching will only compile it once and then the server will use the compiled code saving you A LOT of memory and CPU.

When you run multiple forums on a server, and you are using opcode caching, each forums file will be cached even though for all intents and purposes, they are the same files. By allowing all the forums to share one set of source files, they are only cached once.

So index.php on forum1 and index.php on forum2 are only cached one time when you use the DLS as opposed to twice. This cuts the memory usage for cached files in half.

If you are not comfortable with your server prowess, you may want to test this on some test installs before you try to do it live. ;)

y2ksw 08-26-2008 02:37 PM

Quote:

Originally Posted by AWS (Post 1605252)
What kind of problems are you having with shortcuts?. I use shortcuts to serve up files and resources all the time. Might be a little config tweaking needed.

I'm using Apache on Windows 2003 Servers. When using a shortcut (actually terminates with a .php.lnk buth shows .php) Apache returns a 404 page not found error. I tried this with the sendmessage.php file in the same domain, but different folder, just to see if it does anything besides a page not found error :)

It may work with IIS, but I won't use IIS for other reasons ;)

Jafo232 08-26-2008 09:12 PM

Hmm, I know very little about Windows servers, but could you not associate the ink file to run as PHP?

y2ksw 08-26-2008 09:46 PM

Quote:

Originally Posted by Jafo232 (Post 1607667)
Hmm, I know very little about Windows servers, but could you not associate the ink file to run as PHP?

:) I tried that and it failed because PHP attempts to read directly the link file.

If I run the file first (then it's in the cache), the file link works. However after restarting Apache the cache is empty and it would fail with a 404 error.

Ok nevermind, it's a great solution for Linux, and there it'll surely apply :)

sockwater 08-26-2008 10:18 PM

You can use hard links on windows and it works (just tested). A hard link basically means that if you change either file, the other one will also be changed. You can create a hardlink on windows like this:
Code:

fsutil hardlink create newfile.php oldfile.php
Also you might want to try using junctions, which are basically directory symlinks. I don't know if this would work under apache or not.

EDIT: If you try using hardlinks, I'd like to know if the opcode caching sees them as the same file or separate files.

Jafo232 08-26-2008 11:47 PM

That would be ideal. Otherwise it is only good for patch releases.

y2ksw 08-27-2008 07:34 AM

Quote:

Originally Posted by sockwater (Post 1607709)
You can use hard links on windows and it works (just tested). A hard link basically means that if you change either file, the other one will also be changed. You can create a hardlink on windows like this:
Code:

fsutil hardlink create newfile.php oldfile.php
Also you might want to try using junctions, which are basically directory symlinks. I don't know if this would work under apache or not.

EDIT: If you try using hardlinks, I'd like to know if the opcode caching sees them as the same file or separate files.

I'll try that tonight ... and if it works I'll make a program which creates those links recursively for Windows Servers :)


All times are GMT. The time now is 07:14 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01327 seconds
  • Memory Usage 1,842KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_code_printable
  • (15)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete