diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2019-12-20 06:40:10 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2019-12-20 06:40:10 +0000 |
commit | 924c24a52fb8bfbb61d890e03183d0c2f667bd7b (patch) | |
tree | fe96c608cacd34e5174dc77ace780dee036904ce /searchcore | |
parent | aaf261ce16113144842d12ccb334c4a58dbb6173 (diff) |
Do not start adjustment of soft timeout factor until 5 minutes have passed.
Do not allow of soft timeout factor to go below 1%.
Diffstat (limited to 'searchcore')
3 files changed, 16 insertions, 20 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp b/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp index 2ec3488fe3c..4c353a4b802 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp +++ b/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp @@ -41,7 +41,7 @@ namespace proton::matching { namespace { -constexpr long SECONDS_BEFORE_ALLOWING_SOFT_TIMEOUT_FACTOR_ADJUSTMENT = 60; +constexpr long SECONDS_BEFORE_ALLOWING_SOFT_TIMEOUT_FACTOR_ADJUSTMENT = 300; // used to give out empty whitelist blueprints struct StupidMetaStore : search::IDocumentMetaStore { @@ -84,6 +84,18 @@ bool willNotNeedRanking(const SearchRequest & request, const GroupingContext & g || (!request.sortSpec.empty() && (request.sortSpec.find("[rank]") == vespalib::string::npos)); } +SearchReply::UP +handleGroupingSession(SessionManager &sessionMgr, GroupingContext & groupingContext, GroupingSession::UP groupingSession) +{ + auto reply = std::make_unique<SearchReply>(); + groupingSession->continueExecution(groupingContext); + groupingContext.getResult().swap(reply->groupResult); + if (!groupingSession->finished()) { + sessionMgr.insert(std::move(groupingSession)); + } + return reply; +} + } // namespace proton::matching::<unnamed> Matcher::Matcher(const search::index::Schema &schema, const Properties &props, const vespalib::Clock &clock, @@ -146,19 +158,6 @@ Matcher::create_match_tools_factory(const search::engine::Request &request, ISea rankProperties, feature_overrides); } -SearchReply::UP -Matcher::handleGroupingSession(SessionManager &sessionMgr, GroupingContext & groupingContext, - GroupingSession::UP groupingSession) -{ - SearchReply::UP reply = std::make_unique<SearchReply>(); - groupingSession->continueExecution(groupingContext); - groupingContext.getResult().swap(reply->groupResult); - if (!groupingSession->finished()) { - sessionMgr.insert(std::move(groupingSession)); - } - return reply; -} - size_t Matcher::computeNumThreadsPerSearch(Blueprint::HitEstimate hits, const Properties & rankProperties) const { size_t threads = NumThreadsPerSearch::lookup(rankProperties, _rankSetup->getNumThreadsPerSearch()); diff --git a/searchcore/src/vespa/searchcore/proton/matching/matcher.h b/searchcore/src/vespa/searchcore/proton/matching/matcher.h index 4d3d32a96e4..14562ffd6ca 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/matcher.h +++ b/searchcore/src/vespa/searchcore/proton/matching/matcher.h @@ -67,11 +67,6 @@ private: QueryLimiter &_queryLimiter; uint32_t _distributionKey; - std::unique_ptr<search::engine::SearchReply> - handleGroupingSession(SessionManager &sessionMgr, - search::grouping::GroupingContext & groupingContext, - std::unique_ptr<search::grouping::GroupingSession> gs); - size_t computeNumThreadsPerSearch(search::queryeval::Blueprint::HitEstimate hits, const Properties & rankProperties) const; public: diff --git a/searchcore/src/vespa/searchcore/proton/matching/matching_stats.cpp b/searchcore/src/vespa/searchcore/proton/matching/matching_stats.cpp index 84e5b9dfd15..3526b7f206f 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/matching_stats.cpp +++ b/searchcore/src/vespa/searchcore/proton/matching/matching_stats.cpp @@ -89,12 +89,14 @@ MatchingStats::updatesoftDoomFactor(vespalib::duration hardLimit, vespalib::dura if ((hardLimit >= MIN_TIMEOUT) && (softLimit >= MIN_TIMEOUT)) { double diff = vespalib::to_s(softLimit - duration)/vespalib::to_s(hardLimit); if (duration < softLimit) { - diff = std::min(diff, _softDoomFactor*MAX_CHANGE_FACTOR); + // Since softdoom factor can become very small, allow a minimum change of some size + diff = std::min(diff, std::max(0.1, _softDoomFactor)*MAX_CHANGE_FACTOR); _softDoomFactor += 0.01*diff; } else { diff = std::max(diff, -_softDoomFactor*MAX_CHANGE_FACTOR); _softDoomFactor += 0.02*diff; } + _softDoomFactor = std::max(_softDoomFactor, 0.01); // Never go below 1% } return *this; } |