I have Redis running slow?

Installed redis on the VPS using Python and check the speed reading simple scription. Gives 6000 requests per second. I read about redis was expecting to see numbers in the tens of thousands of requests per second.
Can I somehow meyrueis?
Enlighten how to improve performance)
April 3rd 20 at 17:21
4 answers
April 3rd 20 at 17:23
Or maybe it's "simple script" brake? Check redis-benchmark'om
redis-bashmak gives 100k requests per second
As the script can be slow, if there are only read requests?))) - kelton commented on April 3rd 20 at 17:26
redis-bashmak gives 100k requests per second

@kelton, the script can be slow if it was written by a clumsy author, redis-benchmark and history of your questions allude to that. The script in the Studio. - garett.Nienow50 commented on April 3rd 20 at 17:29
@garett.Nienow50, )))
import redis
from datetime import datetime

r = redis.Redis()


for i in range(1,100000):
 r.append(i, f'{i}dqf')
t1 = datetime.now()
for i in range(1,100000):
r.get(i)

t2 = datetime.now()
print(t1)
print(t2)
- kelton commented on April 3rd 20 at 17:32
@garett.Nienow50, what? - kelton commented on April 3rd 20 at 17:35
@kelton, there are I/O overhead from the python interaction<->redis, I have shows in the region of 18-22k per second, if all requests to combine into a pipeline, in the 78-88ะบ. Well, there is only one process involved.
import time

import redis

COUNT = 100_000
client = redis.Redis()

for i in range(COUNT):
 client.append(i, f'{i}dqf')

now = time.monotonic()
for i in range(COUNT):
client.get(i)
print(COUNT / (time.monotonic() - now))


now = time.monotonic()
with client.pipeline() as pl:
 for i in range(COUNT):
pl.get(i)
pl.execute()
print(COUNT / (time.monotonic() - now))
- garett.Nienow50 commented on April 3rd 20 at 17:38
@garett.Nienow50, and how PHP will issue approximately? - kelton commented on April 3rd 20 at 17:41
@kelton, I have no idea, write in php and check - garett.Nienow50 commented on April 3rd 20 at 17:44
@garett.Nienow50, why so poorly?
70k requests per second.
Is memory after all, there must be 40 times faster than SSD. - kelton commented on April 3rd 20 at 17:47
@kelton, with a fright that poorly? - garett.Nienow50 commented on April 3rd 20 at 17:50
@garett.Nienow50, where if you close the connection and open (as normally happens) (the user comes to the site, for it opens a connection, the request is made and the connection is closed) it turns out like Mysql about 2000 requests per second - kelton commented on April 3rd 20 at 17:53
@kelton, you have to Stop thinking about something abstractly and solve the real problem. Where at least one mvp project described to you? All I see is questions about some possible problems in the future, which survives to a very small part of the projects. And by the time they occur, inside projects are already very different from the initial stages. - garett.Nienow50 commented on April 3rd 20 at 17:56
@kelton,
if you close the connection and open (as normally happens)

Read about the connection pool - Hardy_Kozey33 commented on April 3rd 20 at 17:59
@kelton,
Is memory after all, there must be 40 times faster


It is not only memory but also network communication. - Hardy_Kozey33 commented on April 3rd 20 at 18:02
@Hardy_Kozey33with lokalhosta)))) - kelton commented on April 3rd 20 at 18:05
@kelton, read by tcp and reading from memory - not the same thing. - Hardy_Kozey33 commented on April 3rd 20 at 18:08
@Hardy_Kozey33, in the same unix socket that is not slow. Well, at least in linux, all files, so maybe it's not in Redis. I hope that everything will be OK and performance will be high - kelton commented on April 3rd 20 at 18:11
@keltonIn Libe for radishes from pypi lot of time spent on the preparation of the keys and every interaction inside libs. Do it yourself, interact with the sockets and radishes in his Protocol itself, once you something is missing. - warren_Sawayn commented on April 3rd 20 at 18:14
@warren_Sawayn, I just enough. Just have a project and there is need to store data that need to quickly - kelton commented on April 3rd 20 at 18:17
@kelton, again, abstract "fast", the base also can quickly give. - garett.Nienow50 commented on April 3rd 20 at 18:20
@garett.Nienow50, Yes, I know. But she's not well in the project. Decided to shift some of the load for fast In Memory - kelton commented on April 3rd 20 at 18:23
April 3rd 20 at 17:25
To query competitive.
April 3rd 20 at 17:27
Probably because it's single-threaded and for acceleration it is necessary to raise a cluster of several nodes. There are, however, your pictures will be. Like asynchronous
April 3rd 20 at 17:29
I wrote a Python test script. He gave me 24000 operations per second. set/get

Find more questions by tags PythonRedis