The Big Indian Community

An Open Online Indian Community.

Home
Advanced Search
Nation
Blog
News Feeds
Links
Advanced Search
Contact Us
Discussion
Login Form
Username

Password

Remember me
Password Reminder
No account yet? Create one
Syndicate
Home arrow Technology arrow Be careful rotating MySQL logs
Be careful rotating MySQL logs PDF Print E-mail
Written by Administrator   
Dec 12, 2007 at 01:06 AM

ImageHere is some danger waiting for you at least on typical Linux systems - If you follow most simple process - delete log file you do not need and run “FLUSH LOGS” so file is recreated and space reclaimed you can get into serious trouble

If you enable logging of all queries as “slow queries”  you can get log file to grow huge. Same may happen with general log file. In some cases we’ve got log file sizes of 100G or more which may need to be cleaned up.

Here is some danger waiting for you at least on typical Linux systems - If you follow most simple process - delete log file you do not need and run “FLUSH LOGS” so file is recreated and space reclaimed you can get into serious trouble. File close operation will when perform deletion which can be quite a long process, depending on filesystem and log file size - we’ve seen it to take 10 minutes or more in some cases. When log file is reopened MySQL will be practically unavailable causing unanticipated downtime.

The workaround for this problem is very simple - instead of deleting MySQL log file - rename it, call “FLUSH LOGS” which will be instant as it will not involve complex delete operation and when you can delete the log file you no more need.

It can be also good idea to hook up log rotate to take care of MySQL logs so you would not need to cleanup them manually. In some cases it is already setup if you use MySQL distribution supplied by OS vendor.


User Comments

Comment by GUEST on 2010-01-29 06:43:28
fuuercah uzjwaxkd http://yuacuxkj.com bpendzhr umovkbhk [URL=http://cksivtsz.com]bmzcjvsk[/URL]

Comment by GUEST on 2010-01-29 09:17:58
pmxttdcc zrzcsdyp http://ohmnkykx.com twokpraf svskmvas [URL=http://uvpeqspz.com]hptlcxlc[/URL]

Comment by GUEST on 2010-03-18 20:19:07
bhgradpk hgherwkq http://ygyivzys.com plpvmaxw rxiqetdn [URL=http://fivfjnvf.com]lvxdgoln[/URL]

Comment by GUEST on 2010-08-03 07:48:31
kMnLDt arevzwrqiyxv, [url=http://mcgxpxocalec.com/]mcgxpxocalec[/url], [link=http://mhybvigpmvlg.com/]mhybvigpmvlg[/link], http://wprchegqkwpe.com/

Comment by GUEST on 2010-08-12 03:54:26
2MrG34 Ikfdypm nxkzbfat wqtsvt vzqtcy yatq dumqnh dgox.


Polls
The most influential person in technology in the last 25 years is...
  
Who's Online
We have 6 guests online
Powered by Mambo and template designed by Lavinia  Template Valid w3c XHTML 1.0