This repository was archived by the owner on Dec 13, 2023. It is now read-only.
-
Couldn't load subscription status.
- Fork 57
Add description of new arangosearch server options #593
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
25 tasks
3 tasks
joerg84 approved these changes Dec 11, 2020
Simran-B reviewed Dec 11, 2020
| > still continue to return a repeatable-read state. | ||
| | ||
| - **consolidationIntervalMsec** (_optional_; type: `integer`; default: `60000`; | ||
| - **consolidationIntervalMsec** (_optional_; type: `integer`; default: `1000`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Code excerpts with annotations in case that we want to describe what autodetect does later: THREADS_PARAM("--arangosearch.threads"); THREADS_LIMIT_PARAM("--arangosearch.threads-limit"); COMMIT_THREADS_PARAM("--arangosearch.commit-threads"); COMMIT_THREADS_IDLE_PARAM("--arangosearch.commit-threads-idle"); CONSOLIDATION_THREADS_PARAM("--arangosearch.consolidation-threads"); CONSOLIDATION_THREADS_IDLE_PARAM("--arangosearch.consolidation-threads-idle"); options->addOption(THREADS_PARAM, // --arangosearch.threads "the exact number of threads to use for asynchronous " "tasks (0 == autodetect)", new options::UInt32Parameter(&_threads)) .setDeprecatedIn(30800); options->addOption(THREADS_LIMIT_PARAM, // --arangosearch.threads-limit "upper limit to the autodetected number of threads to use " "for asynchronous tasks (0 == use default)", new options::UInt32Parameter(&_threadsLimit)) .setDeprecatedIn(30800); options->addOption(CONSOLIDATION_THREADS_PARAM, // --arangosearch.consolidation-threads "upper limit to the allowed number of consolidation threads " "(0 == autodetect)", new options::UInt32Parameter(&_consolidationThreads)) .setIntroducedIn(30760); options->addOption(CONSOLIDATION_THREADS_IDLE_PARAM, // --arangosearch.consolidation-threads-idle "upper limit to the allowed number of idle threads to use " "for consolidation tasks (0 == autodetect)", new options::UInt32Parameter(&_consolidationThreadsIdle)) .setIntroducedIn(30760); options->addOption(COMMIT_THREADS_PARAM, // --arangosearch.commit-threads "upper limit to the allowed number of commit threads " "(0 == autodetect)", new options::UInt32Parameter(&_commitThreads)) .setIntroducedIn(30760); options->addOption(COMMIT_THREADS_IDLE_PARAM, // --arangosearch.commit-threads-idle "upper limit to the allowed number of idle threads to use " "for commit tasks (0 == autodetect)", new options::UInt32Parameter(&_commitThreadsIdle)) .setIntroducedIn(30760); // at least 1 // at most 8 or a lower limit as defined by user, or lower count as defined by user ? // threads == 0 -> numCores / div (4 or 6) // threadsLimit == 0 -> MAX_THREADS (8) uint32_t computeThreadsCount(uint32_t threads, uint32_t threadsLimit, uint32_t div) noexcept { TRI_ASSERT(div); constexpr uint32_t MAX_THREADS = 8; // arbitrary limit on the upper bound of threads in pool constexpr uint32_t MIN_THREADS = 1; // at least one thread is required return std::max(MIN_THREADS, std::min(threadsLimit ? threadsLimit : MAX_THREADS, threads ? threads : uint32_t(arangodb::NumberOfCores::getValue()) / div)); } uint32_t computeIdleThreadsCount(uint32_t idleThreads, uint32_t threads) noexcept { if (0 == idleThreads) { return std::max(threads/2, 1U); } else { return std::min(idleThreads, threads); } } void IResearchFeature::validateOptions(std::shared_ptr<arangodb::options::ProgramOptions> options) { auto const& args = options->processingResult(); bool const threadsSet = args.touched(THREADS_PARAM); // --arangosearch.threads bool const threadsLimitSet = args.touched(THREADS_LIMIT_PARAM); // --arangosearch.threads-limit bool const commitThreadsSet = args.touched(COMMIT_THREADS_PARAM); // --arangosearch.commit-threads bool const commitThreadsIdleSet = args.touched(COMMIT_THREADS_IDLE_PARAM); // --arangosearch.commit-threads-idle bool const consolidationThreadsSet = args.touched(CONSOLIDATION_THREADS_PARAM); // --arangosearch.consolidation-threads bool const consolidationThreadsIdleSet = args.touched(CONSOLIDATION_THREADS_IDLE_PARAM); // --arangosearch.consolidation-threads-idle uint32_t threadsLimit = static_cast<uint32_t>(4*arangodb::NumberOfCores::getValue()); // If neither --arangosearch.commit-threads nor --arangosearch.consolidation-threads is set, // then --arangosearch.threads and --arangosearch.threads-limit are ignored. // If the new options aren't set, then the legacy options are translated internally to the new options. if ((threadsLimitSet || threadsSet) && !commitThreadsSet && !consolidationThreadsSet) { // backwards compatibility threadsLimit = std::min(threadsLimit, _threadsLimit); // between user-supplied --arangosearch.threads-limit and 4*numCores uint32_t const threads = computeThreadsCount(_threads, threadsLimit, 4); // --arangosearch.threads, above, divide by 4 _commitThreads = std::max(threads/2, 1U); // set internal value for --arangosearch.commit-threads to above divided by 2, but at least 1 _consolidationThreads = _commitThreads; // same also for --arangosearch.consolidation-threads } else { _commitThreads = computeThreadsCount(_commitThreads, threadsLimit, 6); // --arangosearch.commit-threads, 4*numCores, divide by 6 _consolidationThreads = computeThreadsCount(_consolidationThreads, threadsLimit, 6); // --arangosearch.consolidation-threads, 4*numCores, divide by 6 } _commitThreadsIdle = commitThreadsIdleSet ? computeIdleThreadsCount(_commitThreadsIdle, _commitThreads) : _commitThreads; _consolidationThreadsIdle = consolidationThreadsIdleSet ? computeIdleThreadsCount(_consolidationThreadsIdle, _consolidationThreads) : _consolidationThreads; _running.store(false); } |
consolidationIntervalMsec was apparently changed to 1000 there too (v3.7.5?)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
arangodb/arangodb#13008