Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug #30518 [Cache] Fix perf when using RedisCluster by reducing round…
…trips to the servers (nicolas-grekas) This PR was merged into the 3.4 branch. Discussion ---------- [Cache] Fix perf when using RedisCluster by reducing roundtrips to the servers | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | License | MIT This is slimmed down version of: #28269 _(many of the fixes there are already part of 3.4)_ Does: - Adds test coverage for Predis with RedisCluster - Removes usage of key versioning when on RedisCluster, besides performance aspect of that it simplifies / aligning clear() handling across all clients - reuse doDelete() from clear to make sure we call singular del calls when in predis cluster Commits ------- dacf179 [Cache] Fix perf when using RedisCluster by reducing roundtrips to the servers
- Loading branch information
Showing
2 changed files
with
46 additions
and
22 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
src/Symfony/Component/Cache/Tests/Adapter/PredisRedisClusterAdapterTest.php
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <fabien@symfony.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\Component\Cache\Tests\Adapter; | ||
|
||
class PredisRedisClusterAdapterTest extends AbstractRedisAdapterTest | ||
{ | ||
public static function setupBeforeClass() | ||
{ | ||
if (!$hosts = getenv('REDIS_CLUSTER_HOSTS')) { | ||
self::markTestSkipped('REDIS_CLUSTER_HOSTS env var is not defined.'); | ||
} | ||
self::$redis = new \Predis\Client(explode(' ', $hosts), ['cluster' => 'redis']); | ||
} | ||
|
||
public static function tearDownAfterClass() | ||
{ | ||
self::$redis = null; | ||
} | ||
} |
This file contains 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