 |
 |
 |
 |
Registered: 06/05/06
Posts: 709
|
|
|
 |
 |
 |
 |
|
 |
 |
 |
 |
#227943 - 07/28/09 08:31 PM
7.5 Experts? - Getting Database Error Messages
|
journeyman
|
Registered: 10/19/08
Posts: 52
Loc: Largo, Florida
|
|
Our forums ( www.PianoWorld.com/forum) have been acting up the last couple weeks. Seems to be even worse over the last couple days. Members/visitors are encountering this message: UBB Message We encountered a problem. The reason reported was Database error only visible to forum administrators Please click back to return to the previous page. Or, it's taking unusually long to load a page. There is even a thread running about the issues: http://www.pianoworld.com/forum/ubbthreads.php/topics/1237272We are running on multiple Sun Machines with tons of ram. The techs at our hosting service have allocated lots of memory , processing power, and SQL connections to the forums. I'm not technical enough to know where to look or what might be causing the issues. If anyone can help, I'd appreciate it. I'm even willing to pay for some expertise. The forums are an important part of my site.
|
|
Top
|
|
|
|
|
 |
 |
 |
 |
 |
 |
 |
 |
|
Express Hosting
"We are the official hosting company of UBB.threads. Ask us about our free migration services to migrate your UBB.threads installation."
|
|
|
 |
 |
 |
 |
 |
 |
 |
 |
#227959 - 07/29/09 12:25 PM
Re: 7.5 Experts? - Getting Database Error Messages
[Re: PianoWorld]
|
stranger
|
Registered: 07/29/09
Posts: 5
|
|
Hi, Im the admin of the system in question that pianoworld is referring to.
During a system backup, there's a fair bit of file IO going on, and of course the forums are still up and running as usual. If there's alot of activity (say a few forum searches in the large forum system), things can get very heavily loaded and slow for short periods of time. Sometimes however, it seems to stop completely.
I watched this happen today, and so stopped the backup, checked for anything else on the server using IO and killed it, and the system was completely idle. The main website (outside UBB) was peppy, and mysql on the cmd line for even complex queries was very fast. However the forums were still not working, generating that error.
Only after stopping and restarting apache and mysql did things recover. (Im thinking stopping mysql didnt do anything, it was apache). My guess is there's a connection pool to mysql that UBB uses and it got filled with a number of requests that wedged while the server was busy for a short period, but then all other queries piled up behind.
The most curious thing is that this has been happening off and on for the last few weeks, but the system eventually recovers. Im wondering how it does, and when - what's it waiting for when the system is already idle for several minutes before it recovers? I dont see any crontabs installed that would do some regular 'cleanup' operation... So what's causing it to unwedge, and why doesn't it happen faster once load dissipates?
(Obviously this connection pooling is my personal theory with no evidence, just have seen it with other applications in the past - wondering what I should do/run/look at to verify that's what's happening.)
Thanks.
-math
|
|
Top
|
|
|
|
|
 |
 |
 |
 |
 |
 |
 |
 |
#227982 - 07/30/09 02:45 PM
Re: 7.5 Experts? - Getting Database Error Messages
[Re: Ruben]
|
journeyman
|
Registered: 10/19/08
Posts: 52
Loc: Largo, Florida
|
|
Thanks Ruben and Allen, The test file was created, but I presumed I'd find the error log in that directory, not realizing there was a link in the control panel to logs / MySQL errors. Duh
Now that I'm looking in the right place, getting lots of messages like this... (which Allen said I'd see because of something he was doing). Keeping an eye on it now.
Thu, Jul 30 2009 14:31:28 -0400 65.55.211.115 Script: - Line: Unable to connect to the database! - Too many connections Thu, Jul 30 2009 14:31:30 -0400 129.49.176.44 Script: - Line: Unable to connect to the database! - Too many connections Thu, Jul 30 2009 14:31:31 -0400 84.250.214.112 Script: - Line: Unable to connect to the database! - Too many connections Thu, Jul 30 2009 14:31:31 -0400 98.174.219.202 Script: - Line: Unable to connect to the database! - Too many connections Thu, Jul 30 2009 14:31:35 -0400 72.30.142.244 Script: - Line: Unable to connect to the database! - Too many connections Thu, Jul 30 2009 14:31:35 -0400 24.131.130.193 Script: - Line: Unable to connect to the database! - Too many connections Thu, Jul 30 2009 14:31:38 -0400 140.163.254.27 Script: - Line: Unable to connect to the database! - Too many connections Thu, Jul 30 2009 14:31:39 -0400 142.46.193.2 Script: - Line: Unable to connect to the database! - Too many connections Thu, Jul 30 2009 14:31:39 -0400 206.53.153.153 Script: - Line: Unable to connect to the database! - Too many connections Thu, Jul 30 2009 14:31:40 -0400 205.188.116.135 Script: - Line: Unable to connect to the database! - Too many connections Thu, Jul 30 2009 14:31:43 -0400 207.5.251.246 Script: - Line: Unable to connect to the database! - Too many connections Thu, Jul 30 2009 14:31:43 -0400 84.250.214.112 Script: - Line: Unable to connect to the database! - Too many
Edited by PianoWorld (07/30/09 02:50 PM) Edit Reason: added details
|
|
Top
|
|
|
|
|
 |
 |
 |
 |
 |
 |
 |
 |
