npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

redis-smq-benchmarks

v10.1.2

Published

Benchmarking tool for RedisSMQ to assess performance and throughput in your application environment.

Readme

RedisSMQ Benchmarks

NPM_BADGE CODECOV_BADGE

IS_NEXT_NOTE

A comprehensive benchmarking suite for RedisSMQ message queue system, measuring throughput, latency, and end-to-end performance under various workloads.

📊 Overview

This benchmark suite provides tools to measure RedisSMQ performance across different scenarios:

  1. Producer Throughput - Measure message production rates
  2. Consumer Throughput - Measure message consumption rates
  3. End-to-End Throughput - Measure complete system performance with concurrent producers and consumers

Note: These benchmarks are for performance testing and should be run in a controlled environment. Always test with production-like data and conditions.

🚀 Quick Start

Prerequisites

  • Node.js 20+
  • Redis server running (default: localhost:6379)

Installation

npm install redis-smq__TAG_SUFFIX__ redis-smq-common__TAG_SUFFIX__ redis-smq-benchmarks__TAG_SUFFIX__ --save

⚙️ Configuration

Benchmarks can be configured using environment variables:

| Variable | Description | Default | |-----------------------|-----------------------------------|------------| | BENCH_MESSAGES | Total messages to process | 100000 | | BENCH_PRODUCERS | Number of producer worker threads | 0 | | BENCH_CONSUMERS | Number of consumer worker threads | 0 | | BENCH_SHOW_PROGRESS | Benchmark progress reporting | 0 | | REDIS_HOST | Redis server host | localhost | | REDIS_PORT | Redis server port | 6379 | | REDIS_DB | Redis server database | 0 |

Example Configuration

# Run with custom configuration
REDIS_HOST=127.0.0.1 \
BENCH_PRODUCERS=10 \
BENCH_CONSUMERS=5 \
npx redis-smq-benchmarks

📈 Benchmark Types

1. Producer Throughput Benchmark

Measures how quickly producers can enqueue messages.

Features:

  • Even distribution of messages across producers
  • Real-time progress reporting
  • Individual producer statistics
  • Aggregate throughput calculation

Usage:

BENCH_MESSAGES=50000 BENCH_PRODUCERS=4 npx redis-smq-benchmarks

2. Consumer Throughput Benchmark

Measures how quickly consumers can process messages.

Features:

  • Pre-fills queue with messages
  • Even distribution across consumers
  • Individual consumer statistics
  • Complete consumption tracking

Usage:

BENCH_MESSAGES=50000 BENCH_CONSUMERS=4 npx redis-smq-benchmarks

3. End-to-End Throughput Benchmark

Measures complete system performance with concurrent producers and consumers.

Features:

  • Concurrent producer and consumer execution
  • Production vs consumption phase tracking
  • System backlog monitoring
  • Complete throughput analysis

Usage:

BENCH_MESSAGES=100000 BENCH_PRODUCERS=8 BENCH_CONSUMERS=8 npx redis-smq-benchmarks

📊 Output Metrics

Each benchmark provides detailed metrics:

Individual Worker Metrics

  • Messages processed per worker
  • Time taken per worker
  • Throughput per worker (messages/second)

Aggregate Metrics

  • Total messages processed
  • Total time elapsed
  • Overall throughput
  • Average time per worker

E2E-Specific Metrics

  • Production throughput
  • Consumption throughput
  • System backlog (produced vs consumed)
  • End-to-end latency

📊 Sample Output

Starting end-to-end throughput benchmark...
Queue: benchmarking/queue-1767808640925 | Messages: 100000 | Producers: 10 | Consumers: 5
Setting up producers and consumers...

========== E2E BENCHMARK COMPLETE ==========
Production Phase:
  Total produced: 100000
  Production time: 3.35s
  Production throughput: 29824 msg/s

Consumption Phase:
  Total consumed: 100000
  Consumption time: 6.37s
  Consumption throughput: 15689 msg/s

End-to-End:
  Total time: 6.37s
  Overall throughput: 15689 msg/s
  System backlog: 0 messages
  Status: All messages processed successfully ✓
============================================

🏗️ Architecture

Design Principles

  1. Worker-Based Architecture: Each producer/consumer runs in its own worker thread
  2. Even Distribution: Messages are evenly distributed across all workers
  3. Real-time Monitoring: Progress updates during execution
  4. Graceful Shutdown: Clean termination of all resources
  5. Extensible: Easy to add new benchmark types

Performance Tuning Tips

  1. Worker Count: Increase worker count to leverage multi-core CPUs
  2. Redis Configuration: Ensure Redis has sufficient memory and connection limits
  3. Network: Local Redis provides the best performance. Network latency impacts throughput

📊 Interpreting Results

Key Metrics to Monitor

  1. Throughput Plateau: Point where adding more workers doesn't increase throughput
  2. CPU Utilization: Monitor CPU usage during benchmarks
  3. Memory Usage: Watch for memory leaks in long-running tests

License

RedisSMQ Benchmarks is released under the MIT License.