downstream-benchmark-server

command
v0.0.0-...-7ed8402 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 7, 2023 License: MIT Imports: 8 Imported by: 0

README

The server is a cheap replica of the Node downstream worker. When I tried to benchmark the job queue/scheduler, Node was the bottleneck. Even a bare Express app like this:

var express = require('express');

const UNAUTHORIZED = {
  title: 'Please provide a valid username and password',
  detail: 'You did not provide credentials, or the provided credentials are not correct',
  id: 'unauthorized'
};

var app = express();
app.post('/v1/jobs/echo/:id', function(req, res) {
  res.status(401).json(UNAUTHORIZED);
});
app.listen(6799);

takes about 50ms to respond to every request, with 200 concurrency.

Instead here's a Go server that responds to every incoming request with a 202 and then immediately fires the success callback in a goroutine.

Documentation

Overview

The downstream-server is a Go server that can dequeue jobs and hit the callback.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL