Jump to content


Photo
* * * * * 2 votes

More than 100 queries for a thread ?!


  • Please log in to reply
29 replies to this topic

#21 Syscrusher

Syscrusher

    IPB Member

  • Members
  • PipPip
  • 82 posts

Posted 31 March 2012 - 04:21 PM

So the number queries would be around 30 after that?
But what about page execution time? Is 0.8 - 0.95 execution time to be expected on a thread with 1000+ replies?


On my live board running IPB 3.2.3 with the Similar Topics hook, a thread with 1036 replies took .1455s to execute with 15 queries. A thread with 14,082 replies took .1236s to execute with 14 queries. Those numbers seem reversed based on the size of the threads, and obviously can and will vary, but they are pretty average for me.

#22 PeterUK

PeterUK

    IPB Full Member

  • Members
  • PipPipPip
  • 188 posts

Posted 31 March 2012 - 04:58 PM

For me, a thread with 32,880 (that's not a typo) replies takes on average 0.154s to load (after caching). That's after 10 refreshes taking the average.

But as I said, you really can't compared load times. You could have the best hardware in the world, and a badly configured web or database server can heavily increase load times.

#23 Alfa1

Alfa1

    Advanced Member

  • Members
  • PipPipPipPip
  • 450 posts

Posted 31 March 2012 - 11:28 PM

My hardware and configuration is optimal and can easily handle 10k concurrent users without hiccups.
Those load times give me a pretty positive outlook on IPB. This is helpful.

#24 Matt

Matt

    Chief Software Architect

  • IPS Management
  • 26,142 posts

Posted 01 April 2012 - 03:10 AM

It's worth noting that when a topic has been archived (new to 3.3) the queries drop to about 6 or 7 as it doesnt need to check followers and likes.

Matt Mecham
Invision Power Services, Inc.
"I love deadlines. I especially like the whooshing sound they make as they go flying by."
-- Douglas Adams (1952 - 2001)


#25 Weppa333

Weppa333

    IPB Full Member

  • Members
  • PipPipPip
  • 168 posts

Posted 01 April 2012 - 03:13 AM

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.

#26 Weppa333

Weppa333

    IPB Full Member

  • Members
  • PipPipPip
  • 168 posts

Posted 01 April 2012 - 03:15 AM

@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 ?

#27 PeterUK

PeterUK

    IPB Full Member

  • Members
  • PipPipPip
  • 188 posts

Posted 01 April 2012 - 06:34 AM

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.

#28 Charles

Charles

    Needs Life

  • IPS Management
  • 9,033 posts

Posted 01 April 2012 - 07:12 AM

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:
  • AndyF likes this

Charles Warner
Invision Power Services, Inc. - President
charles.warner@invisionpower.com

 

Please do not PM me but feel free to contact me by email.


#29 Alfa1

Alfa1

    Advanced Member

  • Members
  • PipPipPipPip
  • 450 posts

Posted 01 April 2012 - 11:09 AM

I'm glad that this is a non-issue.

#30 bfarber

bfarber

    RBT-KS

  • IPS Management
  • 28,617 posts

Posted 02 April 2012 - 08:50 AM

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).

Brandon Farber
Development Manager / Senior Support

If it sounds like fun, it's not allowed on the bus!

php5_zce_logo_new.gif     

Invision Power Services, Inc.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users