From 43d54fe30213336eb047b9fb8a3347e47485b7e9 Mon Sep 17 00:00:00 2001 From: FreeOnePlus <54164178+FreeOnePlus@users.noreply.github.com> Date: Mon, 16 Dec 2024 15:59:55 +0800 Subject: [PATCH] [feat](docker)Add a BE ENV item 'SKIP_CHECK_ULIMIT' for Docker to start quickly (#45267) In the storage_engine.cpp of the BE process, it is mandatory to check that the `ulimit` value must be greater than 60,000. When starting with Docker or Docker-Compose, it is necessary to preemptively change the corresponding value on the host machine. This change is very unfriendly to Docker, as it loses its unique advantage of being able to "build quickly and anywhere," and cannot become a fundamental capability for rapid startup. Therefore, a new environment variable has been added to control whether to skip this check value. The default value is false, which enforces the check of this value. When set to true, it skips the check and starts directly. --- be/src/olap/storage_engine.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/be/src/olap/storage_engine.cpp b/be/src/olap/storage_engine.cpp index e00b5b595e20dc..24cda8232f115c 100644 --- a/be/src/olap/storage_engine.cpp +++ b/be/src/olap/storage_engine.cpp @@ -463,6 +463,16 @@ Status StorageEngine::_check_file_descriptor_number() { << ", use default configuration instead."; return Status::OK(); } + if (getenv("SKIP_CHECK_ULIMIT") == nullptr) { + LOG(INFO) << "will check 'ulimit' value."; + } else if (std::string(getenv("SKIP_CHECK_ULIMIT")) == "true") { + LOG(INFO) << "the 'ulimit' value check is skipped" + << ", the SKIP_CHECK_ULIMIT env value is " << getenv("SKIP_CHECK_ULIMIT"); + return Status::OK(); + } else { + LOG(INFO) << "the SKIP_CHECK_ULIMIT env value is " << getenv("SKIP_CHECK_ULIMIT") + << ", will check ulimit value."; + } if (l.rlim_cur < config::min_file_descriptor_number) { LOG(ERROR) << "File descriptor number is less than " << config::min_file_descriptor_number << ". Please use (ulimit -n) to set a value equal or greater than "