#228005 - 07/30/09 07:06 PM
Re: 7.5 Experts? - Getting Database Error Messages
[Re: JAISP]
|
old hand
|
Registered: 02/10/07
Posts: 1144
|
|
Sounds like your not able to connect to the database. Thu, Jul 30 2009 14:31:28 -0400 65.55.211.115 Script: - Line: Unable to connect to the database! - Too many connections
Thu, Jul 30 2009 14:31:30 -0400 129.49.176.44 Script: - Line: Unable to connect to the database! - Too many connections
Thu, Jul 30 2009 14:31:31 -0400 84.250.214.112 Script: - Line: Unable to connect to the database! - Too many connections
Thu, Jul 30 2009 14:31:31 -0400 98.174.219.202 Script: - Line: Unable to connect to the database! - Too many connections
Thu, Jul 30 2009 14:31:35 -0400 72.30.142.244 Script: - Line: Unable to connect to the database! - Too many connections
Thu, Jul 30 2009 14:31:35 -0400 24.131.130.193 Script: - Line: Unable to connect to the database! - Too many connections
Thu, Jul 30 2009 14:31:38 -0400 140.163.254.27 Script: - Line: Unable to connect to the database! - Too many connections
Thu, Jul 30 2009 14:31:39 -0400 142.46.193.2 Script: - Line: Unable to connect to the database! - Too many connections
Thu, Jul 30 2009 14:31:39 -0400 206.53.153.153 Script: - Line: Unable to connect to the database! - Too many connections
Thu, Jul 30 2009 14:31:40 -0400 205.188.116.135 Script: - Line: Unable to connect to the database! - Too many connections
Thu, Jul 30 2009 14:31:43 -0400 207.5.251.246 Script: - Line: Unable to connect to the database! - Too many connections
Thu, Jul 30 2009 14:31:43 -0400 84.250.214.112 Script: - Line: Unable to connect to the database! - Too many I knew that's what was happening.
|
|
Top
|
|
|
|
|
 |
 |
 |
 |
 |
 |
 |
 |
#228054 - 08/01/09 09:51 AM
Re: 7.5 Experts? - Getting Database Error Messages
[Re: JAISP]
|
journeyman
|
Registered: 10/19/08
Posts: 52
Loc: Largo, Florida
|
|
There is another list of them this morning.
The Forums keep functioning anyway, so it must be that with enough people accessing the forums at one time, it runs out of connections?
Sat, Aug 01 2009 07:38:47 -0400 24.186.32.192 Script: - Line: Unable to connect to the database! - Too many connections Sat, Aug 01 2009 07:38:47 -0400 76.235.133.221 Script: - Line: Unable to connect to the database! - Too many connections Sat, Aug 01 2009 07:38:49 -0400 71.57.238.41 Script: - Line: Unable to connect to the database! - Too many connections Sat, Aug 01 2009 07:38:52 -0400 66.235.112.5 Script: - Line: Unable to connect to the database! - Too many connections Sat, Aug 01 2009 07:38:56 -0400 72.30.142.244 Script: - Line: Unable to connect to the database! - Too many connections Sat, Aug 01 2009 07:39:02 -0400 65.55.106.196 Script: - Line: Unable to connect to the database! - Too many connections Sat, Aug 01 2009 07:39:05 -0400 65.55.106.183 Script: - Line: Unable to connect to the database! - Too many connections Sat, Aug 01 2009 07:39:05 -0400 174.142.104.57 Script: - Line: Unable to connect to the database! - Too many connections Sat, Aug 01 2009 07:39:06 -0400 71.57.238.41 Script: - Line: Unable to connect to the database! - Too many connections Sat, Aug 01 2009 07:39:08 -0400 124.182.142.182 Script: - Line: Unable to connect to the database! - Too many connections Sat, Aug 01 2009 07:39:14 -0400 65.55.106.168 Script: - Line: Unable to connect to the database! - Too many connections Sat, Aug 01 2009 07:39:14 -0400 72.30.142.244 Script: - Line: Unable to connect to the database! - Too many connections Sat, Aug 01 2009 07:39:18 -0400 124.107.217.181 Script: - Line: Unable to connect to the database! - Too many connections Sat, Aug 01 2009 07:39:21 -0400 134.184.84.204 Script: - Line: Unable to connect (it just keeps going like this).
|
|
Top
|
|
|
|
|
 |
 |
 |
 |
 |
 |
 |
 |
