Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit 95f9041

Browse files
committed
Add sentinel tests on .NET Core
1 parent 1ade178 commit 95f9041

9 files changed

Lines changed: 555 additions & 218 deletions

File tree

src/sentinel/redis-6380/redis.windows.conf

Lines changed: 142 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
# On Windows, daemonize and pidfile are not supported.
3636
# However, you can run redis as a Windows service, and specify a logfile.
37-
# The logfile will contain the pid.
37+
# The logfile will contain the pid.
3838

3939
# Accept connections on the specified port, default is 6379.
4040
# If port 0 is specified Redis will not listen on a TCP socket.
@@ -96,12 +96,12 @@ tcp-keepalive 0
9696
loglevel verbose
9797

9898
# Specify the log file name. Also 'stdout' can be used to force
99-
# Redis to log on the standard output.
99+
# Redis to log on the standard output.
100100
logfile ""
101101

102-
# To enable logging to the Windows EventLog, just set 'syslog-enabled' to
102+
# To enable logging to the Windows EventLog, just set 'syslog-enabled' to
103103
# yes, and optionally update the other syslog parameters to suit your needs.
104-
# If Redis is installed and launched as a Windows Service, this will
104+
# If Redis is installed and launched as a Windows Service, this will
105105
# automatically be enabled.
106106
# syslog-enabled no
107107

@@ -176,9 +176,9 @@ dbfilename "dump.rdb"
176176
#
177177
# The DB will be written inside this directory, with the filename specified
178178
# above using the 'dbfilename' configuration directive.
179-
#
179+
#
180180
# The Append Only File will also be created inside this directory.
181-
#
181+
#
182182
# Note that you must specify a directory here, not a file name.
183183
dir "C:\\src\\ServiceStack.Redis\\src\\sentinel\\redis-6380"
184184

@@ -379,7 +379,7 @@ slave-priority 100
379379
#
380380
# This should stay commented out for backward compatibility and because most
381381
# people do not need auth (e.g. they run their own servers).
382-
#
382+
#
383383
# Warning: since Redis is pretty fast an outside user can try up to
384384
# 150k passwords per second against a good box. This means that you should
385385
# use a very strong password otherwise it will be very easy to break.
@@ -418,63 +418,14 @@ slave-priority 100
418418
#
419419
# maxclients 10000
420420

421-
# The Linux version of Redis relies on the system call fork() to perform
422-
# point-in-time snapshots of the heap. In addition to the AOF and RDB backup
423-
# mechanism, the master-slave synchronization and clustering features are
424-
# dependent on this behavior of fork(). In order for the Windows version to
425-
# perform like the Linux version we had to simulate this aspect of fork().
426-
# Doing so meant moving the Redis heap into a memory mapped file that can
427-
# be shared with a child process.
428-
#
429-
# *** There must be disk space available for this file in order for Redis
430-
# to launch. *** The default configuration places this file in the local
431-
# appdata directory. If you wish to move this file to another local disk,
432-
# use the heapdir flag as described below.
433-
#
434-
# The maxheap flag controls the maximum size of this memory mapped file,
435-
# as well as the total usable space for the Redis heap. Running Redis
436-
# without either maxheap or maxmemory will result in a memory mapped file
437-
# being created that is equal to the size of physical memory. During
438-
# fork() operations the total page file commit will max out at around:
439-
#
440-
# (size of physical memory) + (2 * size of maxheap)
441-
#
442-
# For instance, on a machine with 8GB of physical RAM, the max page file
443-
# commit with the default maxheap size will be (8)+(2*8) GB , or 24GB. The
444-
# default page file sizing of Windows will allow for this without having
445-
# to reconfigure the system. Larger heap sizes are possible, but the maximum
446-
# page file size will have to be increased accordingly.
447-
#
448-
# The Redis heap must be larger than the value specified by the maxmemory
449-
# flag, as the heap allocator has its own memory requirements and
450-
# fragmentation of the heap is inevitable. If only the maxmemory flag is
451-
# specified, maxheap will be set at 1.5*maxmemory. If the maxheap flag is
452-
# specified along with maxmemory, the maxheap flag will be automatically
453-
# increased if it is smaller than 1.5*maxmemory.
454-
#
455-
# maxheap <bytes>
456-
maxheap 1gb
457-
458-
# The heap memory mapped file must reside on a local path for heap sharing
459-
# between processes to work. A UNC path will not suffice here. For maximum
460-
# performance this should be located on the fastest local drive available.
461-
# This value defaults to the local application data folder(e.g.,
462-
# "%USERPROFILE%\AppData\Local"). Since this file can be very large, you
463-
# may wish to place this on a drive other than the one the operating system
464-
# is installed on.
465-
#
466-
# Note that you must specify a directory here, not a file name.
467-
# heapdir <directory path(absolute or relative)>
468-
heapdir C:\\src\\ServiceStack.Redis\\src\\sentinel\\redis-6380
469-
470421
# If Redis is to be used as an in-memory-only cache without any kind of
471422
# persistence, then the fork() mechanism used by the background AOF/RDB
472-
# persistence is unneccessary. As an optimization, all persistence can be
473-
# turned off in the Windows version of Redis. This will disable the creation of
474-
# the memory mapped heap file, redirect heap allocations to the system heap
475-
# allocator, and disable commands that would otherwise cause fork() operations:
476-
# BGSAVE and BGREWRITEAOF. This flag may not be combined with any of the other
477-
# flags that configure AOF and RDB operations.
423+
# persistence is unnecessary. As an optimization, all persistence can be
424+
# turned off in the Windows version of Redis. This will redirect heap
425+
# allocations to the system heap allocator, and disable commands that would
426+
# otherwise cause fork() operations: BGSAVE and BGREWRITEAOF.
427+
# This flag may not be combined with any of the other flags that configure
428+
# AOF and RDB operations.
478429
# persistence-available [(yes)|no]
479430

