-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider PhpRedis backend for redis #745
Comments
Voting for it. |
+1 |
Will do some tests when redis is ready to see whats better / faster. |
Resis seem the best performance/stability solution. I m waiting a stable support to test it! |
+1 for ability to use phpredis extension https://github.com/nicolasff/phpredis/ |
now i'm usign redis 2.6 with yii2 , and everythink is working good and stable. |
+1 for native phpredis ext support Just tested perfomance difference on this simple script (writting and reading 1000 keys): $CNT = 1000;
$keys = range(1, $CNT);
$phpredis = new \Redis();
$redis = Yii::$app->cache; // Configured as yii\redis\Cache
//$phpredis->connect('127.0.0.1', 6379);
$phpredis->connect('/var/run/redis/redis.sock');
$start = microtime(true);
for($i=0; $i<$CNT; $i++) {
$phpredis->setex($keys[$i], $i, 300);
}
for($i=0; $i<$CNT; $i++) {
$phpredis->get($keys[$i]);
}
echo (microtime(true)-$start).'<br>';
$start = microtime(true);
for($i=0; $i<$CNT; $i++) {
$redis->set($keys[$i], $i, 300);
}
for($i=0; $i<$CNT; $i++) {
$redis->get($keys[$i]);
}
echo (microtime(true)-$start); Results are (on real production server, Ubuntu 14.04, E5-2620v2):
As for me - difference is huge. Also:
|
Also using phpredis as a di service. Would be a + if we have that out of the box. |
What do you mean with that? can you please elaborate a bit? |
I mean that I use https://github.com/nicolasff/phpredis but I set it up in my "components" section of a config. So Redis class is available from DI container as a service. I DO NOT use redis ActiveRecord |
+1 for native phpredis ext support |
+1 |
Moved to yiisoft/yii2-redis#45 |
#743
The text was updated successfully, but these errors were encountered: