9. BENCHMARK
$ docker run --name redis101 -d redis redis-server --appendonly yes
Persistence
127.0.0.1:6379> redis-benchmark -q -n 100000
root@3b41d7b54345:/data# redis-benchmark -q -n 100000
PING_INLINE: 48402.71 requests per second
PING_BULK: 48332.53 requests per second
SET: 51072.52 requests per second
GET: 52192.07 requests per second
INCR: 52631.58 requests per second
LPUSH: 51203.28 requests per second
RPUSH: 53937.43 requests per second
LPOP: 52328.62 requests per second
RPOP: 53908.36 requests per second
SADD: 52493.44 requests per second
SPOP: 51020.41 requests per second
LPUSH (needed to benchmark LRANGE): 53590.57 requests per second
LRANGE_100 (first 100 elements): 26759.43 requests per second
LRANGE_300 (first 300 elements): 12210.01 requests per second
LRANGE_500 (first 450 elements): 7393.17 requests per second
LRANGE_600 (first 600 elements): 7299.80 requests per second
MSET (10 keys): 42589.44 requests per second
root@9012bab64961:/# redis-benchmark -q -n 100000
PING_INLINE: 59523.81 requests per second
PING_BULK: 57537.40 requests per second
SET: 56179.78 requests per second
GET: 59808.61 requests per second
INCR: 60060.06 requests per second
LPUSH: 58038.30 requests per second
RPUSH: 59276.82 requests per second
LPOP: 60975.61 requests per second
RPOP: 57870.37 requests per second
SADD: 59523.81 requests per second
SPOP: 58445.36 requests per second
LPUSH (needed to benchmark LRANGE): 58479.53 requests per second
LRANGE_100 (first 100 elements): 35435.86 requests per second
LRANGE_300 (first 300 elements): 17488.63 requests per second
LRANGE_500 (first 450 elements): 12624.67 requests per second
LRANGE_600 (first 600 elements): 10293.36 requests per second
MSET (10 keys): 53447.35 requests per second
Run the benchmark with the default configuration against 127.0.0.1:6379:
$ redis-benchmark
Use 20 parallel clients, for a total of 100k requests, against 192.168.1.1:
$ redis-benchmark -h 192.168.1.1 -p 6379 -n 100000 -c 20
Fill 127.0.0.1:6379 with about 1 million keys only using the SET test:
$ redis-benchmark -t set -n 1000000 -r 100000000
Benchmark 127.0.0.1:6379 for a few commands producing CSV output:
$ redis-benchmark -t ping,set,get -n 100000 --csv
Benchmark a specific command line:
$ redis-benchmark -r 10000 -n 10000 eval 'return redis.call("ping")' 0
Fill a list with 10000 random elements:
$ redis-benchmark -r 10000 -n 10000 lpush mylist __rand_int__
http://dogancan.net
10. VERİ TİPLERİ
× Strings
× Lists
× Hashes
× Sets
× Sorted sets
× Geo
APPEND
BITCOUNT
BITFIELD
BITOP
BITPOS
DECR
DECRBY
GET
GETBIT
GETRANGE
GETSET
INCR
INCRBY
INCRBYFLOAT
MGET
MSET
MSETNX
PSETEX
SET
SETBIT
SETEX
SETNX
SETRANGE
STRLEN
127.0.0.1:6379> SET falan filan
OK
127.0.0.1:6379> GET falan
"filan"
127.0.0.1:6379> GET falan vesaire
(error) ERR wrong number of arguments for 'get' command
127.0.0.1:6379> MGET falan vesaire
1) "filan"
2) (nil)
127.0.0.1:6379> INCR sayac
(integer) 1
127.0.0.1:6379> INCR sayac
(integer) 2
127.0.0.1:6379> GET sayac
"2"
127.0.0.1:6379> INCRBY sayac 10
(integer) 12
127.0.0.1:6379> GET sayac
“12"
127.0.0.1:6379> DECR sayac
(integer) 11
127.0.0.1:6379> GET sayac
“11"
http://dogancan.net