System Sizing, Storage etc

Someone asked a question elsewhere and I assembled an answer there some may find helpful when trying to plan deployments. so I will also put it here as a main topic.

From a base install of FreePBX 17 (Ubuntu 22.04 min)

# du -sh /var/
4.5G    /var/
# du -sh /usr --exclude=/usr/local
4.3G    /usr
# du -sh /usr/local
3.1M    /usr/local
# du -sh /boot
113M    /boot
~# du -sh /home
58M     /home
# du -sh /
17G     /

This is a pretty bare minimum system so some of these numbers will be low. I have been bitten in the posterior a few times for under-sizing, but I tend to do a lot of dev work. I would say at a minimum you probably want 80G and there will be a good deal more in /var than I have above. That will contain all of your call recordings, voicemails, some temp files, your database, etc. So that is one place I would focus capacity.

Audio Storage

Estimate average audio storage of about 536KB/minute. Size depends on codec and could generally range from 150KB/minute on the conservative side and about 923Kb/minute on the higher end.

Permissions

For permissions, this was generally derived from “fwconsole chown” Note that command is hookable and other files will ask for their own files to be changed. These are just the baseline if no other modules add on.

Summary of Files and Permissions

Path Type Permissions Owner/Group Notes
/var/lib/asterisk/moh rdir 0755/0644 asterisk/asterisk Recursive, files lose execute bit
/var/lib/asterisk/sounds rdir 0755/0644 asterisk/asterisk Recursive, removes dangling symlinks
/var/log/asterisk rdir 0755/0644 asterisk/asterisk Recursive
/var/spool/asterisk rdir 0755/0644 asterisk/asterisk Recursive
/var/www/html rdir 0755/0644 asterisk/asterisk Recursive
/var/lib/php/session rdir 0774/0664 asterisk/asterisk Recursive
/etc/amportal.conf file 0660 asterisk/asterisk Single file
/etc/freepbx.conf file 0660 asterisk/asterisk Single file
/var/run/asterisk rdir 0775/0664 asterisk/asterisk Recursive
/var/lib/asterisk/keys rdir 0775/0664 asterisk/asterisk GPG directory
/etc/asterisk rdir 0775/0664 asterisk/asterisk Recursive
/var/lib/asterisk/.ssh/id_rsa file 0600 asterisk/asterisk SSH key
/var/log/asterisk/freepbx_dbug file 0664 asterisk/asterisk Debug log
/var/log/asterisk/freepbx.log file 0664 asterisk/asterisk Main log
/etc/obdc.ini file 0664 asterisk/asterisk ODBC config
/var/lib/asterisk/bin execdir 0775 asterisk/asterisk Recursive, retains execute bit
/var/lib/asterisk/agi-bin execdir 0775 asterisk/asterisk Recursive, retains execute bit
/var/www/html/admin/modules/<mod>/<bin> execdir 0755 asterisk/asterisk Per module, if exists
/home/asterisk rdir 0755/0644 asterisk/asterisk If exists
/home/asterisk/.ssh rdir 0700/0600 asterisk/asterisk If exists

Deriving permission changes

You can get a permission snapshot

find / -exec stat -c "%n %a %U %G" {} + > permissions_snapshot.txt 2>/dev/null

run fwconsole chown
Do a second snapshot

find / -exec stat -c "%n %a %U %G" {} + > permissions_snapshot2.txt 2>/dev/null

Then compare them

diff permissions_snapshot.txt permissions_snapshot2.txt
5 Likes

Wow 17G used on a base install on Ubuntu? Using debian I’m at 7.5G used. My normal template is a 15gb disk and another 15gb where I symlink all databases, call recordings, and asterisk logs.

It is a base “FreePBX” system so their script has been run adding their packages. Other packages have been added for other tasks but I didn’t really go through and clean out anything unused. There is certainly a chance this could be smaller with a few scripts or oneliners.

We regularly build virtual machines with 1GB of RAM and a 20GB drive. Unless you’re storing huge quantities of voicemails or doing lots of transcoding, you should never have a problem with this setup.

1 Like

In my post I did post all the commands I did for sizing of various folders. Might not be a bad ideal for others to do those commands and post their results just to see and average across systems

Post how many users you have, a general count of mailboxes and call recordings and the OS with those outputs. People can start getting a general reference.

OK! I made a thing for this if others want to post their stats here.

The output as a series of Markdown tables which are understood by these forums.

Directory Sizes

Directory Size
/var/ 3.6G
/usr/ (excluding /usr/local) 2.4G
/usr/local 89M
/boot 56M
/home 1.1G
/ 8.7G

Asterisk Storage

Item Size
Call Recordings (/var/spool/asterisk/monitor/) 65M
Voicemail Storage (/var/spool/asterisk/voicemail/default/) 2.0M

Counts

Item Count
Mailboxes 4
Call Recordings 141
Users 18
Devices 15
Open Source Modules 75
Commercial Modules 15

Averages

Item Value
Average Recording Size 33M
Average Recording Length 0:29
1 Like

I’m running IncrediblePBX-2025 with Asterisk-22/FreePBX-17 on a 1-gig Vultr VM and 20GB of disk.

Directory Sizes

Directory Size
/var/ 3.7G
/usr/ (excluding /usr/local) 6.5G
/usr/local 6.6M
/boot 117M
/home 24K
/ 14G

Asterisk Storage

Item Size
Call Recordings (/var/spool/asterisk/monitor/) 292K
Voicemail Storage (/var/spool/asterisk/voicemail/default/) 2.0M

Counts

Item Count
Mailboxes 8
Call Recordings 2
Users 17
Devices 15
Open Source Modules 73
Commercial Modules 1

Averages

Item Value
Average Recording Size 283K
Average Recording Length 0:08
2 Likes