hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Hosting Security and Technology : MySQL 'freezes' every few hours
Reply

Hosting Security and Technology Configuring and optimizing web hosting servers and operating systems, developing administration scripts, building servers, protecting against hackers, and general security (SSL certificates, etc.)
Forum Jump

MySQL 'freezes' every few hours

Reply Post New Thread In Hosting Security and Technology Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 07-09-2007, 08:32 PM
Xandrios Xandrios is offline
Web Hosting Master
 
Join Date: Jun 2004
Location: Bay Area
Posts: 1,317

MySQL 'freezes' every few hours


Hi,

Im running MySQL 5.0.32 on a Debian Etch server. I recently moved a couple sites from a Debian Sarge (with MySQL 4.1) server over, and now MySQL has become very unstable.

Every few hours mysql just hangs on a query. All the following queries are queued and never get executed. The only way to get things running again is forcefully killing and restarting the mysql process. After that things work again...for a few hours.

The logs (error and query log) show nothing exceptional. When it hangs and I do a 'show processlist;' I noticed that everytime a SELECT....IN (a,b,c) query is holding up everything. Could the 'IN ()' be the reason for mysql not completing the query and holding up the rest?

Another option might be to temp. go back to MySQL 4.1...but that is going to be a real problem on Debian Etch

Reply With Quote


Sponsored Links
  #2  
Old 07-10-2007, 02:21 AM
wKkaY wKkaY is offline
Web Hosting Evangelist
 
Join Date: Apr 2003
Location: Melbourne, AU
Posts: 539
When it happens again, look not for the most popular query, rather.. look for the query with longest time spent. What is it?

__________________
WK Woon
CTO | http://www.aflexi.net - A flexible Network
Building the next generation CDN platform - DEMO .... coming soon

Reply With Quote
  #3  
Old 07-10-2007, 02:52 AM
SparkSupport SparkSupport is offline
Web Hosting Master
 
Join Date: May 2006
Posts: 646
Do you have too many swapped out process? Is your my.cnf settings optimized ?

__________________
SparkSupporT
http://sparksupport.com
sales@sparksupport.com
1- 408-335-0493

Reply With Quote
Sponsored Links
  #4  
Old 07-10-2007, 07:38 AM
Xandrios Xandrios is offline
Web Hosting Master
 
Join Date: Jun 2004
Location: Bay Area
Posts: 1,317
Thanks for the replies

The longest running query always is a sleeping one. ie:

| 1260 | user | localhost | user | Sleep | 1233 | | NULL

The one following seems to be the one causing the trouble:

| 3245 | user | localhost | user | Query | 503 | Sending data | SELECT COUNT(*) from cpgn_pictures WHERE approved = 'YES' AND aid IN (1,2,3,5,6,7,8,9,10,11,12,13 |

As you can see the query is from a Coppermine gallery script. It keeps hanging on 'Sending data". This is the case every time the thing 'hangs'.


Initially I used a tweaked my.cnf, but because of the issues I reverted back to the Debian default one. Both have the same effect on the 'crashing'.

Reply With Quote
  #5  
Old 07-10-2007, 08:09 AM
wKkaY wKkaY is offline
Web Hosting Evangelist
 
Join Date: Apr 2003
Location: Melbourne, AU
Posts: 539
Sleep isn't a query

That query you have there looks trivial.

1. How large is that cpgn_pictures table? Is it a MyISAM or InnoDB table? You can check with a show table status.

2. Try running show full processlist when it freezes up and see just how many aid's are in the IN set.

3. Run EXPLAIN on the query and see if it uses an index.

4. How large are your sort and key buffers?

__________________
WK Woon
CTO | http://www.aflexi.net - A flexible Network
Building the next generation CDN platform - DEMO .... coming soon

Reply With Quote
  #6  
Old 07-10-2007, 10:54 PM
ExpressColo-TomW ExpressColo-TomW is offline
WHT Addict
 
Join Date: Jan 2006
Location: ~
Posts: 168
Kind of sounds like a table locking issue.

A prior update/delete is locking the table and then for some reason it is never releasing the lock.

__________________
ExpressColo.net - Fast. Reliable. Affordable.
Dedicated Servers | Colocation | Virtual Servers | AS53255


Reply With Quote
Reply

Related posts from TheWhir.com
Title Type Date Posted
Web Host Rackspace Launches Private Beta for MySQL Cloud Database Web Hosting News 2011-12-01 21:09:51
Parallels Now Offering Licenses for CloudLinux OS Web Hosting News 2011-10-26 17:29:25
cPanel Offers Windows Hosting Control Panel Enkompass for Free Web Hosting News 2011-10-13 17:14:16
Web Hosting Software Firm CloudLinux Releases CloudLinux OS Version 6.1 Web Hosting News 2011-09-13 14:08:49
Web Host FireHost Partners with Cloud Security Firm Gazzang for Data Encryption Web Hosting News 2011-08-16 20:33:43


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?