Faster Board Advice

arr0w

New Member
My board has been eating a lot of server resources lately, which is affecting the speed and performance.
This' been going on since I upgraded to v3.7x, do you have any advice on what to do to make it a little lighter? maybe there are things I can disable, as far I as I know, downgrading isn't possible.

I was told the new version is a resource hog, but I didn't think this much.

Thanks.
 
This is based on 3.6.8 but most should work for any version

vBulletin Options -> Search Type (Drop Down Under vBulletin Options):
If you have MySQL 4.0.x you can use Full Text Search as this option can greatly reduce server load when a search query is used on your server. You can also check out this thread on vBulletin.org for information on using sphinx search. This is so much faster than using fulltext. It's something you don't need to do until search becomes a problem though. This is usually around 1 million posts.

vBulletin Options -> General Settings -> Use Forum Jump Menu:
I have this setting turned off. If you have a large amount of forums this will cause the server to work harder as it has to Generate the Forum Jump and then display it on the page. The Forum Jump consists of alot of html which makes the page larger which increases bandwidth usage. The majority of your users will not even realize it is gone. At east this is the case on my site.

vBulletin Options -> General Settings -> Disable AJAX Features:
Make sure that this is set to allow all AJAX Features. Ajax helps reduce server load by not reloading a page where AJAX is used. (Quick Reply for instance)

vBulletin Options -> Cookies and HTTP Header Options -> GZIP HTML Output:
I have this turned off because my server handles this through my httpd.conf file via mod_deflate. If you are not sure whether or not you have this enabled on your server you may test it using this website: GZIP Test. It will tell you if you have it enabled or not and if you do it will show you how much the page was compressed. Make sure the Compression Level is never set higher than 1.

vBulletin Options -> Cookies and HTTP Header Options -> Remove Redirection Message Pages:
I have this set to Yes. Not only do I find them incredibly annoying but they cause an unneeded page load.

vBulletin Options -> Cookies and HTTP Header Options -> Add No-Cache HTTP Headers: Make sure this is set to No.

vBulletin Options -> Server Settings and Optimization Options -> Cached Posts Lifespan:
I have this set to 90 days. Once you turn this on I recommend rebuilding your Cache Posts via Maintenance -> Update Counters

vBulletin Options -> Server Settings and Optimization Options -> Update Thread Views Immediately:
Set this to No. With this set at No the Thread Views will automatically update via Cron every 1 hour by default. If you wish to change this you can do so by editing the Scheduled Task for Thread Views to a different time. Mine is set to update thread views every 15 minutes.

vBulletin Options -> Server Settings and Optimization Options -> Update Attachment Views Immediately:
I have this set to No as well. I just use the default cron to update these.

vBulletin Options -> Style & Language Settings -> Store CSS Stylesheets as Files?:
Set this to yes. Make sure that you change the permission of the /clientscript/vbulletin_css/ folder to 777. This greatly reduces the page size and the code to content ration as well as not requiring the web server to spit out all that code on every page load.

vBulletin Options -> User Listing & Profile Viewing -> Show Last Post on Profile Page:
This is very server intensive. Set this to No.

vBulletin Options -> Message Posting and Editing Options -> Quick Reply:
Not only does this make posting faster which leads to more posts being made this also uses ajax which means you do not have to load another page to make a post nor does it reload the page after you make the post. I use this hack: Smilies in QR and QE To even further reduce the need to click the Post New Reply Button. I have Quick Reply set to: Yes, Click Not Required.

vBulletin Options -> Message Posting and Editing Options -> Quick Edit:
Turn this on to reduce the need for a new page reload when someone simply wants to edit a post.

vBulletin Options -> Message Searching Options -> Minimum Time Between Searches:
I have mine set to 5. I recommend setting some kind of small time limit to reduce any chance of abuse.

vBulletin Options -> Forums Home Page Options -> Display Logged in Users?:
I have mine set to Yes, Alphabetical listing to members only. What this does is show your members Alphabetically if you are logged in but if you are a guest the Whos Online does not show at all. This helps reduce server load by limiting the amount of people that see the Who's Online Stats.

vBulletin Options -> Forum Display Options -> Show Users Browsing Forums:
I have this option set to No. If your members ask for it then enable it only for members. Guests really don't need to see how many people are viewing a particular forum.

vBulletin Options -> Forum Display Options -> Maximum Displayed Threads Before Page Split:
I have this set to 50. I would not go much higher than this. The higher you go the more resources it takes to generate those extra threads to show and the bigger your page gets. Note: Changing this will change the amount of Forumdisplay pages that are generate overall which will result in a reindex by search engines.

vBulletin Options -> Thread Display Options -> Show Users Browsing Threads:
I have this set to No for the same reason I gave for Forumdisplay pages.

vBulletin Options -> Thread Display Options -> Check Thread Rating:
I have this set to no. Thread Ratings are rarely used on my forum so I don't need it to tell the user whether or not they have rated the thread and what their rating was.

vB_Datastore_Filecache: You may use the file system to cache your Datastore and improve performance. To do this Open your config.php file in your includes folder and find:

PHP:
// $config['Datastore']['class'] = 'vB_Datastore_Filecache';

and simply remove the two
PHP:
//

before:
PHP:
$config['Datastore']['class'] = 'vB_Datastore_Filecache';

to enable Filesystem caching of your datastore. Make sure that you have /includes/datastore/datastore_cache.php set to 777 so that it may write to the file.



Plugin Based Template Hack:
This is a GREAT hack that I have been using for sometime now. I have not run into any issues with this hack. This hack is even further complimented with APC caching.

Microstats - load times, server loads, queries, uncached templates:
This hack does nothing to improve performance but it offers an excellent way to determine your server load times, server load and any uncached templates you have.

Disclaimer: I can not and will not be held responsible for any damages caused by you making changes suggested within this thread. While there is very little chance that these settings can effect your board in a negative way I can not guarentee that they will behave on your forum the same way they have mine.

also this is a cut and paste job so where it say "I" it do not mean me ;)
 
wow coicidence or what but I just did all this about two hours ago lol... and it works like a charm... back down to 19 queries on the mainpage with a shitload of hacks installed, low load and I'm still yet to cache a few pesky templates...

anyway here are two invaluable mods, one is here but comes with 135mb of other mods I don't need lol, and the other was version outdated (microstats). I hunted it down elsewhere.

I use both in 3.7.2 with the following mods and no problems so far reported;
Auto Database Backup,
Can't Use Private Messages Before X posts,
Casin_* poker thing,
Cyb - Advanced Forum Rules 3.8,
Cyb - Advanced Forum Statistics 5.8.1,
Cyb - Advanced Permissions Based on Post Count 4.4,
Cyb - ChatBox 2.2, Debug Mode from AdminCP,
DI - BBCode
,
FractalizeR: Registration Form AJAX Enhancements,
Invitation System 2.0.2b,
IpInfo 1.5,
JS Cron Image, Microstats 1.2.1,
Multiple Login Detector 1.03,
Plugin Based Template Cache 1.0.3,
Real ip detection 3.7.003,
Report Bad PM 1.0.3,
Separate Sticky and Normal Threads 2.0.0,
sids hide hack 0.3.5,
TCattd - The Image Resizer 1.2.4,
Watermark Attachments 1.0 and thread thumbnails on forumdisplay.

:D okay, yeah it's pimped enough for now.

Enjoy.

  • Plugin Based Template Cache Version: 1.0.3
  • Microstats - load times, server loads, queries, uncached templates
    Version: 1.2.1

Plugin Based Template Cache Version: 1.0.3
The use of the code modification "Vbulletin Plugin Accelerator" is not recommended when using this plugin (and I recommend not using it AT ALL)!