#228277 - 08/11/09 01:36 PM
Re: 7.5 Experts? - Getting Database Error Messages
[Re: AllenAyres]
|
stranger
|
Registered: 07/29/09
Posts: 5
|
|
Figured out the problem.
When users search for stuff, they cause huge joins that take 2-3 minutes to run. The tables are all locked while this runs of course. So for 2-3 minutes (on this particular query, some could be faster, and some could be even slower, i just caught this one), nothing works. All the other queries just sit spinlocked on the db. This time 80 queries piled up in 2 minutes. With 250 max connections to the db, that could run out and generate the error.
Even with 5000 max connections tho, even if we never hit the max, the users see the site loading and not displaying anything however.
Slow queries/searches must die.
The tables involved in this are all indexed (except topic status, I added an index, didnt help):
SELECT p.POST_ID FROM ubbt_POSTS p LEFT JOIN ubbt_POSTS pp on p.POST_ID=pp.POST_ID, ubbt_TOPICS t WHERE p.POST_IS_APPROVED = '1' AND t.TOPIC_STATUS <> 'M' AND t.FORUM_ID IN ('1','2','3','4','5','6','7','9','10','11','12','15','17','18','19','20','21','22','23','25','26','27','29','30','31','32','33','35','39','41','42','43','44') AND p.TOPIC_ID = t.TOPIC_ID AND MATCH p.POST_SUBJECT AGAINST ('\\"nothing else matters\\"' IN BOOLEAN MODE) ORDER BY p.POST_POSTED_TIME DESC LIMIT 300;
Not sure what generated that query, but it took 2 minutes to run.
No, the machine is relatively fast, this is just a really large UBB forum system (~91,000 topics,
another query that gummed things up:
select t1.TOPIC_ID,t1.POST_ID,t2.USER_DISPLAY_NAME,t1.TOPIC_CREATED_TIME,t1.TOPIC_LAST_REPLY_TIME,t1.TOPIC_SUBJECT, t1.TOPIC_STATUS,t1.TOPIC_IS_APPROVED,t1.TOPIC_ICON,t1.TOPIC_VIEWS,t1.TOPIC_REPLIES,t1.TOPIC_TOTAL_RATES, t1.TOPIC_RATING,t3.USER_NAME_COLOR,t2.USER_MEMBERSHIP_LEVEL,t1.USER_ID,t1.TOPIC_IS_STICKY,t1.TOPIC_LAST_POSTER_ID, t1.TOPIC_LAST_POSTER_NAME,t1.TOPIC_LAST_POST_ID,t1.TOPIC_IS_EVENT,t1.TOPIC_HAS_FILE,t1.TOPIC_HAS_POLL,t1.TOPIC_POSTER_NAME,t1.TOPIC_THUMBNAIL,t4.POST_BODY,t3.USER_GROUP_IMAGES from ubbt_TOPICS as t1 left join ubbt_USERS as t2 on t1.USER_ID = t2.USER_ID left join ubbt_USER_PROFILE as t3 on t1.USER_ID = t3.USER_ID left join ubbt_POSTS as t4 on t1.POST_ID = t4.POST_ID where t1.FORUM_ID = 10 and t1.TOPIC_IS_STICKY = '0' AND t1.TOPIC_IS_APPROVED = '1' ORDER BY t2.USER_DISPLAY_NAME asc LIMIT 25;
Im not getting how ubb admin panel is telling me there's 500mb of data in the tables, and Ive got a InnoDB cache/buffer size setting in my.cnf of 2048Mb. You'd think there'd be enough space to mess around in and make things super fast.
What's the solution here? Throwing faster machinery at the problem? How about optimizing these queries or something?
Another solution is to run mysql in ramdisk only and replicate to actual disk. Or use a disk-backed ram disk system... seems all like a hack to avoid fixing the root problem tho.
|
|
Top
|
|
|
|
|
 |
 |
 |
 |
 |
 |
 |
 |
#228291 - 08/11/09 05:14 PM
Re: 7.5 Experts? - Getting Database Error Messages
[Re: Rick]
|
journeyman
|
Registered: 10/19/08
Posts: 52
Loc: Largo, Florida
|
|
Isn't one search = to one connection? Shouldn't it be able to more or less run in the background without bringing down the rest of the forums?
In simple terms it has to lock the table in order to do the query. When the table is locked then other queries on that table will stack up until it's done. There are a few solutions that some sites will do such as having a slave database that is strictly just for searches. So when a search is done it's done on the slave and won't block other queries. There are a few things we're going to try and do to help with search speed, but it's always a sticking point especially when it's done on all posts in the database. Ok, got it, thanks. Then in theory, would it be possible to rework the search interface to restrict searches to specific blocks? I'm thinking of a series of Radio buttons: * Past Month * Past 6 Months * 1 Year Ago (a 6 month search of Aug 2008 - Feb. 2009) * 2 Years Ago (where it will search Aug. 2007 to Aug. 2008) * 3 Years Ago (where it will only search Aug. 2006 - Aug. 2007) I know, probably making it more complicated than it needs to be. It's just that there are still posts with some value going back years. I'd hate to cut people off from those. By the same token, it's annoying a lot of our members/visitors when the forums lock up, and I'm sure it's scaring away some new potential members. We already have some pretty decent hardware cranking, I keep hoping there is a coding/development solution lurking in here somewhere.
|
|
Top
|
|
|
|
|
 |
 |
 |
 |
|
|