Persistent Redis Connections in Sidekiq with Async::Redis: A Deep Dive.

This page summarizes the projects mentioned and recommended in the original post on dev.to

Scout Monitoring - Performance metrics and, now, Logs Management Monitoring with Scout Monitoring
Get early access to Scout Monitoring's NEW Ruby logging feature [beta] by signing up now. Start for free and enable logs to get better insights into your Rails apps.
www.scoutapm.com
featured
InfluxDB - Purpose built for real-time analytics at any scale.
InfluxDB Platform is powered by columnar analytics, optimized for cost-efficient storage, and built with open data standards.
www.influxdata.com
featured
  • All example code can be found here. Note that we don't actually need Rails, but I used it for examples because Sidekiq is usually used with Rails.

  • Scout Monitoring

    Performance metrics and, now, Logs Management Monitoring with Scout Monitoring. Get early access to Scout Monitoring's NEW Ruby logging feature [beta] by signing up now. Start for free and enable logs to get better insights into your Rails apps.

    Scout Monitoring logo
  • Async Ruby

    An awesome asynchronous event-driven reactor for Ruby. (by socketry)

    Async is a composable asynchronous I/O framework for Ruby. It allows you to do things concurrently using Fibers. Since 3.0, Ruby has a fiber scheduler and Ruby core supports it. This means you can have non-blocking I/O without much effort, for example, when using Net::HTTP. If you perform a blocking operation, such as an HTTP call, inside a fiber, it will immediately yield so that another fiber can become active and do some useful work instead of blocking and waiting for the HTTP call to complete.

  • async-redis

    Besides Ruby's support for the fiber scheduler, for some I/O operations, you might use specific gems, like Async::Redis. You can still use other Ruby gems that use native Ruby I/O with Async and they will give you non-blocking I/O as well, but there are two reasons to prefer Async::Redis:

  • Sidekiq

    Simple, efficient background processing for Ruby

    Okay, back to our Rails app. In our app, the lifetime should be the whole Sidekiq process. Luckily, Sidekiq has internal documentation on how it runs. I won't copy the entire documentation here, just the part we are interested in:

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Exploring concurrent rate limiters, mutexes, semaphores

    2 projects | dev.to | 11 Sep 2023
  • How to Setup a Project That Can Host Up to 1000 Users for Free

    12 projects | dev.to | 4 Jun 2024
  • 3 one-person million dollar online businesses

    2 projects | /r/Business_Ideas | 4 Dec 2023
  • EventMachine Performance Spikes

    2 projects | /r/ruby | 5 Sep 2023
  • Sidekiq and managing resumable jobs?

    2 projects | /r/rails | 24 May 2023

Did you konow that Ruby is
the 12th most popular programming language
based on number of metions?