Quote:
Originally Posted by fantasyiq
Great hack, but I think the design has WAY too many database hits and I definitely noticed a slowdown on my site, especially with a lot of users online. I made a couple small modifications that greatly reduce the database hits and improve performance.
1) Removed the "include("./vbs_counter.php");" from the phpinclude template.
2) Modified global.php:
Find:
if (!$servertoobusy) {
require('./admin/sessions.php');
Add before:
if (!isset($sessionhash)) include("./vbs_counter.php");
3) Modified vbstats.php:
Find:
$vbs_today=time()-(86400);
Add:
$vbs_date = date("Y-m-j");
4) Modified template vbstats_stats:
Replaced text "Page Views" with "Sessions"
Replaced text "Views" with "Sessions" (in last 24 hour section)
That's it. What this essentially does is replace all page hit information with new session information. So the stats are only updated when a new session is created, not with every page hit. Although you lose the "Page Views" stat, everything else works fine, and the database only gets hit by vbs_counter.php when there's a new session rather than with every page hit. You would likely want to reset your counters after making this change.
|
Worked great...reduced page load, lost 4 queries and server load is down. THANKS!
HA, it even took care of the errors I was getting on my vbhome page. Cool! :up: