Tanya-W commented on code in PR #16758:
URL: https://github.com/apache/doris/pull/16758#discussion_r1106717034


##########
be/src/olap/rowset/segment_v2/inverted_index_cache.cpp:
##########
@@ -49,6 +49,19 @@ void 
InvertedIndexSearcherCache::create_global_instance(size_t capacity, uint32_
 InvertedIndexSearcherCache::InvertedIndexSearcherCache(size_t capacity, 
uint32_t num_shards)
         : 
_mem_tracker(std::make_unique<MemTracker>("InvertedIndexSearcherCache")) {
     SCOPED_CONSUME_MEM_TRACKER(_mem_tracker.get());
+    uint64_t fd_number = config::min_file_descriptor_number;
+    struct rlimit l;
+    int ret = getrlimit(RLIMIT_NOFILE, &l);
+    if (ret != 0) {
+        LOG(WARNING) << "call getrlimit() failed. errno=" << strerror(errno)
+                     << ", use default configuration instead.";
+    } else {
+        fd_number = static_cast<uint64_t>(l.rlim_cur);
+    }
+
+    uint64_t open_searcher_limit = fd_number / 3 * 2;

Review Comment:
   The actual file descriptor number maybe much larger than config:: 
min_file_descriptor_number, so it should be limited by the actual file 
descriptor number as much as possible.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to