480431
# Don't use more memory than the specified amount of bytes.
@@ -500,18 +451,33 @@ heapdir C:\\src\\ServiceStack.Redis\\src\\sentinel\\redis-6380
500451
# limit for maxmemory so that there is some free RAM on the system for slave
501452
# output buffers (but this is not needed if the policy is 'noeviction').
502453
#
454+
# WARNING: not setting maxmemory will cause Redis to terminate with an
455+
# out-of-memory exception if the heap limit is reached.
456+
#
457+
# NOTE: since Redis uses the system paging file to allocate the heap memory,
458+
# the Working Set memory usage showed by the Windows Task Manager or by other
459+
# tools such as ProcessExplorer will not always be accurate. For example, right
460+
# after a background save of the RDB or the AOF files, the working set value
461+
# may drop significantly. In order to check the correct amount of memory used
462+
# by the redis-server to store the data, use the INFO client command. The INFO
463+
# command shows only the memory used to store the redis data, not the extra
464+
# memory used by the Windows process for its own requirements. Th3 extra amount
465+
# of memory not reported by the INFO command can be calculated subtracting the
466+
# Peak Working Set reported by the Windows Task Manager and the used_memory_peak
467+
# reported by the INFO command.
468+
#
503469
# maxmemory <bytes>
504470

505471
# MAXMEMORY POLICY: how Redis will select what to remove when maxmemory
506472
# is reached. You can select among five behaviors:
507-
#
473+
#
508474
# volatile-lru -> remove the key with an expire set using an LRU algorithm
509475
# allkeys-lru -> remove any key according to the LRU algorithm
510476
# volatile-random -> remove a random key with an expire set
511477
# allkeys-random -> remove a random key, any key
512478
# volatile-ttl -> remove the key with the nearest expire time (minor TTL)
513479
# noeviction -> don't expire at all, just return an error on write operations
514-
#
480+
#
515481
# Note: with any of the above policies, Redis will return an error on write
516482
# operations, when there are no suitable keys for eviction.
517483
#
@@ -600,15 +566,15 @@ appendfsync everysec
600566
# the same as "appendfsync none". In practical terms, this means that it is
601567
# possible to lose up to 30 seconds of log in the worst scenario (with the
602568
# default Linux settings).
603-
#
569+
#
604570
# If you have latency problems turn this to "yes". Otherwise leave it as
605571
# "no" that is the safest pick from the point of view of durability.
606572
no-appendfsync-on-rewrite no
607573

608574
# Automatic rewrite of the append only file.
609575
# Redis is able to automatically rewrite the log file implicitly calling
610576
# BGREWRITEAOF when the AOF log size grows by the specified percentage.
611-
#
577+
#
612578
# This is how it works: Redis remembers the size of the AOF file after the
613579
# latest rewrite (if no rewrite has happened since the restart, the size of
614580
# the AOF at startup is used).
@@ -667,6 +633,114 @@ aof-load-truncated yes
667633
# Set it to 0 or a negative value for unlimited execution without warnings.
668634
lua-time-limit 5000
669635

