Socket
Socket
Sign inDemoInstall

rate-limiter-flexible

Package Overview
Dependencies
0
Maintainers
1
Versions
163
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.9.2 to 0.9.3

22

CLUSTER.md

@@ -5,3 +5,3 @@ ## RateLimiterCluster

Endpoint is simple Express 4.x route launched in `node:latest` and `redis:alpine` Docker containers with 4 workers
Endpoint is pure NodeJS endpoint launched in `node:latest` and `redis:alpine` Docker containers with 4 workers

@@ -17,3 +17,3 @@ Endpoint is limited by `RateLimiterCluster` with config:

By `bombardier -c 1000 -l -d 30s -r 2000 -t 5s http://127.0.0.1:3000/pricing`
By `bombardier -c 1000 -l -d 30s -r 2000 -t 5s http://127.0.0.1:8000`

@@ -24,15 +24,15 @@ Test with 1000 concurrent requests with maximum 2000 requests per sec during 30 seconds

Statistics Avg Stdev Max
Reqs/sec 1997.87 429.40 3869.98
Latency 4.75ms 3.32ms 68.21ms
Reqs/sec 2024.57 234.52 2976.20
Latency 704.58us 165.65us 7.05ms
Latency Distribution
50% 4.15ms
75% 5.43ms
90% 6.95ms
95% 8.79ms
99% 18.96ms
50% 669.00us
75% 843.00us
90% 1.02ms
95% 1.18ms
99% 1.60ms
HTTP codes:
1xx - 0, 2xx - 15000, 3xx - 0, 4xx - 45014, 5xx - 0
1xx - 0, 2xx - 53458, 3xx - 0, 4xx - 6560, 5xx - 0
```
It is a bit faster than RateLimiterRedis.
Cluster limiter at least twice faster than RateLimiterRedis.

@@ -39,0 +39,0 @@ ### How it works

@@ -5,3 +5,3 @@ ## RateLimiterMongo

Endpoint is simple Express 4.x route launched in `node:latest` and `redis:alpine` Docker containers with 4 workers
Endpoint is pure NodeJS endpoint launched in `node:latest` and `redis:alpine` Docker containers with 4 workers

@@ -8,0 +8,0 @@ Endpoint is limited by `RateLimiterMongo` with config:

{
"name": "rate-limiter-flexible",
"version": "0.9.2",
"version": "0.9.3",
"description": "Flexible API rate limiter backed by Redis for distributed node.js applications",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -30,6 +30,16 @@ [![Build Status](https://travis-ci.org/animir/node-rate-limiter-flexible.png)](https://travis-ci.org/animir/node-rate-limiter-flexible)

Endpoint is simple Express 4.x route launched in `node:latest` and `redis:alpine` Docker containers by PM2 with 4 workers
Average latency of pure NodeJS endpoint limited by (all set up on one server):
```text
1. Memory 0.34 ms
2. Cluster 0.69 ms
3. Redis 2.45 ms
4. Mongo 4.75 ms
```
By `bombardier -c 1000 -l -d 30s -r 2000 -t 5s http://127.0.0.1:3000/pricing`
#### RateLimiterRedis benchmark
Endpoint is pure NodeJS endpoint launched in `node:latest` and `redis:alpine` Docker containers by PM2 with 4 workers
By `bombardier -c 1000 -l -d 30s -r 2000 -t 5s http://127.0.0.1:8000`
Test with 1000 concurrent requests with maximum 2000 requests per sec during 30 seconds

@@ -39,16 +49,14 @@

Statistics Avg Stdev Max
Reqs/sec 1994.83 439.72 5377.15
Latency 6.09ms 5.06ms 88.44ms
Reqs/sec 2015.20 511.21 14570.19
Latency 2.45ms 7.51ms 138.41ms
Latency Distribution
50% 4.98ms
75% 6.65ms
90% 9.33ms
95% 13.65ms
99% 34.27ms
50% 1.95ms
75% 2.16ms
90% 2.43ms
95% 2.77ms
99% 5.73ms
HTTP codes:
1xx - 0, 2xx - 59997, 3xx - 0, 4xx - 0, 5xx - 0
1xx - 0, 2xx - 53556, 3xx - 0, 4xx - 6417, 5xx - 0
```
Note: Performance will be much better on real servers, as for this benchmark everything was launched on one machine
## Installation

@@ -55,0 +63,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc