Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

80GB+ logs in /opt php-fpm directory

Discussion in 'EasyApache' started by chrismfz, Jan 14, 2018.

  1. chrismfz

    chrismfz Well-Known Member

    Joined:
    Jul 4, 2007
    Messages:
    123
    Likes Received:
    1
    Trophy Points:
    68
    Location:
    Greece
    cPanel Access Level:
    DataCenter Provider
    Is it normal ? It shouldn't cPanel rotate them / delete them like any other logs in the system?

    I have a relatively "small" system because of 480GB SSD used and I saw the space
    was shrinking quickly.
    Following du -h --max-depth=1 to see which folders are messing around with space
    I found that in /opt/cpanel the php-fpm logs were 80+ GB. And not one of them at least at compressed stated. Like they never rotated / deleted.

    It was something like this:
    Code:
    [root@mars php-fpm]# pwd
    /opt/cpanel/ea-php70/root/usr/var/log/php-fpm
    [root@mars php-fpm]# du -h
    84G     .
    [root@mars php-fpm]#
    [root@mars php-fpm]# ls -la
    total 87316072
    drwxrwx--- 2 nobody root        4096 Jan 14 03:48 .
    drwxr-xr-x 3 root   root        4096 Jul 24 18:10 ..
    -rw------- 1 root   root          56 Jan 14 03:48 error.log
    -rw------- 1 root   root        1211 Dec 21 10:35 error.log-20171224
    -rw------- 1 root   root       11896 Dec 30 21:54 error.log-20180101
    -rw------- 1 root   root 53529537436 Jan  7 03:28 error.log-20180107
    -rw------- 1 root   root 35882060611 Jan 14 02:42 error.log-20180114
    
     
  2. 24x7server

    24x7server Well-Known Member

    Joined:
    Apr 17, 2013
    Messages:
    1,675
    Likes Received:
    73
    Trophy Points:
    28
    Location:
    India
    cPanel Access Level:
    Root Administrator
    A similar situation has been discussed over an a thread on the below URL:
    php-fpm error.log using up 100% disk space

    According to this thread, an internal case number "CPANEL-14681" already is in progress. You can follow-up on the same thread for update on this from the cPanel team..
     
  3. cPWilliamL

    cPWilliamL cP Technical Analyst II
    Staff Member

    Joined:
    May 15, 2017
    Messages:
    257
    Likes Received:
    27
    Trophy Points:
    103
    Location:
    America
    cPanel Access Level:
    Root Administrator
    Hi @chrismfz,

    Your code snippet actually shows the log being rotated; however, it may not be fully configured to how you like it:
    Code:
    # cat /etc/logrotate.d/ea-php70-php-fpm
    /opt/cpanel/ea-php70/root/usr/var/log/php-fpm/*log {
        missingok
        notifempty
        sharedscripts
        delaycompress
        postrotate
        /bin/kill -SIGUSR1 `cat /opt/cpanel/ea-php70/root/usr/var/run/php-fpm/php-fpm.pid 2>/dev/null` 2>/dev/null || true
        endscript
    }
    
    You may need to add 'rotate' and 'size' directives:
    HowTo: The Ultimate Logrotate Command Tutorial with 10 Examples
    logrotate(8) - Linux man page

    Thanks,
     
Loading...

Share This Page