UPGRADE

1. DISABLE THE PRODUCT (Plugin System -> Manage Products -> Plugin Based Template Cache -> Disable)
2. CLEAR THE templates/ folder. Double check there aren't any new files created.
3. UPLOAD the new template_cache.php
4. IMPORT the new product.xml (Allow Overwrite: YES)
5. ENABLE the product

INFO

Installation:

1. Create a directory templates in your forum directory then chmod 777 it. This is there were the cache files are going to be created so it needs to be writeable by PHP. You can skip the "chmod 777" step if your host is running SuEXEC or a smiliar product (ask your host when in doubt).
2. Upload template_cache.php to your forum directory.
3. Upload index.txt to the templates directory and rename to index.html (can't upload .html files here, it's just an empty file too)
4. Install the product.xml

So you should end up with:
-/home/.../forums/templates/
-/home/.../forums/templates/index.html
-/home/.../forums/template_cache.php
-Installed Products: Plugin Based Template Cache 1.0.2

5. vBulletin Options -> vBulletin Options -> Plugin Based Template Cache -> Modify the settings (especially enabling it).

Deinstallation

1. Remove the product
2. Check the 4 plugins of this product are gone
3. Clear the templates/ folder and make sure no new files are created
4. Delete the templates/ folder
5. Delete template_cache.php
6. Clear your PHP cache if you are using any.

What it does:

1. Replace the function cache_templates() (global.php:337) with a new function. Instead of fetching the templates from the database it checks first if there is a file containing all the needed templates first, if not, it grabs them and saves them to a new file. The file name is md5([all the template ids]). Done using the hook "cache_templates".

2. There is an option to have certain templates saved seperatly to its own .php file. With a big of PHP magic we avoid the eval() call for those, and when you're using a PHP cache like APC/eAccelerator this can lead to a huge performance improvement because you save both the eval() call and the parsing.

3. Automatically clears the cache when modifying or inserting templates, done using the hook admin_global and a check of $_GET, and also clearing when modifying the options.

EEK my folder keeps growing as people browse my board

Yes, this is intentional. The cache files only get created when they are needed the first time. My folder get a new file after two days, that is not unusual. The folder can get several megabytes in size, mine is 4mb (default installation, no plugins/hacks). If you have new templates/styles and several plugins it can get 10-20mb no problem.

APC/PHP caches

Especially good with APC, the cached template files are picked up by APC, so you save 1 database call on every site (without getting a file access). It is recommended to use a PHP cache with this plugin. This plugin is also aimed at larger vB installations.

"Beta"

I have only tried it on my installation, so I'd like to get some feedback. I don't guarantee it to work, but there is no source file modification involved, or special database queries, so it won't affect your installation in ANY way. Remove the product (or disable the four plugins) and there will be no traces left in your vB installation.

Support

I'm trying to read this thread and reply to problems. But I'm not going to even look at your problem if you're not running 3.5.latest without source modifications, and I'm not going to fix problems with this product that occur when using other products/addons/source modifications. (Well I still might, but that's my decision.)

Modification

You are free to use any part of this code for your own use or create a new addon/hack/extension out of it.

UPDATES

29th May: Fixed a typo in template_cache.php that might prevent the clearing of the templates/ folder when using a custom path for the templates folder.
10th May: 1.0.3, Added an option to set the path to the templates/ folder in the admincp. No need to upgrade if you don't need this.
21th April: 1.0.2, I hope this version actually works, I have to fix my PHP error reporting and why didn't vbulletin.org send me notification emails!?
20th April: 1.0.1, I added several admins settings, so you can change the settings without having to edit PHP files.
18th April: Added a new beta, template_cache.beta.php, if you want to try it rename it to template_cache.php and follow the steps to update (at the beginning of this post).
14th April: Updated template_cache.php (exluding index.html from being deleted), added index.txt (.html).
 
Back
Top