vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Microstats (only for admin) - load times, server loads, queries, uncached templates! (https://vborg.vbsupport.ru/showthread.php?t=59700)

kmike 04-22-2004 03:06 AM

d3nnis:
Do you have access to server's shell? If so, what's output of "ls -l /proc/loadavg" and
"ls -ld /proc" ?
Anyway, you might want to revert to previous version of the hack for the time being...

Jolten 04-22-2004 03:21 AM

/me clicks install. Thanks Erwin.

d3nnis 04-22-2004 04:56 AM

Quote:

Originally Posted by kmike
d3nnis:
Do you have access to server's shell? If so, what's output of "ls -l /proc/loadavg" and
"ls -ld /proc" ?
Anyway, you might want to revert to previous version of the hack for the time being...


the server is owned by me. I will check it out tonite when i am back home. :)

d3nnis 04-22-2004 04:56 AM

Quote:

Originally Posted by Erwin
To cache a template, you need to find out which ones are not being cached. Then you add it to the top of the PHP file being run, in the section where it lists templates to be cached.

I may add a feature to this hack so that uncached templates show up with names.


that will be great!

by the way what kind of problem does uncached templates gives? increase server load?

kmike 04-22-2004 08:26 AM

Quote:

by the way what kind of problem does uncached templates gives? increase server load?
Each vb3 page is getting all "cached" templates in a batch, in one SQL query. Every uncached template needs separate query to run, thus increasing load on SQL server.

To find out what templates are uncached, one have to run the script in debug mode. Of course tt could be done simply by putting $debug=1; at the beginning of the script, but you don't want to scare your users, do you? :) So you can install one of the following hacks to restrict debug mode to certain users/groups/IPs:

https://vborg.vbsupport.ru/showthread.php?t=59605
https://vborg.vbsupport.ru/showthread.php?t=61242

After installation, you'll have a table of template usage at the bottom of debugged page, with uncached templates highlighted.
To cache template simply edit debugged script and add template name to globaltemplates array which is usually defined at the very top of the script.

d3nnis 04-22-2004 11:21 AM

Quote:

Originally Posted by kmike
d3nnis:
Do you have access to server's shell? If so, what's output of "ls -l /proc/loadavg" and
"ls -ld /proc" ?
Anyway, you might want to revert to previous version of the hack for the time being...


here's my output

root@xxx [~]# ls -l /proc/loadavg
-r--r--r-- 1 root root 0 Apr 22 20:20 /proc/loadavg
root@xxx [~]# ls -ld /proc
dr-xr-xr-x 286 root root 0 Apr 22 07:06 /proc/

d3nnis 04-22-2004 01:56 PM

Quote:

Originally Posted by kmike
Each vb3 page is getting all "cached" templates in a batch, in one SQL query. Every uncached template needs separate query to run, thus increasing load on SQL server.

To find out what templates are uncached, one have to run the script in debug mode. Of course tt could be done simply by putting $debug=1; at the beginning of the script, but you don't want to scare your users, do you? :) So you can install one of the following hacks to restrict debug mode to certain users/groups/IPs:

https://vborg.vbsupport.ru/showthread.php?t=59605
https://vborg.vbsupport.ru/showthread.php?t=61242

After installation, you'll have a table of template usage at the bottom of debugged page, with uncached templates highlighted.
To cache template simply edit debugged script and add template name to globaltemplates array which is usually defined at the very top of the script.


i written my TOS page , http://forums.keeptouch.net/tos.php using this code :

Code:

<?php

  $globaltemplates = array(
        'navbar',
        'tos'
  );

  require_once('./global.php');

  eval('$navbar = "' . fetch_template('navbar') . '";');
  eval('print_output("' . fetch_template('tos') . '");');

?>

Previously I did not add :

Code:


$globaltemplates = array(
        'navbar',
        'tos'
  );

so it appears as 1 uncached template but after i added the above code, it does not appears anymore. Am I on the right track?

kmike 04-22-2004 05:13 PM

Quote:

root@xxx [~]# ls -l /proc/loadavg
-r--r--r-- 1 root root 0 Apr 22 20:20 /proc/loadavg
root@xxx [~]# ls -ld /proc
dr-xr-xr-x 286 root root 0 Apr 22 07:06 /proc/
Hmm, not sure what's going on here. Do you have safe mode enabled, by chance?
What is output of this script:
PHP Code:

<?php
echo "file_get_contents: ".function_exists(file_get_contents)."<br>";
echo 
"safe_mode: ".ini_get(safe_mode)."<br>";
?>

As to templates caching, you've got it absolutely right.

d3nnis 04-23-2004 12:20 AM

Quote:

Originally Posted by kmike
Hmm, not sure what's going on here. Do you have safe mode enabled, by chance?
What is output of this script:
PHP Code:

<?php
echo "file_get_contents: ".function_exists(file_get_contents)."<br>";
echo 
"safe_mode: ".ini_get(safe_mode)."<br>";
?>

As to templates caching, you've got it absolutely right.


nope, safe mode definitely not on :)

my output of this script is

file_get_contents: 1
safe_mode:

kmike 04-23-2004 03:57 AM

Very weird.
Ok, what does "cat /proc/loadavg" show when run in the command line?
And since we're so deep in testing, what's output of this php script:
PHP Code:

<?php
echo file_get_contents("/proc/loadavg");
?>



All times are GMT. The time now is 11:02 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.01253 seconds
  • Memory Usage 1,755KB
  • 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
  • (2)bbcode_code_printable
  • (3)bbcode_php_printable
  • (7)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