Welcome to Centmin Mod Community
Become a Member

Raising minimum & recommended disk requirements for Centmin Mod LEMP installs

Discussion in 'Centmin Mod News' started by eva2000, Feb 9, 2016.

Thread Status:
Not open for further replies.
  1. eva2000

    eva2000 Administrator Staff Member

    May 24, 2014
    Brisbane, Australia
    Local Time:
    7:39 PM
    Nginx 1.25.x
    MariaDB 10.x
    After a lot of testing on various VPSes and various VPS providers' provided CentOS OS image templates over time, the disk usage patterns are becoming clearer. Some VPS providers have heavy default CentOS OS images than others and Centmin Mod LEMP's automated backup routines for Nginx configuration, ccache compiler cache and source download compilations require more disk space as time goes by. So today, I revised the Centmin Mod LEMP stack's minimum & recommended disk space requirements to better meet these patterns of usage.

    From Centmin Mod LEMP Stack Install Nginx on CentOS the revised disk usage requirements are:
    A quick list of routines where disk space usage grow over time.

    Nginx Auto Backup Routine

    Everytime you run centmin.sh menu option 4 to upgrade, downgrade or recompile Nginx server, a backup of the Nginx configuration files and ssl certificates are made to timestamped directories within /usr/local/nginxbackup

    du -h --max-depth=1 /usr/local/nginxbackup/
    588K    /usr/local/nginxbackup/confbackup
    11M     /usr/local/nginxbackup/nginxdirbackup
    11M     /usr/local/nginxbackup/

    ccache Source Compiler Cache

    Centmin Mod source compiles Nginx and PHP-FPM and a select few PHP extensions. And to speed up recompiles, Centmin Mod installs and uses ccache source compiler caching. The ccache allows recompiles to be up to 60+% faster. The ccache cache storage is at /home/.ccache.

    To see current ccache storage stats and disk usage
    du -sh /home/.ccache/
    ccache -s
    du -sh /home/.ccache/
    292M    /home/.ccache/
    ccache -s
    cache directory                     /home/.ccache
    primary config                      /home/.ccache/ccache.conf
    secondary config      (readonly)    /usr/local/etc/ccache.conf
    cache hit (direct)                  2679
    cache hit (preprocessed)            4007
    cache miss                          6318
    called for link                      345
    called for preprocessing             612
    compile failed                       215
    preprocessor error                   104
    bad compiler arguments               115
    unsupported source language          114
    autoconf compile/link               1926
    no input file                        243
    files in cache                     18222
    cache size                         317.3 MB
    max cache size                       2.2 GB
    To clear ccache disk space use command
    ccache -C

    Source download directory /svr-setup

    All Centmin Mod source and other required downloaded files are saved at /svr-setup and over time this can grow. You could nuke everything in this directory and Centmin Mod will redownload what's needed but overtime this will grow. The next Centmin Mod 123.09beta01 and higher have smarter routines to only keep the last and most recent version of largest downloads like php, nginx_pagespeed, nginx, openssl, libressl etc.
    du -sh /svr-setup
    1.8G    /svr-setup/
    10 largest directories in /svr-setup
    du --max-depth=1 /svr-setup/ | sort -k1 -n | tail -10
    20824   /svr-setup/mongodb-1.1.1
    25068   /svr-setup/libevent-release-2.0.22-stable
    29524   /svr-setup/openssl-1.0.2f
    54412   /svr-setup/nginx-1.9.10
    111496  /svr-setup/libressl-2.2.6
    236052  /svr-setup/php-5.6.16
    252748  /svr-setup/php-7.0.1
    253036  /svr-setup/php-7.0.2
    609388  /svr-setup/ngx_pagespeed-release-
    1883568 /svr-setup/

    dbbackup.sh MySQL Backup Script

    For Premium members who have access to dbbackup.sh MySQL backup script, they'll have a growing number of MySQL backup files occupying local disk space.

    Swap and /tmp

    Also auto creation of a larger on disk /tmp filesystem if you're on a very low memory system as ramdisk based /tmp would not be sufficient if you have low memory amount installed and utilise MySQL which uses /tmp. Centmin Mod 123.09beta01+ and higher also add an on disk based swap file if one is not detected and the size of the swap file created is dynamically determined based your available disk free space and amount of memory installed on your system.

    An example on a 1GB memory 20GB disk with 19GB free space which initially didn't have a swap file, would after Centmin Mod install have a ~950MB /tmp file created on disk and a 1023MB swap file on disk.
    Last edited: Mar 27, 2017
Thread Status:
Not open for further replies.