From 312223a9cb126697c55bb9ccf0f11da707db204d Mon Sep 17 00:00:00 2001 From: BGluth Date: Fri, 19 Jul 2024 13:51:11 -0600 Subject: [PATCH 1/2] Now warns if file descriptor limit is too low --- zero_bin/tools/prove_rpc.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/zero_bin/tools/prove_rpc.sh b/zero_bin/tools/prove_rpc.sh index 8dd8ea20d..ccdab6e21 100755 --- a/zero_bin/tools/prove_rpc.sh +++ b/zero_bin/tools/prove_rpc.sh @@ -60,6 +60,9 @@ OUTPUT_TO_TERMINAL="${OUTPUT_TO_TERMINAL:-false}" # Only generate proof by default RUN_VERIFICATION="${RUN_VERIFICATION:-false}" +# Recommended soft file handle limit. Will warn if it is set lower. +RECOMMENDED_FILE_HANDLE_LIMIT=4096 + mkdir -p $PROOF_OUTPUT_DIR if [ $IGNORE_PREVIOUS_PROOFS ]; then @@ -88,6 +91,19 @@ else BLOCK_INTERVAL=$START_BLOCK..=$END_BLOCK fi +# Print out a warning if the we're using `native` and our file descriptor limit is too low. Don't bother if we can't find `ulimit`. +if [ $(command -v ulimit) ] && [ $NODE_RPC_TYPE == "native" ] +then + file_desc_limit=$(ulimit -n) + + if [[ $file_desc_limit -lt $RECOMMENDED_FILE_HANDLE_LIMIT ]] + then + echo "WARNING: Maximum file descriptor limit may be too low to run native mode (current: $file_desc_limit, Recommended: ${RECOMMENDED_FILE_HANDLE_LIMIT}). + Consider increasing it with: + + ulimit -s ${RECOMMENDED_FILE_HANDLE_LIMIT}" + fi +fi # If we set test_only flag, we'll generate a dummy # proof. This is useful for quickly testing decoding and all of the From 553dbb6d179b2b9ef72dd05491995704b3bf8d07 Mon Sep 17 00:00:00 2001 From: BGluth Date: Mon, 22 Jul 2024 11:51:55 -0600 Subject: [PATCH 2/2] Requested changes for PR #411 --- zero_bin/tools/prove_rpc.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zero_bin/tools/prove_rpc.sh b/zero_bin/tools/prove_rpc.sh index ccdab6e21..cf300625e 100755 --- a/zero_bin/tools/prove_rpc.sh +++ b/zero_bin/tools/prove_rpc.sh @@ -61,7 +61,7 @@ OUTPUT_TO_TERMINAL="${OUTPUT_TO_TERMINAL:-false}" RUN_VERIFICATION="${RUN_VERIFICATION:-false}" # Recommended soft file handle limit. Will warn if it is set lower. -RECOMMENDED_FILE_HANDLE_LIMIT=4096 +RECOMMENDED_FILE_HANDLE_LIMIT=8192 mkdir -p $PROOF_OUTPUT_DIR @@ -101,7 +101,7 @@ then echo "WARNING: Maximum file descriptor limit may be too low to run native mode (current: $file_desc_limit, Recommended: ${RECOMMENDED_FILE_HANDLE_LIMIT}). Consider increasing it with: - ulimit -s ${RECOMMENDED_FILE_HANDLE_LIMIT}" + ulimit -n ${RECOMMENDED_FILE_HANDLE_LIMIT}" fi fi