Very slow database queries causing db errors
-
Over the past couple months I’ve been having some strange issues with very long database queries which end up crashing the db and turning up the “error: unable to connect to database” message. Rebooting the db container I’m on (Mediatemple is my host) usually clears it up. Any help or ideas would be greatly appreciated.
The site is https://blog.iso50.com
Here is the db log of queries taking over 1 second which was created right after one such crash:
Created 10:00 PM 08/13/2009 ### 427 Queries ### Total time: 34357.839755, Average time: 80.4633249531616 ### Taking 5.289689 to 203.258867 seconds to complete ### Rows analyzed 0 - 312 SET timestamp=XXX; SELECT option_name, option_value FROM wp_options WHERE autoload = 'XXX'; SET timestamp=1250225980; SELECT option_name, option_value FROM wp_options WHERE autoload = 'yes'; ### 281 Queries ### Total time: 22646.863787, Average time: 80.5938213060498 ### Taking 5.212969 to 243.049226 seconds to complete ### Rows analyzed 0 - 312 # User@Host: dbXXX[dbXXX] @ [XXX.XXX.XXX.XXX] # User@Host: db26001[db26001] @ [70.32.68.20] ### 152 Queries ### Total time: 13694.990108, Average time: 90.098619131579 ### Taking 5.212969 to 243.049226 seconds to complete ### Rows analyzed 68 - 312 SET timestamp=XXX; SELECT option_name, option_value FROM wp_options; SET timestamp=1250225990; SELECT option_name, option_value FROM wp_options; ### 17 Queries ### Total time: 1020.516299, Average time: 60.0303705294118 ### Taking 16.693573 to 124.666902 seconds to complete ### Rows analyzed 0 - 0 SET timestamp=XXX; UPDATE <code>wp_options</code> SET <code>option_value</code> = 'XXX' WHERE <code>option_name</code> = 'XXX'; SET timestamp=1250224965; UPDATE <code>wp_options</code> SET <code>option_value</code> = '301766' WHERE <code>option_name</code> = 'akismet_spam_count'; ### 4 Queries ### Total time: 351.330548, Average time: 87.832637 ### Taking 54.716655 , 58.861937 , 116.705437 , 121.046519 seconds to complete ### Rows analyzed 0, 0, 0 and 0 SET timestamp=XXX; INSERT INTO wp_fs_visits (ip, url, time_begin, time_last) VALUES ('XXX','XXX',XXX,XXX); SET timestamp=1250224965; INSERT INTO wp_fs_visits (ip, url, time_begin, time_last) VALUES ('67.175.246.73','/feed/',1250224844,1250224844); ### 3 Queries ### Total time: 269.326101, Average time: 89.775367 ### Taking 74.740510 , 94.089207 , 100.496384 seconds to complete ### Rows analyzed 0, 0 and 0 SET timestamp=XXX; DELETE FROM wp_options WHERE option_name = 'XXX'; SET timestamp=1250225570; DELETE FROM wp_options WHERE option_name = '_transient_doing_cron'; ### 2 Queries ### Total time: 133.638565, Average time: 66.8192825 ### Taking 56.902287 , 76.736278 seconds to complete ### Rows analyzed 0 and 0 SET timestamp=XXX; UPDATE wp_fs_visits SET time_last=XXX,url='XXX' WHERE ip='XXX' AND time_last > XXX; SET timestamp=1250225570; UPDATE wp_fs_visits SET time_last=1250225493,url='/feed/' WHERE ip='209.20.77.74' AND time_last > 1250221893; ### 1 Query ### Total time: 83.756655, Average time: 83.756655 ### Taking 83.756655 seconds to complete ### Rows analyzed 0 use dbXXX_wp; SET timestamp=XXX; SELECT option_name, option_value FROM wp_options WHERE autoload = 'XXX'; use db26001_wp; SET timestamp=1250223480; SELECT option_name, option_value FROM wp_options WHERE autoload = 'yes';
- The topic ‘Very slow database queries causing db errors’ is closed to new replies.