Status
Not open for further replies.

tavenger5

Customer
Even with the templates being read out of the cache PHP has to do a lot of work going through evals to build each page. If the templates were moved to and served from the file system then through the cache this would speed up page load time and relieve stress on the server.
 
Last edited:
Upvote 0
This suggestion has been closed. Votes are no longer accepted.
The problem with implementing this feature is that the necessary hook was only added in vB 4.2.0 - we would leave a lot of our users out in the cold unless we asked them to apply file edits.

We'll discuss this internally and make a decision on whether we should implement this :)
 
I can handle it. I was making file edits like it was my job back in the vB 2.x days :)

Also, you could just include the hook so that if someone updates to 4.2 it won't break everything.
 
I should also point out that storing templates in the file system does NOT negate the need for using eval().
 
Not everyone is as comfortable making file edits as you are :)

Yeah, I realize that :) At the very least, I say make it an optional feature.

I should also point out that storing templates in the file system does NOT negate the need for using eval().

Maybe I'm not understanding exactly how that part of the system works, but I was under the impression that you'd be eliminating the need to actually parse and compile each template through PHP with every page load. Maybe we should get Shawn Hogan in on this - he did it with his old vbulletin setup.
 
vBulletin doesn't compile each template on page load as it is :)

vB templates are pre-compiled, and they're saved in a format where each time vBulletin requests a template it's ran through eval() and the resulting variable ($final_rendered) is returned and either set or printed as the final page output.

EDIT: Upon further investigation I think I see how eval could be eliminated. I'll run some quick tests and post back when I've got results.
 
Last edited:
Update: I've been working on implementing this, Beta testing it here on DBTech, however I'm casting some doubt as to the benefits provided.

These statistics appeared on our forumhome:

Before:
3.06264 + 3.01077 + 3.06281 + 2.43078 + 2.41786 + 2.48318 + 2.20924 + 2.70966 + 2.35011 + 2.47304 = 20.93821 / 8 = 2.61728

After:
2.22115 + 2.25021 + 2.93569 + 2.95017 + 3.42815 + 3.53186 + 2.67434 + 2.72163 + 2.91993 + 3.60208 = 23.41198 / 8 = 2.92650

As you can see, template cache is marginally slower.

Key facts about our server & test setup:
  • Dedicated web server (DB server is a separate server)
  • DBTech is the only site on the server
  • HDD is an Intel 520 SSD
  • Highest & lowest points in both tests were eliminated before an average was determined
  • 100% of the templates involved were cached at the time of testing
  • Our APC instance was set up to cache templates in its file cache
  • 100% of the template includes were cache hits

Of course, YMMV, this isn't me saying "we won't implement this as it's bloody useless!" but I'm saying that I wouldn't expect blistering speeds as a result of this :p
 
Was there a speed test done on thread pages for this? I'm just curious as there is probably more PHP processing going on with showthread/postbit than forumhome.
 
I've done no other speed tests other than the ones listed above.

Additionally, it's been discovered that multiple modifications, including our own Staff Only Hidden Posts, has compatibility issues. The reason for this is, certain mods modify the templates on-the-fly via the process_templates_complete hook, which is too early for vB Optimise to check whether the templates have been stored in the file system already (this has to be done when the template is actually called).

At this time, this appears to be a limitation of what I'm able to do without requiring several file edits.
 
When I turn this feature on.

Your server information at the bottom of my forums (the generated time etc) says there is 614 queries for forumhome and 157 Queries for showthread pages.

I also did turn on the 3rd party option and still the same results?

Using Xcache.

Regards
Mick
 
I'm not sure what you're asking?

Template caches in file system won't fix any poorly written mods you've installed, and the first time you load a page after turning it on you'll find the query count much higher than normal as it fetches a fresh copy of each template. The second time the page loads, it'll be back to normal :)
 
So when you say 'cache templates in file system', does that REALLY mean the file system? By the wording, I'd assume so. Therefore, this does not take advantage of xcache, apc, or memcache, correct?
 
Yes, as you'll see the /dbtech/vboptimise/templatecache folder will fill up with files :p
 
Status
Not open for further replies.
Top