Skip to content

tutv/node-rate-limit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

An example NodeJS app with rate-limiting algorithm

Backed by Redis and ExpressJS.

Installation

//with yarn
yarn

//with npm
npm i

Testing

With rate-limiting is 30 req/minute.

#run server
node index.js

#run test
ab -n 200 -c 50 http://localhost:4900/limit

#Ouput

Output:

Completed 200 requests

Concurrency Level:      50
Time taken for tests:   0.297 seconds
Complete requests:      200
Failed requests:        30
   (Connect: 0, Receive: 0, Length: 30, Exceptions: 0)
Non-2xx responses:      170
Total transferred:      57460 bytes
HTML transferred:       3970 bytes
Requests per second:    672.54 [#/sec] (mean)
Time per request:       74.344 [ms] (mean)
Time per request:       1.487 [ms] (mean, across all concurrent requests)
Transfer rate:          188.69 [Kbytes/sec] received

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published