View previous topic :: View next topic |
Author |
Message |
Napalm Llama Guru
Joined: 04 Jun 2005 Posts: 533 Location: Cardiff, UK
|
Posted: Mon Nov 20, 2006 6:48 pm Post subject: MySQL is eating my /var |
|
|
I returned home today to notice that my emerge -e world had failed due to lack of disk space. On further investigation, it turns out that /var is 100% full - with over 2.5Gb of its 4Gb residing in /var/lib/mysql.
Now all I knowingly use MySQL for on a regular basis is my Amarok database, and I'm fairly sure that's not whats causing it. There are a couple of massive files called /var/lib/mysql/splig-bin.000xxx (splig is my hostname), the largest of which is just a shade over 1Gb.
Now I don't know a lot about MySQL, so could someone tell me if these files are really needed? Have I been pwnd? What's going on?
Cheers,
NL _________________ Ryzen 5600x; Asus TUF Gaming B550-Plus; Geforce 1660 Super
Registered Linux User #381314
# killall humans |
|
Back to top |
|
|
kashani Advocate
Joined: 02 Sep 2002 Posts: 2032 Location: San Francisco
|
Posted: Mon Nov 20, 2006 7:07 pm Post subject: |
|
|
What you're seeing are bin-log logs. Mysql writes them and uses them for table recovery and replication. To see what Mysql is logging do
Code: | mysqlbinlog <filename> | less |
If a db crash won't bother you greatly or you feel that nightly backups are fine since you're db doesn't update often then remove the bin-log line from your /etc/mysql/my.cnf, restart mysql, and then delete them.
However I recommend putting a weekly cron in that runs the following which will remove all but the last seven days of logs. That should solve your space issues and keep enough logs for Mysql to use for recovery if needed.
Code: | PURGE MASTER LOGS BEFORE DATE_SUB( NOW( ), INTERVAL 7 DAY); |
kashani _________________ Will personally fix your server in exchange for motorcycle related shop tools in good shape. |
|
Back to top |
|
|
Napalm Llama Guru
Joined: 04 Jun 2005 Posts: 533 Location: Cardiff, UK
|
Posted: Tue Nov 21, 2006 3:12 am Post subject: |
|
|
Cool - just one thing, though. I'm assuming here that your command is SQL, in which case, where do I put it to get it automated? _________________ Ryzen 5600x; Asus TUF Gaming B550-Plus; Geforce 1660 Super
Registered Linux User #381314
# killall humans |
|
Back to top |
|
|
zeek Guru
Joined: 16 Nov 2002 Posts: 480 Location: Bantayan Island
|
Posted: Tue Nov 21, 2006 5:47 am Post subject: |
|
|
Napalm Llama wrote: | Cool - just one thing, though. I'm assuming here that your command is SQL, in which case, where do I put it to get it automated? |
I think this should work. In /etc/mysql/my.cnf add
Code: | expire_logs_days = 1 |
Adjust 1 to how many days you want to keep logs around. |
|
Back to top |
|
|
robin_elvin n00b
Joined: 25 Nov 2004 Posts: 16 Location: Dereham, Norfolk, England
|
Posted: Tue Nov 21, 2006 8:02 pm Post subject: |
|
|
Excellent! I was wondering why my filesystem was full
Just as a side note
Code: | expire_logs_days = 1 |
goes in the
section of /etc/mysql/my.cnf |
|
Back to top |
|
|
madhusker Tux's lil' helper
Joined: 03 Jan 2004 Posts: 82 Location: Illinois
|
Posted: Thu Dec 14, 2006 3:47 am Post subject: |
|
|
I am surprised that this is not listed in the config file. At least put it in the file,, commented out or something!!!
This "feature" ate my machine for lunch with 24G of useless logs.
A sane default of 30 days or something would be nice. |
|
Back to top |
|
|
Acoc Apprentice
Joined: 06 Aug 2004 Posts: 189 Location: New Jersey, USA
|
Posted: Sun Dec 17, 2006 6:48 am Post subject: |
|
|
I agree, it doesn't make sense why they wouldn't, because I think if you set it to 0, it serves the same function as having it off. They should at least set it at 0 and put comments about what it does.
John _________________ _There were plenty of times in my century when I was gonna give up, but I never did. Never! Hey, are you even listening to me? Oh, I give up._ Futurama |
|
Back to top |
|
|
olsberg n00b
Joined: 24 Sep 2003 Posts: 19 Location: Sweden
|
Posted: Thu Aug 02, 2007 7:47 am Post subject: |
|
|
I totally agree on this proposal. I still do not the the line in my.cnf and my mysql installation eats up 20GB in five days - resulting in server downtime.
Line now added manually, but gosh, this has been a time-consuming search for solutions. |
|
Back to top |
|
|
PraetorZero Apprentice
Joined: 11 Dec 2004 Posts: 239 Location: /home
|
Posted: Sun Jan 24, 2010 3:50 pm Post subject: |
|
|
This is an old topic but still very relevant. I've ran into this twice now in the past 6 months and only just now found this thread. _________________ What's the worst that can happen? |
|
Back to top |
|
|
Napalm Llama Guru
Joined: 04 Jun 2005 Posts: 533 Location: Cardiff, UK
|
Posted: Tue Jan 26, 2010 8:17 pm Post subject: |
|
|
Hmm, does anyone else feel like filing a bug report asking for the default setting to be changed, or shall I? It won't happen otherwise. _________________ Ryzen 5600x; Asus TUF Gaming B550-Plus; Geforce 1660 Super
Registered Linux User #381314
# killall humans |
|
Back to top |
|
|
|