https://github.com/chronark/vercel-keepalive-tests
https://github.com/chronark/vercel-keepalive-tests
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/chronark/vercel-keepalive-tests
- Owner: chronark
- License: mit
- Created: 2022-04-22T16:45:05.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-08-03T05:12:50.000Z (almost 3 years ago)
- Last Synced: 2025-03-16T14:39:59.961Z (over 1 year ago)
- Language: JavaScript
- Size: 131 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
This is a [Next.js](https://nextjs.org/) application to test the latency implication of using `keepalive` between serverless functions and [Upstash Redis](https://upstash.com/) via `REST`.
## Getting Started
Requires `node 18` or a `fetch` polyfill for the testing script.
1. Create redis database [here](https://console.upstash.com/)
2. Add your url and token to `.env`
3. Then run your development server:
```bash
npm install
npm run dev
```
4. Run tests
```bash
node ./test.js http://localhost:3000
```
## Testing on real hardware
1. Create redis database [here](https://console.upstash.com/)
2. Add url and token to vercel `https://vercel.com///settings/environment-variables`
3. Deploy this nextjs application
4. Run tests
```bash
node ./test.js
```
## What is going on?
This application covers 4 different scenarios:
- An agent is used to keep the connection alive: yes | no
- The agent is kept in memory outside of the api handler and is available during hot starts: yes | no
## Results
