We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
使用jodis对Codis压测与使用redis-benchmark压测性能差距很大,不知道原因是什么。 其中使用jodis的程序代码为: import io.codis.jodis.JedisResourcePool; import io.codis.jodis.RoundRobinJedisPool; import redis.clients.jedis.Jedis; import redis.clients.jedis.JedisPoolConfig;
public class TestServer extends Thread {
private static JedisResourcePool jedisResourcePool;
private static int loop = 1000000000;
private static final int threadNum = 300;
private static final String key = "test";
static { JedisPoolConfig jedisPoolConfig = new JedisPoolConfig(); jedisPoolConfig.setMaxTotal(300); jedisPoolConfig.setMaxIdle(300); jedisPoolConfig.setJmxEnabled(true);
jedisResourcePool = RoundRobinJedisPool.create() .curatorClient("172.168.3.116:2181", 3000).poolConfig(jedisPoolConfig) .zkProxyDir("/jodis/codis-demo").build();
}
public void run() { Jedis jedis = jedisResourcePool.getResource(); for (int i = 0; i < loop; i++) { jedis.set(key + i, key + i); System.out.println(Thread.currentThread().getName() + "-------------------" + jedis.get(key + i)); } }
public static void main(String[] args) { for (int i = 0; i < threadNum; i++) { new TestServer().start(); }
} } 使用benchmark的命令行为: sudo /usr/bin/redis-benchmark -h 172.168.3.61 -p 19000 -c 300 -n 100000 -l
性能测试结果分别为20k和100k,请问是什么原因呢?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
使用jodis对Codis压测与使用redis-benchmark压测性能差距很大,不知道原因是什么。
其中使用jodis的程序代码为:
import io.codis.jodis.JedisResourcePool;
import io.codis.jodis.RoundRobinJedisPool;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPoolConfig;
public class TestServer extends Thread {
private static JedisResourcePool jedisResourcePool;
private static int loop = 1000000000;
private static final int threadNum = 300;
private static final String key = "test";
static {
JedisPoolConfig jedisPoolConfig = new JedisPoolConfig();
jedisPoolConfig.setMaxTotal(300);
jedisPoolConfig.setMaxIdle(300);
jedisPoolConfig.setJmxEnabled(true);
}
public void run() {
Jedis jedis = jedisResourcePool.getResource();
for (int i = 0; i < loop; i++) {
jedis.set(key + i, key + i);
System.out.println(Thread.currentThread().getName() + "-------------------" + jedis.get(key + i));
}
}
public static void main(String[] args) {
for (int i = 0; i < threadNum; i++) {
new TestServer().start();
}
}
}
使用benchmark的命令行为:
sudo /usr/bin/redis-benchmark -h 172.168.3.61 -p 19000 -c 300 -n 100000 -l
性能测试结果分别为20k和100k,请问是什么原因呢?
The text was updated successfully, but these errors were encountered: