vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Board Optimization - XCache for vBulletin Caching (https://vborg.vbsupport.ru/showthread.php?t=277804)

rossco_2005 01-30-2012 11:00 PM

XCache for vBulletin Caching
 
1 Attachment(s)
This mod will replace the default vB_Cache_Db class (database cache) used in vBulletin with an xCache implementation of it.
vBulletin has promised to implement this option themselves, but I'm sick of waiting, so I created this.

What are the benefits of using XCache for caching over MySQL (Database) ?

In theory, quicker page load times, lower server load. This will offload the duty of caching from mysql and throw it into the RAM.
It will also reduce your query count per page.

The most staggering difference you will notice is with the CMS, or any mods that make good use of the cache.
For instance, in my dev site using the default CMS content and settings, browsing as a guest, I was able to shave off an average of 0.06 seconds from the page generation time (0.23 -> 0.17 seconds) and 43 queries (86 -> 43)!
In a live site, the reduction in queries and overall time spent serving the page will have a large effect on overall performance in a busy site.

Make sure that you also have the datastore cache method set to xcache as well for further query reduction: https://www.vbulletin.com/docs/html/datastore
Also install "Load templates from XCache" for further query reduction: https://vborg.vbsupport.ru/showthread.php?t=255994

Any drawbacks?

Other than a file edit required on every vBulletin upgrade, none that I can think of... If you think of one, post it.

What about other data caches ? (memcached, apc, etc.)

I could write those as well, if there is a demand for it, and they happen to work similar enough to xcache.

This is a beta!

This has been tested in a live forum for a few days, and no incidents/side-effects have been noticed or reported, but I cannot yet guarantee it is 100% perfect.

This mod requires one file edit

See this bug to find out why: http://tracker.vbulletin.com/browse/VBIV-13241

Requirements

This was designed to fail gracefully by falling back on the DB cache if there is an error, so if there is an error you will not even realize it.

Make sure these requirements are met:
  • XCache 1.3.2 installed (only version that I tested) (verify by viewing phpinfo page)
The following are in your XCache ini settings (php.ini usually):
  • xcache.var_size = 32M (32MB; at least)
  • xcache.var_slots = 8k (8000; at least)
  • Set xcache.admin.user and xcache.admin.pass to whatever you want (keep in mind that the pass must be MD5'd)

Restart after making any changes.

Another tip is to set your xcache.count and xcache.var_count to the number of CPU cores that you have.

See the documentation here: http://xcache.lighttpd.net/wiki/XcacheIni

After running this mod for a while, check your xcache admin page to ensure that your var_slots and var_size are large enough.

Install Instructions

1. Upload the contents of the UPLOAD folder in xcache.zip to your forum root

2. Open up your /includes/config.php file and add the following:

PHP Code:

/*
 * XCache Config
 */
$config['xcache']['user'] = 'user';
$config['xcache']['pass'] = 'pass'

Edit it to include your xcache admin username and password

3. This step will need to be repeated whenever you do a forum upgrade.
Open up /vb/cache.php.
Find:
PHP Code:

self::$instance vB_Cache_Db::instance(); 

Replace with:
PHP Code:

self::$instance fst_Cache_Xcache::instance(); 


FReeSTER 01-31-2012 12:01 AM

First post. lol Great!!!!!!!!!!!!!!!!11 love Mods like this one. Will try and let you know

rossco_2005 01-31-2012 12:10 AM

Quote:

Originally Posted by FReeSTER (Post 2294415)
First post. lol Great!!!!!!!!!!!!!!!!11 love Mods like this one. Will try and let you know

Thanks, I look forward to hearing the results.

v123shine 01-31-2012 12:25 AM

Great mods...love it!

steviewonder44 01-31-2012 12:43 AM

Thanks a bunch

OldSchoolDSL 01-31-2012 01:04 AM

I'd be interested apc .... Should there be a demand other than myself of course.

Good work on this

Max Taxable 01-31-2012 01:07 AM

What's the possibility of using this on a 3.8?

Zachery 01-31-2012 01:12 AM

No need, vBulletin 3.8 doesn't have a cache table at all. It also already has datastore cacheing for xcache.

rossco_2005 01-31-2012 01:14 AM

Quote:

Originally Posted by Max Taxable (Post 2294429)
What's the possibility of using this on a 3.8?

It will never work, the cache was added in 4.0, and even now it's only really used for the CMS and maybe a few odds and ends in the forums.

CoZmicShReddeR 01-31-2012 01:51 AM

Installed not sure if there was too much of an improvement on my site...

thecore762 01-31-2012 04:54 AM

What's the difference between this mod and vBOptimise?

abdobasha2004 01-31-2012 09:38 AM

it seems you put lot of effort in this
but I do not know why but I am only convinced by server Header cache and mod expires instead

Robru 01-31-2012 10:12 AM

Thanks for sharing this! :)

TheSupportForum 01-31-2012 10:20 AM

you also need to ensure that your webhost supports xcache

mine does so for me this mod is useless, only install if your host supports it

sticky 01-31-2012 10:51 AM

Who is using this and what are the results?

Any compatibility issues with mods or is this seamless?

FReeSTER 01-31-2012 11:12 AM

well Im using it with vb4.1.7 and I guess I see some improvements on the site but not much. Maybe because my style is base on 90%images. but a bit of improvements here and there makes a change.

thanks

Osbes 01-31-2012 01:35 PM

I would also appreciate an APC version of this.

dorans 01-31-2012 03:30 PM

Quote:

Originally Posted by Osbes (Post 2294587)
I would also appreciate an APC version of this.

+1 APC

tarzan22 01-31-2012 06:21 PM

please, 4.1.10 ?

CoZmicShReddeR 01-31-2012 09:43 PM

I am using it with 4.1.10 no issues... I run my own dedicated Server Box 2 Quad Core Xeon with 28GB Ram running it with Windows 2008 64 bit server hosting with XAMPP/Apache Friends just downloaded a windows version of XCache works fine... It did speed the load times up about 5% on the CMS home front and about 3% for the forums... Not sure how to tweak it using default settings or suggested settings...

DNCL 02-01-2012 12:58 PM

Do i have to enable XCache data store in config.php ?
Do i need to set the xcache admin pass in config.php?
What php handler i should use?

TheSupportForum 02-01-2012 01:49 PM

Quote:

Originally Posted by DNCL (Post 2294945)
Do i have to enable XCache data store in config.php ?
Do i need to set the xcache admin pass in config.php?
What php handler i should use?

you ned to make sure your your webhost allows it, or supports it

DNCL 02-01-2012 03:29 PM

Quote:

Originally Posted by simonhind (Post 2294963)
you ned to make sure your your webhost allows it, or supports it

I;ve missed some note the dev wrote, the xcache must be enabled in config.php but the other 2 questions still need answer about best php handler for xcache because i'm getting internal server error with some of them, i'm using suphp atm.

michael24179 02-01-2012 04:25 PM

CMS problem. Categories in the CMS can not be called.

An unexpected error has occurred. Please try again later.
If the problem persists, contact the technical administrator.

Cache system can unfortunately not be deleted

Paul M 02-01-2012 04:44 PM

Interesting.
I started looking at this in the summer but had to put it on hold.
Might have to play with this a bit.

rossco_2005 02-01-2012 10:23 PM

Quote:

Originally Posted by DNCL (Post 2294997)
I;ve missed some note the dev wrote, the xcache must be enabled in config.php but the other 2 questions still need answer about best php handler for xcache because i'm getting internal server error with some of them, i'm using suphp atm.

The datastore cache does not have to be set to xcache. That was only a recommendation.
The xcache admin user and pass must be set in config.php. Read the install instructions to see the code necessary to add to config.php to do this.
As for your question about a php handler, my mod does not care which you use, but xcache might need a specific handler - I'm not sure. You will have to ask google or look on the xcache website about installing xcache.

rossco_2005 02-01-2012 10:25 PM

Quote:

Originally Posted by michael24179 (Post 2295022)
CMS problem. Categories in the CMS can not be called.

An unexpected error has occurred. Please try again later.
If the problem persists, contact the technical administrator.





Cache system can unfortunately not be deleted

Do you have any mods installed? If so do you mind listing them?

Also what do you mean "cache system can unfortunately not be deleted."

rossco_2005 02-01-2012 10:33 PM

Quote:

Originally Posted by CoZmicShReddeR (Post 2294771)
I am using it with 4.1.10 no issues... I run my own dedicated Server Box 2 Quad Core Xeon with 28GB Ram running it with Windows 2008 64 bit server hosting with XAMPP/Apache Friends just downloaded a windows version of XCache works fine... It did speed the load times up about 5% on the CMS home front and about 3% for the forums... Not sure how to tweak it using default settings or suggested settings...

Not sure which "default settings or suggested settings" your referring to, but here's basics of how to tweak xcache.
Actually there isn't really much to it.
Have a read here at what the different options affect:
http://xcache.lighttpd.net/wiki/XcacheIni

It would be useful for you to have xcache admin. It will tell you your cache sizes (php cache = xcache.size, var cache = xcache.var_size) in megabytes, and will tell you how many slots are available for each (php slots = xcache.slots, var slots = xcache.var_slots).
To see if you need to increase, or could get away with decreasing, those numbers, check how much memory is being used as well as how many slots are being used, then tweak accordingly.
If you are using all memory, you would increase memory.
If you are using all slots, increase the slots.
You want to leave extra room for the cache to grow, but keep in mind any memory you give to xcache takes away from memory available to the rest of the server, so it is up to you...

michael24179 02-02-2012 07:09 AM

1 Attachment(s)
Quote:

Cache system can unfortunately not be deleted
https://vborg.vbsupport.ru/attachmen...1&d=1328169972

My Addons

404 Area 1.0
Admin Log In As User 3.21
Change Threads Prefix Inline 2.2.0
CT second_post_Ads 2.0.8
DownloadsII 6.0.9
Forum-wide Search For Unanswered Threads 4.2.0
Fussball Tippspiele 1.4.25 RC 1
MARCO1 Hide All 4.5
MGC chatbox Evo 3.0.0
Post Thank You Hack 7.82
Sids Hide Hack 0.9.8
Tabs en vBulletin 4.x 2.0.3
Template Modification System 1.2.0 Beta 4
Title Replace 1.1
vBulletin-CMS 4.1.10
vBulletin-CMS Links 1.0.0
VSa - Advanced Forum Rules 5.0.5
VSa - Sub-Forum Manager

My server
Operating System: Debian 6
Web Server lighttpd - cgi-fcgi
MySQL version 5.1.49-3
PHP 5.3.3-7 + squeeze6
Xcache Version 1.3.0

DNCL 02-02-2012 12:35 PM

I'm asking about if i really need to set the xcache user/pass in config.php because i couldn't authenticate to xcache admin panel until i turned off the admin authentication.
Is it ok?

ssslippy 02-03-2012 04:39 PM

Running this is on a site that has about 1500-2000 users on at a time. No negative results not seeing a dramatic change either. I run this with vboptimise.

Also you do not need to put in xcache admin/pass if your not using the xcache password system. I also do not have a problem clearing the cache.

Zachery 02-03-2012 08:05 PM

If you're already running vBoptimize (pro) I don't know how much this is going to help you. They already cache a lot of infomation that can be cached.

galerio 02-03-2012 09:26 PM

Quote:

Originally Posted by dorans (Post 2294624)
+1 APC

Also count me for an APC version

thecore762 02-04-2012 01:41 AM

I can't find the file: /vb/cache.php

Edit, nvm.

thecore762 02-04-2012 01:48 AM

Quote:

Originally Posted by Zachery (Post 2295811)
If you're already running vBoptimize (pro) I don't know how much this is going to help you. They already cache a lot of infomation that can be cached.

Zach, do you see much difference between this mod and vBOptimise Pro other than the $100 price tag?

TheSupportForum 02-04-2012 01:30 PM

Quote:

Originally Posted by thecore762 (Post 2295930)
Zach, do you see much difference between this mod and vBOptimise Pro other than the $100 price tag?

lol there is a free option

CLOUDFLARE

i updated my DNS and how wonderful it is

thecore762 02-04-2012 06:45 PM

Quote:

Originally Posted by simonhind (Post 2296097)
lol there is a free option

CLOUDFLARE

i updated my DNS and how wonderful it is

I don't use cloudflare.
I use EdgeCast CDN.

rossco_2005 02-04-2012 10:20 PM

Quote:

Originally Posted by Zachery (Post 2295811)
If you're already running vBoptimize (pro) I don't know how much this is going to help you. They already cache a lot of infomation that can be cached.

This mod doesn't cache anything new.
It's about moving what vBulletin caches by default from the DB into memory (xcache).
It makes improvements to the CMS, that's about it for default vBulletin.

Paul M 02-04-2012 10:35 PM

Forumhome blocks use the cache, so does showgroups.

rajubd 02-04-2012 11:13 PM

Quote:

Originally Posted by galerio (Post 2295841)
Also count me for an APC version

1+ for APC please


All times are GMT. The time now is 05:56 AM.

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.01452 seconds
  • Memory Usage 1,838KB
  • 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
  • (3)bbcode_php_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