M
M
Michail Wowtschuk2018-10-23 19:02:26
Redis
Michail Wowtschuk, 2018-10-23 19:02:26

How many active connections can Redis keep?

Those who know, tell me, how many active connections can Redis keep?
I thought that Redis can keep at least 1,000,000 connections, but I have more than 4,000 workers that cannot connect to Redis, it immediately gives an error (error) ERR max number of clients reached, that the number of connections is maximum. Workers are connected all the time, they are not disconnected during operation, since each worker takes a small amount of data from the database, processes it and writes the result to the database.
The data in the database is stored as an rpush/lpop stack. With basis I work through a socket.
Data:
Server - droplet on 64Gb DigitalOcean
PHP 5.5
redisphp
Redis driver latest stable from source
Redis settings
tcp-backlog 65536
maxclients 10000
//Connecting to Redis from PHP
$redis = new Redis();
//$redis->connect('127.0.0.1', 6379);
$redis->connect('/tmp/redis.sock', 0); //Connect via socket
I want at least 10,000 workers to connect to Redis, but how can I do this on a single server?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
C
Caretaker, 2018-10-25
@wowtschuk

If I understand correctly, you mean a forked process by the term "worker".
In principle, then it is clear why each worker raises its own connection with the radish instead of having one connection in the main thread and all workers could work through it ...
But in principle, as an option without rewriting the code and altering the architecture, I can advise you to raise several radish instances, link them into a "star" (Master + N Slave) and workers connect to slaves and work through them ...
PS. I am not a specialist in radishes, I myself only delve into the details, tk. I had problems with the data stream that I drive through it myself (PUB / SUB) and began to notice data loss ...

D
Dimonchik, 2018-10-23
@dimonchik2013

write a billion in maxclients
default something like 10k, it's hard to imagine why you might need more

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question