The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Query locking tables and stacking queries - need help understanding
Our forum has been lagging a lot at night, even crashing. We've done a lot of hardware changes to manage it, but it's not enough. After this morning's lag, server support told me:
queries had locked tables in the DB, causing the queries after them to stack up until the limit was hit. The query causing the lock at the time of the logging snapshot was showing as follows : ---------------------------------------------------------------- 3669084 Query SELECT threadid, title, prefixid, lastpost, replycount FROM vb_thread AS thread WHERE forumid = 10 AND visible = 1 AND open <> 10 ORDER BY dateline DESC LIMIT 182750,250 ________________ I get the gist of it: this one query was locking a table that other queries needed, so those queries queued up until the table was unlocked. What I don't get - What is this query? Is this one of the scheduled tasks? Our forum database is very large. Server support suggests archiving posts, but we dont' want to make posts unsearchabel/unfindable... note: while our forum has been around a long time, I never was involved in the guts at this level. I am trying to learn and come up to speed as quickly as possible. thanks |
#2
|
|||
|
|||
I did a search of the code for that query, and it looks like it's from archive/index.php. It also looks like you must have hundreds of thousands of threads in one forum, which is what I believe is causing the problem. The query is doing an "order by dateline" and there's an index on dateline for the thread table, which would be good, except that there's no index by the open or visible columns which I think means that all rows have to be read in order to find the right 250 rows to return. In short, I think it's just not optimized for having that many threads in a forum.
But if your forum is like ours (not vbulletin.org, but the one I help run), then you probably have spiders constantly crawling the entire site. So maybe a solution would be to try the "Ban Spiders by User Agent" mod to try to eliminate the unwanted spiders. |
#3
|
|||
|
|||
Thanks Kevin. Yes, we definitely have a forum with that many threads..
I ask you to bear with me while I'm learning this stuff.. so I may ask bad questions.. archive/index.php.. sounds like somethat's archiving? If that's the case, why would it archive old threads and not just the newer? Or is it, but it's sorting by date first? I don't understand " there's no index by the open or visible columns" Yes, we have lots of spiders.. Baidu has been a royal pita. I've updated the robots.txt, but out of 200 spiders - they're 90%. Course, I know that the users online isn't up to the second, but still? Thanks for referring a product, but we avoid 3rd party additions when possible. Is there another fix to this? Any idea what makes the query run? With your reference to spiders, it sounds like they may be responsible? thanks again! |
#4
|
||||
|
||||
Quote:
Quote:
Quote:
Quote:
Re-reading the above, I realize that I'm not an expert in much at all, so I'm not sure I've done anything other than producing more questions. But other people here will know more, and you could also ask on vbulletin.com, if you haven't already. |
Благодарность от: | ||
tbworld |
#5
|
|||
|
|||
Thanks for the feedback, Kevin. Any information is useful.
|
#6
|
||||
|
||||
The archive does not archive anything, it just was supposed to be a lightweight version of the forum for serch spiders. That was useful a long time ago, nowadays its just not needed anymore. Don't bother with that query, just turn it off in AdminCP.
|
#7
|
|||
|
|||
Quote:
If you do not mind me asking, how did it help the search engines? |
#8
|
||||
|
||||
By presenting the content in a very accessible way, with much less "clutter" (table-layout, menus and stuff) than the real thing. No need for that anymore in 2014.
|
#9
|
|||
|
|||
I really appreciate all the feedback here - I have a LOT to learn.
Interestingly - couple nights ago, we had no problems. Last night, we had lockups again.... same query, so we're looking at shutting it down. Owner has a question though - and I'm hoping someone here can answer it - When I turn off the query (still gotta figure out how, hoping it's an easy control in the Admin Panel) - what happens to the pages that have already been generated? Will they remain? And will the "archive" link (at the bottom of our forum) remain or is it all tied together? thanks again everyone for their patience. --------------- Added [DATE]1391103124[/DATE] at [TIME]1391103124[/TIME] --------------- Well.. I answered my own question. I turned off the option (Admin Panel ->options->Search Engine Friendly archive). The link went away, the address doesn't work and old links don't work. Course, I don't know if the old table is still there and if I turn it back on if everything will be back. Or if it will restart the query .. which I do NOT want to do. |
#10
|
||||
|
||||
You could add an index that will help that query ;
Code:
ALTER TABLE vb_thread ADD INDEX forumid_dateline (forumid, dateline); |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|