mirror of
https://github.com/predis/predis.git
synced 2026-09-04 14:56:47 +00:00
Update FAQ for performance numbers.
This commit is contained in:
+14
-14
@@ -6,17 +6,17 @@ ____________________________________________
|
||||
|
||||
It really depends, but most of the times the answer is: _yes, it is fast enough_. I will give you
|
||||
a couple of easy numbers using a single Predis client with PHP 5.3.5 (custom build) and Redis 2.2
|
||||
(localhost) under Ubuntu 10.10 (running on a Intel Q6600):
|
||||
(localhost) under Ubuntu 11.04 (running on a Intel Q6600):
|
||||
|
||||
19100 SET/sec using 12 bytes for both key and value
|
||||
18600 GET/sec while retrieving the very same values
|
||||
19600 SET/sec using 12 bytes for both key and value
|
||||
18900 GET/sec while retrieving the very same values
|
||||
0.200 seconds to fetch 30000 keys using _KEYS *_.
|
||||
|
||||
How does it compare with a nice C-based extension such as [__phpredis__](http://github.com/nicolasff/phpredis)?
|
||||
|
||||
29000 SET/sec using 12 bytes for both key and value
|
||||
30000 GET/sec while retrieving the very same values
|
||||
0.037 seconds to fetch 30000 keys using "KEYS *"".
|
||||
30500 SET/sec using 12 bytes for both key and value
|
||||
31000 GET/sec while retrieving the very same values
|
||||
0.030 seconds to fetch 30000 keys using "KEYS *"".
|
||||
|
||||
Wow, __phpredis__ looks so much faster! Well we are comparing a C extension with a pure-PHP library so
|
||||
lower numbers are quite expected, but there is a fundamental flaw in them: is this really how you are
|
||||
@@ -30,14 +30,14 @@ Redis, but how these numbers change when we hit the network by connecting to ins
|
||||
reside on other servers?
|
||||
|
||||
Using Predis:
|
||||
3200 SET/sec using 12 bytes for both key and value
|
||||
3200 GET/sec while retrieving the very same values
|
||||
0.212 seconds to fetch 30000 keys using "KEYS *".
|
||||
3600 SET/sec using 12 bytes for both key and value
|
||||
3600 GET/sec while retrieving the very same values
|
||||
0.210 seconds to fetch 30000 keys using "KEYS *".
|
||||
|
||||
Using phpredis:
|
||||
3300 SET/sec using 12 bytes for both key and value
|
||||
3300 GET/sec while retrieving the very same values
|
||||
0.088 seconds to fetch 30000 keys using "KEYS *".
|
||||
4000 SET/sec using 12 bytes for both key and value
|
||||
4000 GET/sec while retrieving the very same values
|
||||
0.051 seconds to fetch 30000 keys using "KEYS *".
|
||||
|
||||
There you go, you get almost the same average numbers and the reason is quite simple: network latency
|
||||
is a real performance killer and you cannot do (almost) anything about that. As a disclaimer, please
|
||||
@@ -63,8 +63,8 @@ _GET_), but the speed for parsing multi-bulk replies is now on par with phpredis
|
||||
|
||||
Using Predis with a phpiredis-based connection to fetch 30000 keys using _KEYS *_:
|
||||
|
||||
0.037 seconds from a local Redis instance
|
||||
0.081 seconds from a remote Redis instance
|
||||
0.031 seconds from a local Redis instance
|
||||
0.058 seconds from a remote Redis instance
|
||||
|
||||
|
||||
### If I need to install a C extension to get better performances, why not using phpredis? ###
|
||||
|
||||
Reference in New Issue
Block a user