jenkins-bot has submitted this change and it was merged.
Change subject: Pull prefix searches into their own pool counter
......................................................................
Pull prefix searches into their own pool counter
This will make sure that spikes in full text search don't hurt prefix search
and spikes in prefix search don't hurt full text search.
Change-Id: Ief6b715681783508ddf9723d512201eaf4691299
---
M README
M includes/Searcher.php
2 files changed, 29 insertions(+), 4 deletions(-)
Approvals:
Chad: Looks good to me, approved
jenkins-bot: Verified
diff --git a/README b/README
index cd2a3ce..4986715 100644
--- a/README
+++ b/README
@@ -109,12 +109,30 @@
LocalSettings.php like so:
require_once( "$IP/extensions/PoolCounter/PoolCounterClient.php");
$wgPoolCounterConf = array(
- 'CirrusSearch-Search' => array( // Configuration for all searches
+ 'CirrusSearch-Search' => array( // Configuration for non-prefix
non-regex searches
'class' => 'PoolCounter_Client',
'timeout' => 30,
+ 'workers' => 25,
+ 'maxqueue' => 10,
+ ),
+ 'CirrusSearch-Prefix' => array( // Configuration for prefix searches
+ 'class' => 'PoolCounter_Client',
+ 'timeout' => 10,
'workers' => 50,
'maxqueue' => 10,
- )
+ ),
+ 'CirrusSearch-Regex' => array( // Configuration for regex searches
+ 'class' => 'PoolCounter_Client',
+ 'timeout' => 30,
+ 'workers' => 10,
+ 'maxqueue' => 0,
+ ),
+ 'CirrusSearch-NamespaceLookup' => array( // Configuration for funky
namespace lookups
+ 'class' => 'PoolCounter_Client',
+ 'timeout' => 10,
+ 'workers' => 20,
+ 'maxqueue' => 20,
+ ),
);
diff --git a/includes/Searcher.php b/includes/Searcher.php
index 59a690f..8b65363 100644
--- a/includes/Searcher.php
+++ b/includes/Searcher.php
@@ -1055,11 +1055,18 @@
$queryOptions[ 'search_type' ] = 'dfs_query_then_fetch';
}
- if ( $type === 'regex' ) {
+ switch( $type ) {
+ case 'regex':
$poolCounterType = 'CirrusSearch-Regex';
$queryOptions[ 'timeout' ] =
$wgCirrusSearchSearchShardTimeout[ 'regex' ];
Connection::setTimeout(
$wgCirrusSearchClientSideSearchTimeout[ 'regex' ] );
- } else {
+ break;
+ case 'prefix':
+ $poolCounterType = 'CirrusSearch-Prefix';
+ $queryOptions[ 'timeout' ] =
$wgCirrusSearchSearchShardTimeout[ 'default' ];
+ Connection::setTimeout(
$wgCirrusSearchClientSideSearchTimeout[ 'default' ] );
+ break;
+ default:
$poolCounterType = 'CirrusSearch-Search';
$queryOptions[ 'timeout' ] =
$wgCirrusSearchSearchShardTimeout[ 'default' ];
Connection::setTimeout(
$wgCirrusSearchClientSideSearchTimeout[ 'default' ] );
--
To view, visit https://gerrit.wikimedia.org/r/176941
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ief6b715681783508ddf9723d512201eaf4691299
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: master
Gerrit-Owner: Manybubbles <[email protected]>
Gerrit-Reviewer: Chad <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits