-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Labels
questionFurther information is requestedFurther information is requested
Description
Reproduces with this code:
import { Redis } from "ioredis";
import { Server } from "socket.io";
import { createAdapter } from "@socket.io/redis-streams-adapter";
const redisClient = new Redis();
const io = new Server({
adapter: createAdapter(redisClient)
});
io.listen(parseInt(process.argv[2]));
const loopFn = async () => {
console.time('fetchSockets');
await io.fetchSockets();
console.timeEnd('fetchSockets');
}
setInterval(loopFn, 1000);
Execute a single instance (i.e. node server.js 3000
), and timing on fetchSockets()
is generally 0.05ms or quicker. Bringing up a second instance (i.e. node server.js 3001
in a new console) causes this to immediately spike to ~200ms.
Note that I do not see the same behavior when using @socket.io/redis-adapter
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested