Jump to content

More than 100 queries for a thread ?!


Weppa333

Recommended Posts

Posted

@Matt ; btw after conversion, the damn archiving cronjob archives only a hadnful threads per cycle...
Could you point me to the php file where the freaking limit is, so that I remove it, so that after conversion I can "archive" all the old stuff at once, or at least quickly ?

Posted

unless I do not understand the ACP settings, any thread that nobody has seen for more than 7 days will ALSO generate 100 queries (because post cache lasts 7 days - I don't know how long rep cache lasts).


Even if rep cache last forever, a thread no seen in the last 7 days will generate between 20 and 40 queries more than normal ( for 20 posts per page ) If rep cache lasts 7 days too, any thread not seen in 7 days will generate 40 queries more too.



I guess that an alternative way of working would be to avoid caching everything at once in a thread nobody has seen before (eg cache max 5 posts at once). It would make an intelligent use of the thread cache (only threads accessed by 4 people in the last 7 days would be completely cached - a thread only googlebot has seen in the last 7 days wouldn't be cached).


Could be nice to not cache for bots too.


Just suggestions.




Actually I don't think that's quite how it works. I'm not sure exactly how it *does* work, but visit a thread, so it gets cached, there will be 100 queries or so initially. Now refresh, there will be 10-15 queries. Now, go into the ACP -> Cache Management and clear all cached posts. Now refresh, I only get 30 queries or so, not the original 100. Presumably because of things like reputation and such remaining cached. But either way, it makes a huge difference to load times.
  • Management
Posted

Yes PeterUK is right. The short explanation is that there is a lot more to a topic than just the post data. When you convert, the converter just inserts the raw post data. So when that topic is first viewed IPB says "oh wow I'm missing all this other data" and builds it on the fly. The only cache that expires is the post content cache based on your settings.

IPS hosts thousands of communities so if a topic really was taking 100+ queries to load all the time then our hosting department would probably cause our development department to have a very bad day :lol:

Posted

With regards to post caching, it should be noted that you can disable this...however this is a case where extra queries on one page load are typically entirely worth it on subsequent page loads.

Parsing bbcode is an expensive operation - it's just the nature of the best. You're looking through text strings, often using regular expressions, and plucking out bbcode to turn into HTML. When you allow posts to cache, the parsed version is then stored and later used when the page is displayed (up to 7 days by default as you noted, though you can cache longer if you wish, but remember as with everything there is a balance to maintain). As mentioned, you can disable this caching...but the savings you get on subsequent page loads are much much greater than the few milliseconds it takes to insert the cache.

Reputation is a different matter, and as Matt noted, that is primarily because you converted - in normal operation, the inserts you are seeing are stored as the post is made, so you would not typically have all of the reputation caches building on view (but rather, on initial save).

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...