Want to subscribe to topics you're interested in?
Become a Member

disable core dump

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by paddy, Mar 19, 2015.

  1. paddy

    paddy New Member

    27
    0
    1
    Nov 27, 2014
    Ratings:
    +0
    Local Time:
    11:43 AM
    1.7.7
    MariaDB 5.5
    good day ,
    recently my b0x always crash , and when i check with df -h i saw my hdd is full 100% and the problem is because the core dump files eating lots of space, after i deleted all the core dump files , my b0x work normal again.
    is there a way to disable core dump files ? right now im using a crontab to check and delete core dump files.

    thank you before.
     
  2. eva2000

    eva2000 Administrator Staff Member

    30,890
    6,907
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,401
    Local Time:
    2:43 PM
    Nginx 1.13.x
    MariaDB 5.5
    did you ever manually enable core dumps at all i.e. steps like How To Enable Core Dumps In RHEL6 | Unixmen ?

    where were these core dumps saved to ?

    what's output from these commands

    Code:
    cat /etc/security/limits.conf
    ulimit -aH
    ulimit -aS
     
  3. paddy

    paddy New Member

    27
    0
    1
    Nov 27, 2014
    Ratings:
    +0
    Local Time:
    11:43 AM
    1.7.7
    MariaDB 5.5
    i dont think i ever manually enable it .
    it was saved under /home/nginx/domains/mydomain.com/public
     
  4. eva2000

    eva2000 Administrator Staff Member

    30,890
    6,907
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,401
    Local Time:
    2:43 PM
    Nginx 1.13.x
    MariaDB 5.5
    strange i recall no where in nginx or php-fpm configuration for Centmin Mod that have enabled core dumps either.

    what about outputs for thsoe 3 commands above ?
     
  5. paddy

    paddy New Member

    27
    0
    1
    Nov 27, 2014
    Ratings:
    +0
    Local Time:
    11:43 AM
    1.7.7
    MariaDB 5.5
    here are the outputs

    Code:
    [root@cloud ~]# cat /etc/security/limits.conf
    # /etc/security/limits.conf
    #
    #Each line describes a limit for a user in the form:
    #
    #<domain>  <type>  <item>  <value>
    #
    #Where:
    #<domain> can be:
    #  - a user name
    #  - a group name, with @group syntax
    #  - the wildcard *, for default entry
    #  - the wildcard %, can be also used with %group syntax,
    #  for maxlogin limit
    #
    #<type> can have the two values:
    #  - "soft" for enforcing the soft limits
    #  - "hard" for enforcing hard limits
    #
    #<item> can be one of the following:
    #  - core - limits the core file size (KB)
    #  - data - max data size (KB)
    #  - fsize - maximum filesize (KB)
    #  - memlock - max locked-in-memory address space (KB)
    #  - nofile - max number of open file descriptors
    #  - rss - max resident set size (KB)
    #  - stack - max stack size (KB)
    #  - cpu - max CPU time (MIN)
    #  - nproc - max number of processes
    #  - as - address space limit (KB)
    #  - maxlogins - max number of logins for this user
    #  - maxsyslogins - max number of logins on the system
    #  - priority - the priority to run user process with
    #  - locks - max number of file locks the user can hold
    #  - sigpending - max number of pending signals
    #  - msgqueue - max memory used by POSIX message queues (bytes)
    #  - nice - max nice priority allowed to raise to values: [-20, 19]
    #  - rtprio - max realtime priority
    #
    #<domain>  <type>  <item>  <value>
    #
    
    #*  soft  core  0
    #*  hard  rss  10000
    #@student  hard  nproc  20
    #@faculty  soft  nproc  20
    #@faculty  hard  nproc  50
    #ftp  hard  nproc  0
    #@student  -  maxlogins  4
    
    # End of file
    * soft nofile 262144
    * hard nofile 262144
    nginx soft nofile 262144
    nginx hard nofile 262144
    
    Code:
    [root@cloud ~]# ulimit -aH
    core file size  (blocks, -c) unlimited
    data seg size  (kbytes, -d) unlimited
    scheduling priority  (-e) 0
    file size  (blocks, -f) unlimited
    pending signals  (-i) 1029986
    max locked memory  (kbytes, -l) 64
    max memory size  (kbytes, -m) unlimited
    open files  (-n) 262144
    pipe size  (512 bytes, -p) 8
    POSIX message queues  (bytes, -q) 819200
    real-time priority  (-r) 0
    stack size  (kbytes, -s) unlimited
    cpu time  (seconds, -t) unlimited
    max user processes  (-u) 4096
    virtual memory  (kbytes, -v) unlimited
    file locks  (-x) unlimited
    
    Code:
    [root@cloud ~]# ulimit -aS
    core file size  (blocks, -c) unlimited
    data seg size  (kbytes, -d) unlimited
    scheduling priority  (-e) 0
    file size  (blocks, -f) unlimited
    pending signals  (-i) 1029986
    max locked memory  (kbytes, -l) 64
    max memory size  (kbytes, -m) unlimited
    open files  (-n) 262144
    pipe size  (512 bytes, -p) 8
    POSIX message queues  (bytes, -q) 819200
    real-time priority  (-r) 0
    stack size  (kbytes, -s) 10240
    cpu time  (seconds, -t) unlimited
    max user processes  (-u) 4096
    virtual memory  (kbytes, -v) unlimited
    file locks  (-x) unlimited
    
     
  6. eva2000

    eva2000 Administrator Staff Member

    30,890
    6,907
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,401
    Local Time:
    2:43 PM
    Nginx 1.13.x
    MariaDB 5.5
    looks default/normal to me

    what are the file names of the core dumps like ?
     
  7. paddy

    paddy New Member

    27
    0
    1
    Nov 27, 2014
    Ratings:
    +0
    Local Time:
    11:43 AM
    1.7.7
    MariaDB 5.5
    core name is : core.5866 etc with random number on it
     
  8. eva2000

    eva2000 Administrator Staff Member

    30,890
    6,907
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,401
    Local Time:
    2:43 PM
    Nginx 1.13.x
    MariaDB 5.5
    ok what do you get from this command's output

    Code:
    sysctl -a | egrep 'kernel.core_uses_pid|kernel.core_pattern|fs.suid_dumpable'
    i.e.

    Code:
    sysctl -a | egrep 'kernel.core_uses_pid|kernel.core_pattern|fs.suid_dumpable'
    kernel.core_uses_pid = 1
    kernel.core_pattern = core
    fs.suid_dumpable = 0
     
  9. paddy

    paddy New Member

    27
    0
    1
    Nov 27, 2014
    Ratings:
    +0
    Local Time:
    11:43 AM
    1.7.7
    MariaDB 5.5
    this is the output

    Code:
    sysctl -a | egrep 'kernel.core_uses_pid|kernel.core_pattern|fs.suid_dumpable'
    kernel.core_uses_pid = 1
    kernel.core_pattern = core
    fs.suid_dumpable = 0
    
    its the same code
     
  10. eva2000

    eva2000 Administrator Staff Member

    30,890
    6,907
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,401
    Local Time:
    2:43 PM
    Nginx 1.13.x
    MariaDB 5.5
    hmm what version of CentOS you using ? 6.6 or 7.0 ?
     
  11. paddy

    paddy New Member

    27
    0
    1
    Nov 27, 2014
    Ratings:
    +0
    Local Time:
    11:43 AM
    1.7.7
    MariaDB 5.5
    i use CentOS release 6.6 (Final)
     
  12. eva2000

    eva2000 Administrator Staff Member

    30,890
    6,907
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,401
    Local Time:
    2:43 PM
    Nginx 1.13.x
    MariaDB 5.5
    try in /etc/security/limits.conf edit this line to uncomment it's settings

    from
    Code:
    #*  soft  core  0
    to
    Code:
    *  soft  core  0
    type
    Code:
    ulimit -c 0
    then check your core soft limit
    Code:
    ulimit -aS
    i see your softlimit is unlimited while all my servers is set to 0 disabled

    your soft core file size limit above
    Code:
    ulimit -aS
    core file size  (blocks, -c) unlimited
     
    • Like Like x 1
  13. paddy

    paddy New Member

    27
    0
    1
    Nov 27, 2014
    Ratings:
    +0
    Local Time:
    11:43 AM
    1.7.7
    MariaDB 5.5
    i've changed it and here is the output

    Code:
     ulimit -aS
    
    core file size  (blocks, -c) 0
    data seg size  (kbytes, -d) unlimited
    scheduling priority  (-e) 0
    file size  (blocks, -f) unlimited
    pending signals  (-i) 1029986
    max locked memory  (kbytes, -l) 64
    max memory size  (kbytes, -m) unlimited
    open files  (-n) 262144
    pipe size  (512 bytes, -p) 8
    POSIX message queues  (bytes, -q) 819200
    real-time priority  (-r) 0
    stack size  (kbytes, -s) 10240
    cpu time  (seconds, -t) unlimited
    max user processes  (-u) 4096
    virtual memory  (kbytes, -v) unlimited
    file locks  (-x) unlimited
    
    is this correct ? i saw that core file size (blocks, -c) unlimited has change into core file size (blocks, -c) 0
     
  14. eva2000

    eva2000 Administrator Staff Member

    30,890
    6,907
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,401
    Local Time:
    2:43 PM
    Nginx 1.13.x
    MariaDB 5.5
    yeah that's it.. wait and see now
     
  15. paddy

    paddy New Member

    27
    0
    1
    Nov 27, 2014
    Ratings:
    +0
    Local Time:
    11:43 AM
    1.7.7
    MariaDB 5.5
    ok thank u eva , i've disabled my crontab and lets see if it work :D
    thanks a bunch!
     
  16. paddy

    paddy New Member

    27
    0
    1
    Nov 27, 2014
    Ratings:
    +0
    Local Time:
    11:43 AM
    1.7.7
    MariaDB 5.5
    i think it doesnt work ,
    i receive this in php-fpm log
    Code:
    [19-Mar-2015 13:38:56] WARNING: [pool www] child 7733 exited on signal 11 (SIGSEGV - core dumped) after 263.925730 seconds from start
    
    after that core dump files show up on public directory.

    Code:
    278544 -rw-------  1 nginx nginx 470073344 Mar 19 12:11 core.7443
    276828 -rw-------  1 nginx nginx 468570112 Mar 19 12:20 core.7481
    276720 -rw-------  1 nginx nginx 468582400 Mar 19 12:30 core.7507
    276128 -rw-------  1 nginx nginx 467779584 Mar 19 12:32 core.7527
    276528 -rw-------  1 nginx nginx 468303872 Mar 19 12:33 core.7533
    276764 -rw-------  1 nginx nginx 468561920 Mar 19 12:36 core.7542
    277108 -rw-------  1 nginx nginx 468946944 Mar 19 12:48 core.7575
    276428 -rw-------  1 nginx nginx 468041728 Mar 19 13:00 core.7618
    276804 -rw-------  1 nginx nginx 468307968 Mar 19 13:04 core.7644
    277432 -rw-------  1 nginx nginx 469139456 Mar 19 13:38 core.7733
    
    if you notice the size of each core dump size , it make my vps full.
     
  17. eva2000

    eva2000 Administrator Staff Member

    30,890
    6,907
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,401
    Local Time:
    2:43 PM
    Nginx 1.13.x
    MariaDB 5.5
    what value for rlimit_core in /usr/local/etc/php-fpm.conf (cmd shortcut = fpmconf) ?

    default should be 0 unless you enabled it Generate PHP core dumps on segfaults in PHP-FPM

    and the root problem is your PHP process is segfaulting and core dumps are used to troubleshooting why.. you need to find out why PHP is segfaulting which is your real problem. That article actually provides a good starting point Generate PHP core dumps on segfaults in PHP-FPM

    Unfortunately, I only provide Centmin Mod as is, so troubleshooting is left to you or if other members here want to help each other out
     
  18. paddy

    paddy New Member

    27
    0
    1
    Nov 27, 2014
    Ratings:
    +0
    Local Time:
    11:43 AM
    1.7.7
    MariaDB 5.5
    rlimit_files = 65536
    rlimit_core = 0

    still default , doesnt change any of