Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.6 > vBulletin 3.6 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
datastore cache to XCache - boost your vBulletin Details »»
datastore cache to XCache - boost your vBulletin
Version: 0.8.5, by phpxcache phpxcache is offline
Developer Last Online: Mar 2008 Show Printable Version Email this Page

Category: Board Optimization - Version: 3.6.5 Rating:
Released: 03-02-2007 Last Update: 03-03-2007 Installs: 142
Code Changes Additional Files  
No support by the author.


(note: do not apply this patch on vBulletin 3.7 as it's included already)
This patch allow you to use XCache as a datastore cache in vBulletin. This is definitely your choice if you have installed and enabled XCache on you server already.

Take care that this is a beta version and was not heavily tested. And i'm not familiar with vBulletin source code as i just started reading it today, but i don't have any difficulty reading it thanks to my years of php skill

Take aware that some vB plugin is not compatible with vB_datastore_*, not just vB_datastore_XCache. So, in case you find vB_datastore_XCache won't work, you'd better try datastore to file or memcache. If one of the others works but not vB_datastore_XCache, do report it to me so i can fix it.

Pre-requirement
Install the modification
for those of you who can't run "patch", u may patch the file manually
  • download Attachment 61372 (class_datastore_xcache.php)
  • save the file as vBulletin.3.6/upload/includes/class_datastore_xcache.php
  • open vBulletin.3.6/upload/includes/class_datastore.php in your favor editor
  • add a line in class_datastore.php (see below)
  • update upload/includes/config.php to enable it (see below)

example class_datastore.php after modification:
PHP Code:
        }
        return 
true;
    }
}

// add class_datastore_xcache, enable it in config.php
require_once(DIR '/includes/class_datastore_xcache.php');

/*======================================================================*\
|| ####################################################################
|| # Downloaded: 12:33, Fri Mar 2nd 2007
|| # CVS: $RCSfile$ - $Revision: 15474 $
|| ####################################################################
\*======================================================================*/ 
example config.php after modification:
PHP Code:

    
// vB_Datastore_Filecache  - for using a cache file
// $config['Datastore']['class'] = 'vB_Datastore_Filecache';
$config['Datastore']['class'] = 'vB_Datastore_XCache';
    
// vB_Datastore_Memcached - for using a Memcache server
    // It is also necessary to specify the hostname or IP address and the port the server is listening on 
Trouble Shooting
q. i have multiple vBulletin instance installed, the seems to mix data after install this plugin
a. this applies to apc too because, if you wanna fix it, try
open class_core.php, look for:
$this->prefix =& $this->registry->config['Datastore']['prefix'];
and modify to:
$this->prefix = $this->registry->config['Datastore']['prefix'] . $_SERVER['SERVER_NAME']; // or HTTP_HOST

q. Warning: unserialize() expects parameter 1 to be string, array given in $a.php on line $b
a. upgrade your plugin/hack that $a.php belongs to, e.g. vbjournal/vbgallery etc. OR open $a.php and locate at line $b, remove unserialize call, e.g.:
replace $var = unserialize($this->data);
with $var = $this->data;
be careful do not remove the whole line, just the unseralize( and )

Supporters / CoAuthors

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #22  
Old 03-03-2007, 03:56 PM
Zia's Avatar
Zia Zia is offline
 
Join Date: Dec 2005
Location: golpo.net
Posts: 931
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MikeWarner View Post
No - I need 100mb. I have tried to reduce it, but was getting ooms using 90mb. I'll give it a try later. Thanks.
ag OOMS ..thet u obiviously need 100 MB..(wondering how many things ur using)
then did u try 10 or 20 Mb for xcache.var_size ?
Reply With Quote
  #23  
Old 03-03-2007, 06:50 PM
bluechris bluechris is offline
 
Join Date: Nov 2006
Location: Athens. Greece
Posts: 43
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thx guys for the reply... i got it working now.. is there anyway that i can see stats of the site how is it going... what is cached etc?
Reply With Quote
  #24  
Old 03-03-2007, 07:33 PM
bluechris bluechris is offline
 
Join Date: Nov 2006
Location: Athens. Greece
Posts: 43
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nevermind i got the admin page working and i see the statistics... the point is i dont see cache working really... or i am mistaken.... see my php.ini settings

Code:
[xcache]
xcache.shm_scheme =        "mmap"
xcache.size  =                32M
xcache.count =                 2
xcache.slots =                8K
xcache.ttl   =                 0
xcache.gc_interval =           0

xcache.var_size  =            32M
xcache.var_count =             2
xcache.var_slots =            8K
xcache.var_ttl   =             0
xcache.var_maxttl   =          0
xcache.var_gc_interval =     300

xcache.test =                Off

xcache.readonly_protection = Off
xcache.mmap_path =    "c:/temp"

xcache.coredump_directory =   ""


