Overslaan naar inhoud
  • +31 653-919-302
Cafayate.Net
  • 0
  • 0
  • Aanmelden
  • Nederlands English (US) Español (AR)
  • Contact
  • Startpagina
  • Blog
  • Vacatures
  • Contact
Cafayate.Net
  • 0
  • 0
    • Startpagina
    • Blog
    • Vacatures
    • Contact
  • +31 653-919-302
  • Nederlands English (US) Español (AR)
  • Aanmelden
  • Contact

Deleting lots of keys in Redis, fast

  • Alle blogs
  • Tech Blog
  • Deleting lots of keys in Redis, fast
  • 5 maart 2021 in
    Administrator

     

    Here’s a snippet that has helped me whenever I’ve wanted to delete a large number of keys in Redis. This snippet can be run from a bash (or equivalent) shell. In this example i want to delete all keys that begin with ‘sessions’.


    redis-cli KEYS "sessions*" | xargs --max-args=100 --max-procs=8 redis-cli DEL

    The first part of the script runs the KEYS command searching for keys that begin with ‘sessions’. (NOTE: It’s obviously useless to delete ALL keys this way. You might as well delete the .rdb or .aof file and restart the server.)

    The second part runs the DEL command with a 100 arguments at a time. `–max-procs=8` means there are 8 processes running in parallel. Adjust –max-procs per the number of cores on your server.

    in Tech Blog
    Odoo Website Portal (Backported From v10)

    Ontworpen voor bedrijven

    We zijn een team van gepassioneerde mensen met als doel levens te verbeteren met vernieuwende producten. We ontwikkelen geweldige oplossingen voor al je zakelijke uitdagingen. Onze producten zijn ontworpen voor kleine tot middelgrote bedrijven die hun prestaties willen optimaliseren.

    Neem contact op

    Plantexel
    Pedernera
    Salta Capital 
    Argentina

    • +31 653-919-302
    • [email protected]
    Volg ons
    Copyright © Plantexel
    Nederlands | English (US) | Español (AR)