Wednesday, December 14, 2011

cPanel + mysql slow queries to TABLE_SCHEMA

If you are seeing the following in mysqladmin proc for a long time then its basically cPanel calculating account disk usage from the information_schema, this tends to increase the load on some servers.



| 14436 | root           | localhost | mysql          | Query          | 2227 |                    | SELECT TABLE_SCHEMA as DB,SUM(DATA_LENGTH)+SUM(INDEX_LEN
GTH) AS SPACEUSED from information_schema.ta |

You can place the following in your cpanel conifg (/var/cpanel/cpanel.config) to force /scripts/update_db_cache to utilize a `du` style disk calculation. This should help you.

use_information_schema=0

restart cpanel once done :) 

Sunday, November 27, 2011

Unable to mount hard disk/Partition

Yesterday I faced a strange issue, after rebooting the server I noticed that our back drives did not mount automatically. The fstab entries were proper but still the device did not mount. I tried manually

# mount /dev/sdb1 /backup

unable to mount /dev/sdb1 /backup busy or already mounted.

Googled a lot but did not find any fix, checked if the raid setup was causing the issue since we had raid setup sometime back ( although it was not in use )

Did the following to fix this ( try as a last attempt if no other method works :D )


root@server [~]# dmsetup ls 
ddf1_4035305a0590430220202020202020201d9400003a354a45   (253, 2) 
VolGroup00-swap (253, 1) 
VolGroup00-root (253, 0) 
root@server [~]# dmsetup remove ddf1_4035305a0590430220202020202020201d9400003a354a45 
root@server [~]# dmsetup ls 
VolGroup00-swap (253, 1) 
VolGroup00-root (253, 0) 
root@server [~]# mount /dev/sdb1 /backup 


root@server [~]# df -h


/dev/sdb1             276G  223G   39G  86% /backup 




Hope this helps :)