Home  >  Q&A  >  body text

jedis - redis存取数据很慢怎么办?

我用jedis操作redis数据库, 一秒钟只能get或set 100个key左右。

        JedisPool jedisPool = new JedisPool(poolConfig, "192.168.3.111");
        Jedis jedis = jedisPool.getResource();
        for(int i=0;i<999999;i++)
        {
            System.out.println(i);
            jedis.set("1","1");
        }

客户端分片之后速率也差不多, 有什么解决方案吗?(不使用pipeline)

phpcn_u1582phpcn_u15822733 days ago823

reply all(1)I'll reply

  • PHP中文网

    PHP中文网2017-04-25 09:05:04

    It’s not that redis is slow, it’s that you’re waiting for network io for multiple synchronizations.

    Consider using mget and mset

    reply
    0
  • Cancelreply