xcache.cacher =               On
xcache.stat   =               On
xcache.optimizer =            On

[xcache.coverager]
xcache.coverager =          Off
xcache.coveragedump_directory = ""

Also in admin page of xcache i see this results in the attached gif.

the only 4 hits that had cached is the pages from admin of xcache, do i need to do something extra in my VB? or anywhere else?
Reply With Quote
  #25  
Old 03-03-2007, 11:01 PM
shifangjumie shifangjumie is offline
 
Join Date: May 2006
Posts: 2
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

国内的兄弟??
Reply With Quote
  #26  
Old 03-04-2007, 01:50 AM
Zia's Avatar
Zia Zia is offline
 
Join Date: Dec 2005
Location: golpo.net
Posts: 931
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by bluechris View Post
Nevermind i got the admin page working and i see the statistics... the point is i dont see cache working really... or i am mistaken.... see my php.ini settings

Code:
[xcache]
xcache.shm_scheme =        "mmap"
xcache.size  =                32M
xcache.count =                 2
xcache.slots =                8K
xcache.ttl   =                 0
xcache.gc_interval =           0

xcache.var_size  =            32M
xcache.var_count =             2
xcache.var_slots =            8K
xcache.var_ttl   =             0
xcache.var_maxttl   =          0
xcache.var_gc_interval =     300

xcache.test =                Off

xcache.readonly_protection = Off
xcache.mmap_path =    "c:/temp"

xcache.coredump_directory =   ""


xcache.cacher =               On
xcache.stat   =               On
xcache.optimizer =            On

[xcache.coverager]
xcache.coverager =          Off
xcache.coveragedump_directory = ""

Also in admin page of xcache i see this results in the attached gif.

the only 4 hits that had cached is the pages from admin of xcache, do i need to do something extra in my VB? or anywhere else?
Ur on win server?
seemed that ur cache is working...

i m confused ur var.cache is working or not .....did u follow all the steps properly to enable var.cache?
Reply With Quote
  #27  
Old 03-04-2007, 01:57 AM
phpxcache phpxcache is offline
 
Join Date: Feb 2007
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by bluechris View Post
Nevermind i got the admin page working and i see the statistics... the point is i dont see cache working really... or i am mistaken.... see my php.ini settings
the only 4 hits that had cached is the pages from admin of xcache, do i need to do something extra in my VB? or anywhere else?
i assume you're usig windows, can u tell me how is your php installed? not the installtion steps, but about how it looks like. iis? apache? mod_fastcgi or not?


See Faq: Why is my cache being cleared?
Reply With Quote
  #28  
Old 03-04-2007, 04:35 AM
bluechris bluechris is offline
 
Join Date: Nov 2006
Location: Athens. Greece
Posts: 43
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I use IIS with php 5.2.1 ... but i got the big picture from the links and other search i did on web...
I think the problem is that i use fast-cgi..... this dont not work good in windows cause caching programs cannot share among many worker processes that windows run for each user ... my 2 options now is run as isapi i suppose or w8 for something else...... i dont know what else i can do.

Quote:
Originally Posted by Zia View Post
Ur on win server?
seemed that ur cache is working...

i m confused ur var.cache is working or not .....did u follow all the steps properly to enable var.cache?
Yeap i got same statistics for var cache... says that hasn't cached anything.
Reply With Quote
  #29  
Old 03-04-2007, 06:39 AM
MikeWarner's Avatar
MikeWarner MikeWarner is offline
 
Join Date: Nov 2001
Location: UK
Posts: 133
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Getting this error:
Fatal error: Cannot redeclare class vb_datastore:vb_datastore_xcache in /home/migweb/public_html/forums/includes/class_datastore_xcache.php on line 14

I double checked everything.
Reply With Quote
  #30  
Old 03-04-2007, 06:56 AM
phpxcache phpxcache is offline
 
Join Date: Feb 2007
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MikeWarner View Post
Getting this error:
Fatal error: Cannot redeclare class vb_datastore:vb_datastore_xcache in /home/migweb/public_html/forums/includes/class_datastore_xcache.php on line 14

I double checked everything.
you gotta remove the old patch that you applied (inserted) to use the new installtion way.

search includes/* for string "vB_Datastore_XCache" (without the quotes)
Reply With Quote
  #31  
Old 03-04-2007, 07:51 AM
MikeWarner's Avatar
MikeWarner MikeWarner is offline
 
Join Date: Nov 2001
Location: UK
Posts: 133
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmmm... now getting:
Fatal error: XCache variable data cache is not enabled, please set xcache.var_size in php.ini in /includes/class_datastore_xcache.php on line 39

xcahce.var_size is set to 10 and is showing in the xcache cp.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:00 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05198 seconds
  • Memory Usage 2,327KB
  • Queries Executed 26 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_code
  • (2)bbcode_php
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete