go-redis-migrate

command module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 28, 2023 License: MIT Imports: 10 Imported by: 0

README ΒΆ

πŸš€ Redis command replicator πŸš€

This program is a Redis command processor that reads commands from a source Redis instance, processes them, and then writes them to a target Redis instance. It's a multi-threaded application that uses a worker-pool pattern for processing commands concurrently. This program also keeps track of the number of executed commands for performance monitoring.

πŸ“ Features πŸ“

  • Reads commands from a source Redis instance
  • Waits for target to becomem writeable (role:master)
  • Processes commands and writes them to a target Redis instance
  • Multi-threaded operation using a worker-pool pattern for processing commands concurrently
  • Performance monitoring with a command counter

πŸ› οΈ How to use πŸ› οΈ

You can customize the source and target Redis hosts via command-line flags. There is also a debug mode flag to increase logging verbosity.

Example usage:

redis-migrate -sourceHost "localhost:6379" -targetHost "localhost:6380" -debug

πŸ“ˆ Performance Monitoring πŸ“ˆ

The program keeps track of the number of executed commands in a thread-safe manner. It uses atomic operations to update a global counter. The counters are logged every second to monitor the system's performance.

🚨 Warning 🚨

As specified in the Redis docs running MONITOR can have serious impact on performance, up to 50% performance hit depending on the workload. The benchmark exmaple is quite extreme as that is maxing the capabilities of Redis and hopefully your normal workload is not near 100% resource usage. I would seriously recommend ensuring their is enough resource capacity on your source Redis instance before running this program.

It would be better to have this as a proxy to then proxy to both Redis instance but I want to have this without any modification to the stack.

Documentation ΒΆ

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL