Home  >  Q&A  >  body text

关于 redis连接数 和 redis性能 的关系

一直对redis连接数redis性能的关系一知半解,我知道redis是单进程单线程,但是具体就不清楚了.
期间查了一些资料也没有找到想要的答案,希望能给一下详细的解释,或者给个链接也好

大家讲道理大家讲道理2732 days ago851

reply all(3)I'll reply

  • 天蓬老师

    天蓬老师2017-04-27 09:04:13

    Redis uses epoll technology internally, which is multiplexed IO. When the number of connections is very high, it has better processing performance, and redis is single-threaded to avoid context switching.

    reply
    0
  • PHP中文网

    PHP中文网2017-04-27 09:04:13

    Redis is single threaded. How can I exploit multiple CPU / cores?
    It's very unlikely that CPU becomes your bottleneck with Redis, as usually Redis is either memory or network bound. For instance, using pipelining Redis running on an average Linux system can deliver even 500k requests per second, so if your application mainly uses O(N) or O(log(N)) commands, it is hardly going to use too much CPU.
    However, to maximize CPU usage you can start multiple instances of Redis in the same box and treat them as different servers. At some point a single box may not be enough anyway, so if you want to use multiple CPUs you can start thinking of some way to shard earlier.
    You can find more information about using multiple Redis instances in the Partitioning page.

    FAQ

    reply
    0
  • 某草草

    某草草2017-04-27 09:04:13

    Multiple redis clients will cause a lot of IO overhead. The data exchange between each node is not as complicated as Ehcache. Each has its own shortcomings, haha

    reply
    0
  • Cancelreply