Site Links
Home
Features
Documentation
Pricing & Order
Members Area
Support Options
UBBDev.com
UBBWiki.com
Who's Online
2 registered (driv, Outdoorking), 40 Guests and 14 Spiders online.
Key: Admin, Global Mod, Mod
Featured Member
Registered: 11/22/06
Posts: 163
Top Posters (30 Days)
Ruben 51
DennyP 24
Gizmo 24
Dunny 15
SteveS 14
AllenAyres 12
dbremer 10
SD 10
drkknght00 9
doug 8
Latest Photos
OK Corral Shoot Out
Testing
Basildon Train Station
Basildon Town Centre looking from the rounderbout
Basildon Town Square
Page 4 of 4 < 1 2 3 4
Topic Options
#207047 - 02/22/08 06:32 PM Re: General MySQL question [Re: jgeoff]
jgeoff Offline
Pooh-Bah
Registered: 08/08/06
Posts: 1922
Loc: NJ
Originally Posted By: jgeoff
Out of curiosity I ran the same thing to compare...

Slow_queries 642
Handler_read_rnd 30 M
Handler_read_rnd_next 913 M
Qcache_lowmem_prunes 141 k
Slow_launch_threads 4 - The number of threads that have taken more than slow_launch_time seconds to create
Created_tmp_disk_tables 13 k
Select_full_join 1,418
Select_range_check 4 - The number of joins without keys that check for key usage after each row. (If this is not 0, you should carefully check the indexes of your tables.)
Opened_tables 23 k
Table_locks_waited 3,349


Sorry to piggy-back on Basil's thread, but I seem to have similar issues. My web host enabled the slow queries log and came up with the following:
Quote:


The main forum pages loads in 3 seconds for me, but I do see this in the log:

# Time: 080222 17:04:19
# User@Host: gbb_admin[gbb_admin] @ localhost []
# Query_time: 34 Lock_time: 0 Rows_sent: 1 Rows_examined: 91692
select COUNT(*) as posts,
sum(t1.POST_IS_TOPIC) as topics
from ubbt_POSTS as t1,
ubbt_TOPICS as t2
where t2.FORUM_ID = 14
and t1.TOPIC_ID = t2.TOPIC_ID
and t1.POST_IS_APPROVED = '1'
and t1.POST_POSTED_TIME > 120336
4960;

They said
Quote:
Something in the tables Phil listed is causing the problem. You may want to review them in phpmyadmin to make sure there isn't bad data in there.
but I don't understand what the log entry is telling me. I had some "overhead" so optimized my tables, but not sure what else I can do...
_________________________
GangsterBB.NET (Ver. 7.5.6)
2007 Content Rulez Contest - Hon Mention
UBB.classic 6.7.2 - RIP
Browsers: Chrome, Firefox, & Safari (Win7 and iPhone); No IE, ever!
Top
Express Hosting
Express Hosting "We are the official hosting company of UBB.threads. Ask us about our free migration services to migrate your UBB.threads installation."
#207064 - 02/22/08 08:46 PM Re: General MySQL question [Re: jgeoff]
David Dreezer Offline

Pooh-Bah
Registered: 07/21/06
Posts: 2199
Rick should look at this. You've got a pretty high number of posts but geez. If I'm reading this right it's counting how many posts are in ubbt_POSTS and and how many topics are in ubbt_TOPICS for forum 14 that are approved and have been posted since 1203364960.

Shouldn't be a big deal. It's only 91k rows. It's scanning all of them though, but still it's only 91k rows.
_________________________
This thread for sale. Click here!
Top
#207097 - 02/23/08 03:33 AM Re: General MySQL question [Re: David Dreezer]
jgeoff Offline
Pooh-Bah
Registered: 08/08/06
Posts: 1922
Loc: NJ

"Only" 91,000 rows... Why is this query even happening??

Forum #14 happens to be my (dreaded!) "Word Games" forum where idiots post nonsense over and over to build their post counts (hence I cannot wait for 7.3 so all that doesn't count any more!)...

And most importantly... could this be causing the server lag I've been experiencing?
_________________________
GangsterBB.NET (Ver. 7.5.6)
2007 Content Rulez Contest - Hon Mention
UBB.classic 6.7.2 - RIP
Browsers: Chrome, Firefox, & Safari (Win7 and iPhone); No IE, ever!
Top
#207104 - 02/23/08 09:57 AM Re: General MySQL question [Re: jgeoff]
jgeoff Offline
Pooh-Bah
Registered: 08/08/06
Posts: 1922
Loc: NJ
It's not just Forum 14... and it gets worse...
Originally Posted By: My Web Host
There are a number of slow query logs for your database, but they are all pretty much identical to what Phil posted. The last one is:

User@Host: gbb_admin[gbb_admin] @ localhost []
# Query_time: 12 Lock_time: 0 Rows_sent: 1 Rows_examined: 131650
select COUNT(*) as posts,
sum(t1.POST_IS_TOPIC) as topics
from ubbt_POSTS as t1,
ubbt_TOPICS as t2
where t2.FORUM_ID = 5
and t1.TOPIC_ID = t2.TOPIC_ID
and t1.POST_IS_APPROVED = '1'
and t1.POST_POSTED_TIME > 1172184193;

We don't have anything aside from those queries that are showing fairly slow.
_________________________
GangsterBB.NET (Ver. 7.5.6)
2007 Content Rulez Contest - Hon Mention
UBB.classic 6.7.2 - RIP
Browsers: Chrome, Firefox, & Safari (Win7 and iPhone); No IE, ever!
Top
#207138 - 02/23/08 06:12 PM Re: General MySQL question [Re: jgeoff]
Rick Offline
Post-a-holic
Registered: 06/04/06
Posts: 10164
Loc: Aberdeen, WA
Let me guess. You have the "Show total # of unread posts per forum?" checked under Forum Summary Options. Where right under it, it says:

Warning: This can cause excess load and contribute to slow speed.

laugh

Basically, if someone never reads a forum, every time they visit it has to figure out how many unread posts are in each forum. As the number of topics and posts grow, the number of rows that are scanned grows.

If all of your users regularly visit each forum, the queries are pretty quick. But if they only visit a few of the forums, the number of unread posts in the other forums grow, leading to larger query times.

One of the main reasons you don't see this feature on many other forums, is there is no non-resource intensive way to do it. We kept it in as an option because some people love it, but it's a resource hog, plain and simple wink

Forum Display Options has another one of these features with the same warning.


Edited by Rick (02/23/08 06:15 PM)
Top
#207145 - 02/23/08 06:41 PM Re: General MySQL question [Re: Rick]
jgeoff Offline
Pooh-Bah
Registered: 08/08/06
Posts: 1922
Loc: NJ

Yes, I do have that enabled. whistle wink But does it make sense that normally I'll see something like "Generated in 0.01 seconds in which 0 seconds were spent on a total of 22 queries" but just periodically (some good days, some bad days) it'd take 10-20-30 or even close to a minute to load the page?

And if I wanted to test this, is there a way to "Mark All Read" for every member, and/or, if I uncheck the box will it clear all that info out of the database?

Thanks,

JG
_________________________
GangsterBB.NET (Ver. 7.5.6)
2007 Content Rulez Contest - Hon Mention
UBB.classic 6.7.2 - RIP
Browsers: Chrome, Firefox, & Safari (Win7 and iPhone); No IE, ever!
Top
#207152 - 02/23/08 07:15 PM Re: General MySQL question [Re: jgeoff]
Gizmo Offline

Registered: 06/05/06
Posts: 14995
Loc: Portland, OR; USA
Yes, you could have an influx of users at those times that work a certain shift that come in at the period your forums choke that rarely visit certain forums...
_________________________
Forums: UGN Security & VNC Web Design & Development
UBB.Threads: UBB.Wiki, My UBBSkins, UBB.Sitemaps
Longtime UBB Supporter, UBB Beta Tester & Resident Post-A-Holic.
UBB Modifications, Styling, Coding Services, Disaster Recovery, and more!
Top
#207290 - 02/25/08 02:15 PM Re: General MySQL question [Re: Rick]
jgeoff Offline
Pooh-Bah
Registered: 08/08/06
Posts: 1922
Loc: NJ
Originally Posted By: Rick
Let me guess. You have the "Show total # of unread posts per forum?" checked under Forum Summary Options. Where right under it, it says:

Warning: This can cause excess load and contribute to slow speed.

laugh


Well, I disabled both about 26 hours ago and {knock on wood} haven't had a single lag issue since, so thanks! whistle ...but some of my members are bitching about it being gone. laugh I may try one or the other and see how that works out as a compromise. But in any event - that seems to have made a big difference, so thanks! cool
_________________________
GangsterBB.NET (Ver. 7.5.6)
2007 Content Rulez Contest - Hon Mention
UBB.classic 6.7.2 - RIP
Browsers: Chrome, Firefox, & Safari (Win7 and iPhone); No IE, ever!
Top
Page 4 of 4 < 1 2 3 4



Moderator:  AllenAyres, Harold, Ian, Ron M 
Shout Box

Today's Birthdays
No Birthdays
Recent Topics
Due Date Calculator-Calculate When Your Baby is Due
by StewartMyduedate
Today at 12:54 AM
Temporary Password email not being received
by
05/24/12 10:02 PM
Ability to "like" individual posts (not Facebook "likes)
by doug
05/23/12 09:03 AM
Island Permissions
by ThreadsUser
05/22/12 03:03 PM
streaming video
by prkrgrp
05/20/12 07:02 PM
Forum Stats
10491 Members
36 Forums
33842 Topics
181709 Posts

Max Online: 978 @ 06/24/07 11:19 PM
Random Image