Commit 17b4b30
bin/server
@@ -2,4 +2,6 @@
cd "$(dirname "$0")/.."
-redis-server config/6380.conf
+PORT="${1:-6380}"
+
+redis-server "config/$PORT.conf"
config/6380.conf
@@ -1,257 +1,53 @@
+activedefrag no
+activerehashing no
+always-show-logo no
+aof-load-truncated yes
+aof-rewrite-incremental-fsync yes
+aof-use-rdb-preamble no
+appendfilename "6380.aof"
+appendfsync no
+appendonly yes
+auto-aof-rewrite-min-size 64mb
+auto-aof-rewrite-percentage 100
bind 127.0.0.1
-protected-mode yes
-port 6380
-timeout 0
+client-output-buffer-limit normal 0 0 0
+client-output-buffer-limit pubsub 0 0 0
+client-output-buffer-limit replica 0 0 0
+cluster-enabled no
daemonize no
-supervised no
-pidfile tmp/pids/6380.pid
-loglevel debug
-logfile "/dev/stdout"
-syslog-enabled no
databases 16
-always-show-logo no
-save "" # disable snapshotting
-stop-writes-on-bgsave-error no
-rdbcompression no
-rdbchecksum no
-sanitize-dump-payload no
dbfilename 6380.rdb
-rdb-del-sync-files no
dir ./db/
+dynamic-hz yes
+gopher-enabled no
+hz 10
+io-threads 1
+io-threads-do-reads no
+jemalloc-bg-thread yes
+latency-monitor-threshold 0
+list-compress-depth 0
+logfile "/dev/stdout"
+loglevel debug
+lua-time-limit 0
maxclients 32
maxmemory 33554432
+maxmemory-eviction-tenacity 0
maxmemory-policy noeviction
maxmemory-samples 3
-maxmemory-eviction-tenacity 0
-io-threads 1
-io-threads-do-reads no
-appendonly yes
-appendfilename "6380.aof"
-appendfsync no
no-appendfsync-on-rewrite no
-auto-aof-rewrite-percentage 100
-auto-aof-rewrite-min-size 64mb
-aof-load-truncated yes
-aof-use-rdb-preamble no
-lua-time-limit 0
-cluster-enabled no
-slowlog-log-slower-than 1000000
-slowlog-max-len 8
-latency-monitor-threshold 0
notify-keyspace-events ""
-gopher-enabled no
-list-compress-depth 0
-activerehashing no
-client-output-buffer-limit normal 0 0 0
-client-output-buffer-limit replica 0 0 0
-client-output-buffer-limit pubsub 0 0 0
-
-# Client query buffers accumulate new commands. They are limited to a fixed
-# amount by default in order to avoid that a protocol desynchronization (for
-# instance due to a bug in the client) will lead to unbound memory usage in
-# the query buffer. However you can configure it here if you have very special
-# needs, such us huge multi/exec requests or alike.
-#
-# client-query-buffer-limit 1gb
-
-# In the Redis protocol, bulk requests, that are, elements representing single
-# strings, are normally limited to 512 mb. However you can change this limit
-# here, but must be 1mb or greater
-#
-# proto-max-bulk-len 512mb
-
-# Redis calls an internal function to perform many background tasks, like
-# closing connections of clients in timeout, purging expired keys that are
-# never requested, and so forth.
-#
-# Not all tasks are performed with the same frequency, but Redis checks for
-# tasks to perform according to the specified "hz" value.
-#
-# By default "hz" is set to 10. Raising the value will use more CPU when
-# Redis is idle, but at the same time will make Redis more responsive when
-# there are many keys expiring at the same time, and timeouts may be
-# handled with more precision.
-#
-# The range is between 1 and 500, however a value over 100 is usually not
-# a good idea. Most users should use the default of 10 and raise this up to
-# 100 only in environments where very low latency is required.
-hz 10
-
-# Normally it is useful to have an HZ value which is proportional to the
-# number of clients connected. This is useful in order, for instance, to
-# avoid too many clients are processed for each background task invocation
-# in order to avoid latency spikes.
-#
-# Since the default HZ value by default is conservatively set to 10, Redis
-# offers, and enables by default, the ability to use an adaptive HZ value
-# which will temporarily raise when there are many connected clients.
-#
-# When dynamic HZ is enabled, the actual configured HZ will be used
-# as a baseline, but multiples of the configured HZ value will be actually
-# used as needed once more clients are connected. In this way an idle
-# instance will use very little CPU time while a busy instance will be
-# more responsive.
-dynamic-hz yes
-
-# When a child rewrites the AOF file, if the following option is enabled
-# the file will be fsync-ed every 32 MB of data generated. This is useful
-# in order to commit the file to the disk more incrementally and avoid
-# big latency spikes.
-aof-rewrite-incremental-fsync yes
-
-# When redis saves RDB file, if the following option is enabled
-# the file will be fsync-ed every 32 MB of data generated. This is useful
-# in order to commit the file to the disk more incrementally and avoid
-# big latency spikes.
+pidfile tmp/pids/6380.pid
+port 6380
+protected-mode yes
+rdb-del-sync-files no
rdb-save-incremental-fsync yes
-
-# Redis LFU eviction (see maxmemory setting) can be tuned. However it is a good
-# idea to start with the default settings and only change them after investigating
-# how to improve the performances and how the keys LFU change over time, which
-# is possible to inspect via the OBJECT FREQ command.
-#
-# There are two tunable parameters in the Redis LFU implementation: the
-# counter logarithm factor and the counter decay time. It is important to
-# understand what the two parameters mean before changing them.
-#
-# The LFU counter is just 8 bits per key, it's maximum value is 255, so Redis
-# uses a probabilistic increment with logarithmic behavior. Given the value
-# of the old counter, when a key is accessed, the counter is incremented in
-# this way:
-#
-# 1. A random number R between 0 and 1 is extracted.
-# 2. A probability P is calculated as 1/(old_value*lfu_log_factor+1).
-# 3. The counter is incremented only if R < P.
-#
-# The default lfu-log-factor is 10. This is a table of how the frequency
-# counter changes with a different number of accesses with different
-# logarithmic factors:
-#
-# +--------+------------+------------+------------+------------+------------+
-# | factor | 100 hits | 1000 hits | 100K hits | 1M hits | 10M hits |
-# +--------+------------+------------+------------+------------+------------+
-# | 0 | 104 | 255 | 255 | 255 | 255 |
-# +--------+------------+------------+------------+------------+------------+
-# | 1 | 18 | 49 | 255 | 255 | 255 |
-# +--------+------------+------------+------------+------------+------------+
-# | 10 | 10 | 18 | 142 | 255 | 255 |
-# +--------+------------+------------+------------+------------+------------+
-# | 100 | 8 | 11 | 49 | 143 | 255 |
-# +--------+------------+------------+------------+------------+------------+
-#
-# NOTE: The above table was obtained by running the following commands:
-#
-# redis-benchmark -n 1000000 incr foo
-# redis-cli object freq foo
-#
-# NOTE 2: The counter initial value is 5 in order to give new objects a chance
-# to accumulate hits.
-#
-# The counter decay time is the time, in minutes, that must elapse in order
-# for the key counter to be divided by two (or decremented if it has a value
-# less <= 10).
-#
-# The default value for the lfu-decay-time is 1. A special value of 0 means to
-# decay the counter every time it happens to be scanned.
-#
-# lfu-log-factor 10
-# lfu-decay-time 1
-
-########################### ACTIVE DEFRAGMENTATION #######################
-#
-# What is active defragmentation?
-# -------------------------------
-#
-# Active (online) defragmentation allows a Redis server to compact the
-# spaces left between small allocations and deallocations of data in memory,
-# thus allowing to reclaim back memory.
-#
-# Fragmentation is a natural process that happens with every allocator (but
-# less so with Jemalloc, fortunately) and certain workloads. Normally a server
-# restart is needed in order to lower the fragmentation, or at least to flush
-# away all the data and create it again. However thanks to this feature
-# implemented by Oran Agra for Redis 4.0 this process can happen at runtime
-# in a "hot" way, while the server is running.
-#
-# Basically when the fragmentation is over a certain level (see the
-# configuration options below) Redis will start to create new copies of the
-# values in contiguous memory regions by exploiting certain specific Jemalloc
-# features (in order to understand if an allocation is causing fragmentation
-# and to allocate it in a better place), and at the same time, will release the
-# old copies of the data. This process, repeated incrementally for all the keys
-# will cause the fragmentation to drop back to normal values.
-#
-# Important things to understand:
-#
-# 1. This feature is disabled by default, and only works if you compiled Redis
-# to use the copy of Jemalloc we ship with the source code of Redis.
-# This is the default with Linux builds.
-#
-# 2. You never need to enable this feature if you don't have fragmentation
-# issues.
-#
-# 3. Once you experience fragmentation, you can enable this feature when
-# needed with the command "CONFIG SET activedefrag yes".
-#
-# The configuration parameters are able to fine tune the behavior of the
-# defragmentation process. If you are not sure about what they mean it is
-# a good idea to leave the defaults untouched.
-
-# Enabled active defragmentation
-# activedefrag no
-
-# Minimum amount of fragmentation waste to start active defrag
-# active-defrag-ignore-bytes 100mb
-
-# Minimum percentage of fragmentation to start active defrag
-# active-defrag-threshold-lower 10
-
-# Maximum percentage of fragmentation at which we use maximum effort
-# active-defrag-threshold-upper 100
-
-# Minimal effort for defrag in CPU percentage, to be used when the lower
-# threshold is reached
-# active-defrag-cycle-min 1
-
-# Maximal effort for defrag in CPU percentage, to be used when the upper
-# threshold is reached
-# active-defrag-cycle-max 25
-
-# Maximum number of set/hash/zset/list fields that will be processed from
-# the main dictionary scan
-# active-defrag-max-scan-fields 1000
-
-# Jemalloc background thread for purging will be enabled by default
-jemalloc-bg-thread yes
-
-# It is possible to pin different threads and processes of Redis to specific
-# CPUs in your system, in order to maximize the performances of the server.
-# This is useful both in order to pin different Redis threads in different
-# CPUs, but also in order to make sure that multiple Redis instances running
-# in the same host will be pinned to different CPUs.
-#
-# Normally you can do this using the "taskset" command, however it is also
-# possible to this via Redis configuration directly, both in Linux and FreeBSD.
-#
-# You can pin the server/IO threads, bio threads, aof rewrite child process, and
-# the bgsave child process. The syntax to specify the cpu list is the same as
-# the taskset command:
-#
-# Set redis server/io threads to cpu affinity 0,2,4,6:
-# server_cpulist 0-7:2
-#
-# Set bio threads to cpu affinity 1,3:
-# bio_cpulist 1,3
-#
-# Set aof rewrite child process to cpu affinity 8,9,10,11:
-# aof_rewrite_cpulist 8-11
-#
-# Set bgsave child process to cpu affinity 1,10,11
-# bgsave_cpulist 1,10-11
-
-# In some cases redis will emit warnings and even refuse to start if it detects
-# that the system is in bad state, it is possible to suppress these warnings
-# by setting the following config which takes a space delimited list of warnings
-# to suppress
-#
-# ignore-warnings ARM64-COW-BUG
+rdbchecksum no
+rdbcompression no
+sanitize-dump-payload no
+save "" # disable snapshotting
+slowlog-log-slower-than 1000000
+slowlog-max-len 8
+stop-writes-on-bgsave-error no
+supervised no
+syslog-enabled no
+timeout 0
config/6381.conf
@@ -0,0 +1,53 @@
+activedefrag no
+activerehashing no
+always-show-logo no
+aof-load-truncated yes
+aof-rewrite-incremental-fsync yes
+aof-use-rdb-preamble no
+appendfilename "6381.aof"
+appendfsync no
+appendonly yes
+auto-aof-rewrite-min-size 64mb
+auto-aof-rewrite-percentage 100
+bind 127.0.0.1
+client-output-buffer-limit normal 0 0 0
+client-output-buffer-limit pubsub 0 0 0
+client-output-buffer-limit replica 0 0 0
+cluster-enabled no
+daemonize no
+databases 16
+dbfilename 6381.rdb
+dir ./db/
+dynamic-hz yes
+gopher-enabled no
+hz 10
+io-threads 1
+io-threads-do-reads no
+jemalloc-bg-thread yes
+latency-monitor-threshold 0
+list-compress-depth 0
+logfile "/dev/stdout"
+loglevel debug
+lua-time-limit 0
+maxclients 32
+maxmemory 33554432
+maxmemory-eviction-tenacity 0
+maxmemory-policy noeviction
+maxmemory-samples 3
+no-appendfsync-on-rewrite no
+notify-keyspace-events ""
+pidfile tmp/pids/6381.pid
+port 6381
+protected-mode yes
+rdb-del-sync-files no
+rdb-save-incremental-fsync yes
+rdbchecksum no
+rdbcompression no
+sanitize-dump-payload no
+save "" # disable snapshotting
+slowlog-log-slower-than 1000000
+slowlog-max-len 8
+stop-writes-on-bgsave-error no
+supervised no
+syslog-enabled no
+timeout 0