From: Aaron Schulz Date: Wed, 19 Apr 2017 22:38:32 +0000 (-0700) Subject: Lower the amount of jobs pushed into redis at once X-Git-Tag: 1.31.0-rc.0~3463^2 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/fiche.php?a=commitdiff_plain;h=0b58cdc7f2d95b84b5e6d1c2a62a17fdd94ce86a;p=lhc%2Fweb%2Fwiklou.git Lower the amount of jobs pushed into redis at once This further limits how long the server can be tied up by push(). Change-Id: I02d242578dadc19912c9fccfdcf5e15c5eb78e9e --- diff --git a/includes/jobqueue/JobQueueRedis.php b/includes/jobqueue/JobQueueRedis.php index c2c9d66119..eb91680815 100644 --- a/includes/jobqueue/JobQueueRedis.php +++ b/includes/jobqueue/JobQueueRedis.php @@ -75,6 +75,8 @@ class JobQueueRedis extends JobQueue { /** @var string Compression method to use */ protected $compression; + const MAX_PUSH_SIZE = 25; // avoid tying up the server + /** * @param array $params Possible keys: * - redisConfig : An array of parameters to RedisConnectionPool::__construct(). @@ -212,7 +214,7 @@ class JobQueueRedis extends JobQueue { if ( $flags & self::QOS_ATOMIC ) { $batches = [ $items ]; // all or nothing } else { - $batches = array_chunk( $items, 100 ); // avoid tying up the server + $batches = array_chunk( $items, self::MAX_PUSH_SIZE ); } $failed = 0; $pushed = 0;