Deleting the ‘messages’ file under /SOURCE/SHARE/var/log/asterisk and rebooting the server would free up some space but it gets full again very fast causing the database to stop functioning.
I have access to the database but i am not sure if there is anything there needs to be checked.
I am not sure what drives the space to be full
Any help/tips are appreciated.
LOTS of database records. This can happen if such a system is exposed to the internet. Each unauthenticated incoming invite will add a few bytes. This can sum up really quickly
Lots of database records due to loops in the dialplan (scripting/actions/redirections). Each call can add 100s of records in few milliseconds
excessive call recording, many voicemails etc
Best to run a “du -sch *” within your filesystem to pinpoint the problematic folder.
You’re using some version of a “classic” server wich will be deprecated by end of month. I suggest to invest a bit of time and to perform an update to a more modern version.
/var is taking almost all the space under /SOURCE/SHARE
/var/log is taking 1.7G
/var/lib is taking 14 G
See below:
root@mobydick:/var# du -sch *
4.0K agentx
1.7M backups
8.6M cache
22M jasperreports
14G lib
0 local
20K lock
1.7G log
76K mail
0 opt
88K queuemetrics
48K rrd
396K run
11M spool
100M tmp
543M www
155M xmppd
2.7M zend
17G total
I have access to the database, however, I tried to check the tables sizes but most of them were in the KB size. Is there a specific where logs or system events might be accumulating ? Is there a way to clean up the database from any accumulated unneeded records without affecting the system functionality ?
I have deleted all the old voice messages, but that only freed less than 500 Mbytes.
Is there a way to stop Asterisk debug log from building up ? Is Debug mode (if any) required to run ?
And yes, the system is exposed to the internet.
I am sorry for all those questions but I really need to fix this issue.
@ali.kalamchi: sounds maybe strange but did you restart the system recently? I can remember that some version had a issue with the filesystem in a way that we continued to log into already deleted files. The filesystem hides such files but the owning process can still write into them.
Please reboot and check again.
Yes I did. In fact the only way to free up the space taken by the log, is to remove the “messages” file, create it again and set it to the correct owner “asterisk” then reboot the system.
However, the space keeps shrinking. few months ago I had like 3.5 GB free, then it fills up, do the steps above, and the space I get becomes smaller. Now I have only 1.4GB taken by the log.
But I can’t figure out what is inflating the database size, or which table.
Any hints on that ? is there a way to cleanup the database from old records/logs or whatever is filling it up ?
Well, as stated above: you probably will have lots of pseudo phonecalls if you exposed your system to the public internet. The table in question is mdphonecallrecord.
It’s like a log for all your calls. You can delete all of it or keep N days without any side effect. Be aware that you will cause heavy IO on your host when you remove many/all rows at once. It might be a good choice to use TRUNCATE TABLE instead of a simple DELETE FROM but you must run vacuum afterwards. PostgreSQL Docs will help you.