636+
################################ REDIS CLUSTER ###############################
637+
#
638+
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
639+
# WARNING EXPERIMENTAL: Redis Cluster is considered to be stable code, however
640+
# in order to mark it as "mature" we need to wait for a non trivial percentage
641+
# of users to deploy it in production.
642+
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
643+
#
644+
# Normal Redis instances can't be part of a Redis Cluster; only nodes that are
645+
# started as cluster nodes can. In order to start a Redis instance as a
646+
# cluster node enable the cluster support uncommenting the following:
647+
#
648+
# cluster-enabled yes
649+
650+
# Every cluster node has a cluster configuration file. This file is not
651+
# intended to be edited by hand. It is created and updated by Redis nodes.
652+
# Every Redis Cluster node requires a different cluster configuration file.
653+
# Make sure that instances running in the same system do not have
654+
# overlapping cluster configuration file names.
655+
#
656+
# cluster-config-file nodes-6379.conf
657+
658+
# Cluster node timeout is the amount of milliseconds a node must be unreachable
659+
# for it to be considered in failure state.
660+
# Most other internal time limits are multiple of the node timeout.
661+
#
662+
# cluster-node-timeout 15000
663+
664+
# A slave of a failing master will avoid to start a failover if its data
665+
# looks too old.
666+
#
667+
# There is no simple way for a slave to actually have a exact measure of
668+
# its "data age", so the following two checks are performed:
669+
#
670+
# 1) If there are multiple slaves able to failover, they exchange messages
671+
# in order to try to give an advantage to the slave with the best
672+
# replication offset (more data from the master processed).
673+
# Slaves will try to get their rank by offset, and apply to the start
674+
# of the failover a delay proportional to their rank.
675+
#
676+
# 2) Every single slave computes the time of the last interaction with
677+
# its master. This can be the last ping or command received (if the master
678+
# is still in the "connected" state), or the time that elapsed since the
679+
# disconnection with the master (if the replication link is currently down).
680+
# If the last interaction is too old, the slave will not try to failover
681+
# at all.
682+
#
683+
# The point "2" can be tuned by user. Specifically a slave will not perform
684+
# the failover if, since the last interaction with the master, the time
685+
# elapsed is greater than:
686+
#
687+
# (node-timeout * slave-validity-factor) + repl-ping-slave-period
688+
#
689+
# So for example if node-timeout is 30 seconds, and the slave-validity-factor
690+
# is 10, and assuming a default repl-ping-slave-period of 10 seconds, the
691+
# slave will not try to failover if it was not able to talk with the master
692+
# for longer than 310 seconds.
693+
#
694+
# A large slave-validity-factor may allow slaves with too old data to failover
695+
# a master, while a too small value may prevent the cluster from being able to
696+
# elect a slave at all.
697+
#
698+
# For maximum availability, it is possible to set the slave-validity-factor
699+
# to a value of 0, which means, that slaves will always try to failover the
700+
# master regardless of the last time they interacted with the master.
701+
# (However they'll always try to apply a delay proportional to their
702+
# offset rank).
703+
#
704+
# Zero is the only value able to guarantee that when all the partitions heal
705+
# the cluster will always be able to continue.
706+
#
707+
# cluster-slave-validity-factor 10
708+
709+
# Cluster slaves are able to migrate to orphaned masters, that are masters
710+
# that are left without working slaves. This improves the cluster ability
711+
# to resist to failures as otherwise an orphaned master can't be failed over
712+
# in case of failure if it has no working slaves.
713+
#
714+
# Slaves migrate to orphaned masters only if there are still at least a
715+
# given number of other working slaves for their old master. This number
716+
# is the "migration barrier". A migration barrier of 1 means that a slave
717+
# will migrate only if there is at least 1 other working slave for its master
718+
# and so forth. It usually reflects the number of slaves you want for every
719+
# master in your cluster.
720+
#
721+
# Default is 1 (slaves migrate only if their masters remain with at least
722+
# one slave). To disable migration just set it to a very large value.
723+
# A value of 0 can be set but is useful only for debugging and dangerous
724+
# in production.
725+
#
726+
# cluster-migration-barrier 1
727+
728+
# By default Redis Cluster nodes stop accepting queries if they detect there
729+
# is at least an hash slot uncovered (no available node is serving it).
730+
# This way if the cluster is partially down (for example a range of hash slots
731+
# are no longer covered) all the cluster becomes, eventually, unavailable.
732+
# It automatically returns available as soon as all the slots are covered again.
733+
#
734+
# However sometimes you want the subset of the cluster which is working,
735+
# to continue to accept queries for the part of the key space that is still
736+
# covered. In order to do so, just set the cluster-require-full-coverage
737+
# option to no.
738+
#
739+
# cluster-require-full-coverage yes
740+
741+
# In order to setup your cluster make sure to read the documentation
742+
# available at http://redis.io web site.
743+
670744
################################## SLOW LOG ###################################
671745

672746
# The Redis Slow Log is a system to log queries that exceeded a specified
@@ -675,7 +749,7 @@ lua-time-limit 5000
675749
# but just the time needed to actually execute the command (this is the only
676750
# stage of command execution where the thread is blocked and can not serve
677751
# other requests in the meantime).
678-
#
752+
#
679753
# You can configure the slow log with two parameters: one tells Redis
680754
# what is the execution time, in microseconds, to exceed in order for the
681755
# command to get logged, and the other parameter is the length of the
@@ -806,7 +880,7 @@ hll-sparse-max-bytes 3000
806880
# that is rehashing, the more rehashing "steps" are performed, so if the
807881
# server is idle the rehashing is never complete and some more memory is used
808882
# by the hash table.
809-
#
883+
#
810884
# The default is to use this millisecond 10 times every second in order to
811885
# actively rehash the main dictionaries, freeing memory when possible.
812886
#

0 commit comments

Comments
 (0)