vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Graveyard (https://vborg.vbsupport.ru/forumdisplay.php?f=224)
-   -   Board Optimization - Plugin Based Template Cache (https://vborg.vbsupport.ru/showthread.php?t=121876)

Milez 11-12-2006 11:43 PM

This hack is giving me hope as my very large board often succumbs to slow page loads during very busy times. I just read thru every post in this thread as well as the old 3.5.x thread and there is not a whole lot of success stories listed.

Has anyone noticed significant speed ups on big boards? I would love to hear some specifics on this before I install. I am currently running eAccel so this hack might be a good fit for me.

BTW the support from orban is phenomenal. Props.

orban 11-13-2006 04:37 AM

Quote:

Originally Posted by Milez (Post 1115835)
This hack is giving me hope as my very large board often succumbs to slow page loads during very busy times. I just read thru every post in this thread as well as the old 3.5.x thread and there is not a whole lot of success stories listed.

Has anyone noticed significant speed ups on big boards? I would love to hear some specifics on this before I install. I am currently running eAccel so this hack might be a good fit for me.

BTW the support from orban is phenomenal. Props.

I'm running a (rather) big board myself (1.5 million posts) and I did/do notice a huge performance improvement.

Quote:

Originally Posted by nix (Post 1115809)
Any answer to this one? Like he said its commented out right now. Should we uncomment this? Or is this basically what the hack does?

The datastore value in config.php has nothing to do with templates or this addon.

nix 11-13-2006 04:55 AM

Quote:

Originally Posted by orban (Post 1116037)



The datastore value in config.php has nothing to do with templates or this addon.

Do you think it would help/hurt to turn that on also?

amcd 11-13-2006 05:34 AM

Quote:

Originally Posted by nix (Post 1116048)
Do you think it would help/hurt to turn that on also?

it would certainly help

beano33 11-15-2006 01:44 PM

Quote:

Originally Posted by Milez (Post 1115849)
Has anyone noticed significant speed ups on big boards? I would love to hear some specifics on this before I install. I am currently running eAccel so this hack might be a good fit for me.

VERY nice, people. :) We run an extremely busy board, with 6 load-balanced webservers and frequently 2000+ visitors... Watching the slow query log on the MySQL server was painful, since the template query often took more than 6 seconds on a very fast server, and of course, that slowed things down significantly, even causing the SQL server to drop other connections, etc.

This "hack" has made our board a LOT faster, and it's really appreciated. We're running it over NFS, and at first, since NFS doesn't support file locks, we were having some problems, since 0-byte files were being created. However, I found that a crude hack to fix that problem worked well... And for others who have the same problem, here's the crude hack that will fix it:

Replace the following line (around line 29 in 1.03):
Code:

if (file_exists($templatefile))
with
Code:

if (file_exists($templatefile) && filesize($templatefile) != 0)
Pretty simple, but it works. Basically, if the file is a zero-byte file, it will recreate it. If it's not... It won't. :)

Anyhow, that will fix the little problem created by file-locking if you're running NFS and getting zero-byte files.

And I'd HIGHLY recommend this to anyone who's been watching their slow-query log on their SQL server and getting frustrated with how that damn "SELECT title, template" keeps showing up in their logs. Get it, install it, your worries are over.

As for the datastore, I'd highly recommend that you get memcached set up and installed, that will provide a HUGE boost as well. :)

Kihon Kata 11-15-2006 01:58 PM

Quote:

Originally Posted by beano33 (Post 1117932)
VERY nice, people. :) We run an extremely busy board, with 6 load-balanced webservers and frequently 2000+ visitors... Watching the slow query log on the MySQL server was painful, since the template query often took more than 6 seconds on a very fast server, and of course, that slowed things down significantly, even causing the SQL server to drop other connections, etc.

This "hack" has made our board a LOT faster, and it's really appreciated. We're running it over NFS, and at first, since NFS doesn't support file locks, we were having some problems, since 0-byte files were being created. However, I found that a crude hack to fix that problem worked well... And for others who have the same problem, here's the crude hack that will fix it:

Replace the following line (around line 29 in 1.03):
Code:

if (file_exists($templatefile))
with
Code:

if (file_exists($templatefile) && filesize($templatefile) != 0)
Pretty simple, but it works. Basically, if the file is a zero-byte file, it will recreate it. If it's not... It won't. :)

Anyhow, that will fix the little problem created by file-locking if you're running NFS and getting zero-byte files.

And I'd HIGHLY recommend this to anyone who's been watching their slow-query log on their SQL server and getting frustrated with how that damn "SELECT title, template" keeps showing up in their logs. Get it, install it, your worries are over.

As for the datastore, I'd highly recommend that you get memcached set up and installed, that will provide a HUGE boost as well. :)

Thanks Beano..

Orban, can you comment on this? ^^

orban 11-15-2006 02:16 PM

What you wanna know :)

The file_exist problem is just with NFS because it often doesn't support file locking.

The memcached datastore has nothing to do with this addon, but I'd recommend it, too.

ElForro 11-28-2006 09:48 AM

Ths is nice... I have only one problem... I use this: https://vborg.vbsupport.ru/showthread.php?t=122594

But with the PLugin Based Template Cache on, the table with the "users who read the thread" doesn't shows. Does anybody knows how could I use both plugins at the same time?

orban 11-28-2006 11:27 AM

You have to exclude SHOWTHREAD from being cached (in the options)

OR

edit the "showthread_getinfo [Display Thread Readers (3)]" plugin and change

$vbulletin->templatecache['SHOWTHREAD'] = str_replace($vbulletin->options['text_wrt'], $vbulletin->options['text_wrt'].$vbulletin->templatecache['Display_Readers'],$vbulletin->templatecache['SHOWTHREAD']);

to

eval('$wrt_template = "' . fetch_template('Display_Readers') . '";');

and then edit the "SHOWTHREAD" template and add

$wrt_template after

"<!-- end currently active users -->"

so you end up with

"<!-- end currently active users --> $wrt_template"

The second part is untested and if you don't know PHP/vB template system don't try this, but the performance will be a lot better.

ElForro 11-28-2006 12:04 PM

Thanks! I edited the plugin and SHOWTHREAD and works fine!


All times are GMT. The time now is 11:00 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.01443 seconds
  • Memory Usage 1,756KB
  • 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
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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