https://github.com/tutv/node-rate-limit
https://github.com/tutv/node-rate-limit
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/tutv/node-rate-limit
- Owner: tutv
- Created: 2018-06-14T06:44:50.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-06-15T03:54:06.000Z (almost 8 years ago)
- Last Synced: 2025-02-04T21:45:32.732Z (over 1 year ago)
- Language: JavaScript
- Size: 13.7 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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
```