[ https://issues.apache.org/jira/browse/CASSANDRA-20457?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Igor Kamyshnikov updated CASSANDRA-20457: ----------------------------------------- Test and Documentation Plan: New env vars are introduced: CASSANDRA_HEAPDUMP_CLEAN: 1 - clean (default) otherwise - do not clean CASSANDRA_HEAPDUMP_KEEP_LAST_N_FILES -1 - no heap dump files will be removed 0 - all heap dump files will be removed N > 0 - up to N most recent files will be kept default: 2 CASSANDRA_HEAPDUMP_KEEP_FIRST_N_FILES -1 - no heap dump files will be removed 0 - all heap dump files will be removed N > 0 - up to N least recent files will be kept default: 1 Currently, only 100 heap dump files are being searched for, therefore having CASSANDRA_HEAPDUMP_KEEP_LAST_N_FILES and CASSANDRA_HEAPDUMP_KEEP_FIRST_N_FILES greater than 100 makes no sense. tested on Ubuntu and Mac with fake hprof files created under the log dir using for i in $(seq 1 1000); do echo 1 > "./logs/cassandra-$i-pid$i.hprof"; sleep 0.01; done; ./bin/cassandra ./bin/cassandra -H ./x.hprof ls -1 ./logs | wc -l > Limit number of OOM heap dumps to avoid full disk issue > -------------------------------------------------------- > > Key: CASSANDRA-20457 > URL: https://issues.apache.org/jira/browse/CASSANDRA-20457 > Project: Apache Cassandra > Issue Type: Improvement > Components: Local/Scripts > Reporter: Dmitry Konstantinov > Assignee: Igor Kamyshnikov > Priority: Normal > Time Spent: 10m > Remaining Estimate: 0h > > We can add the following protective logic to our startup scripts for > Cassandra: > * check the directory is used for heap dumps > * if the number of existing heap dumps more than a threshold configured in an > env variable then remove the oldest one > It allows to avoid a case when we have a periodic OOM due to some issue and > eventually kill ourselves due to lack of disk space consumed by heap dumps. -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org