Coder Social home page Coder Social logo

hto / redis-large-hset-del Goto Github PK

View Code? Open in Web Editor NEW
7.0 2.0 1.0 4 KB

Large HSET keys delete on Redis.

Home Page: https://medium.com/@hto/large-hset-keys-delete-on-redis-90243cee06f0?sk=77cfaecfa1aa9740fac87a6a50e08994

Go 100.00%
hset redis large-dataset large hscan del delete remove

redis-large-hset-del's Introduction

Large HSET keys delete

If you afraid when large hash files has been deleted on Redis. You have to delete per single hash keys step by step.

For example, you have a registered hash list of 30 million. If you delete it with the “del” command, you will probably have a huge load on your system. Or you may experience a crash.

By scanning with the “HSCAN” command, I think it is the healthiest method to do this singular operation.

Usage

$ go build

Run

Warning cluster mode is DEFAULT. Or -clusterMode=false

Deletes up to "-batchSize" every 3 seconds. Default 1000.

Examples

$ ./redis-large-hset-del -key=test
$ ./redis-large-hset-del -key=test -batchSize=2000
$ ./redis-large-hset-del -key=test -clusterMode=false
$ ./redis-large-hset-del -key=test -addr=127.0.0.1:6380
$ ./redis-large-hset-del -key=test -addr=127.0.0.1:6380 -password=123 

Blog Links

redis-large-hset-del's People

Contributors

hto avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

shxq0829

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.