0

I'm running a Locust load test for 100 users at a hatch rate of 1 per second on a Socket.io server that I set up within a Restify Node.js API. It causes significant slowdown and the API becomes inaccessible. The API exposes one port and is deployed on a Docker swarm with Traefik.

When I run the API locally with or without the load test, the Socket.io connections and messages are working fine. What could be causing the slowdown?

Socket.io server setup in the Restify API:

import * as restify from 'restify';
import { Server, Request, Response } from 'restify';
import * as socketIo from 'socket.io';
import { SocketService } from './services/socket.service';
const redisAdapter: any = require('socket.io-redis');

export const server: Server = restify.createServer({
  name: '...',
  socketio: true
});

server.listen(config.port);

const socketServer: socketIo.Server = socketIo.listen(server.server);
const socketService: SocketService = new SocketService(socketServer);
socketServer.adapter(redisAdapter({ host: config.redisHost, port: config.redisPort }));
stevetronix
  • 1,231
  • 2
  • 16
  • 32

0 Answers0