ThePrimeagen / BunSpreader

We spread the buns
74 stars 12 forks source link

feat: cluster node #2

Closed mhuggins7278 closed 2 years ago

mhuggins7278 commented 2 years ago

It looks to me like the rust implementation is workers equal to the number of CPU's available on the host. The node/fastify implementation is limited to 1 worker because (node 👎 ). I couldn't get the client running to actually run the perf tests yet. But I thought this might be a better comparison.

ThePrimeagen commented 2 years ago

So i only test on single core. It properly gives rust the disadvantage to CRUSH node/bun

ThePrimeagen commented 2 years ago

I also have a second issue, which of course how does this work with shared memory?

The queue's items in need to be properly counted betwixt all the threads. I haven't used much of cluster, could you susplain to me ?

In my head, there is 2 threads (lets say), each will have a queue of say 20k, which measn I need the 40k total as a response.

ThePrimeagen commented 2 years ago

sorry, one more thing, if there was something added to JS side, i need it in the bun side as well! But I don't know if bun is ready for that yet :)

(that is if I tested multicore)

mhuggins7278 commented 2 years ago

Yeah I'm messing with making it a singleton instance but it's slightly more complicated than I have time for today. Also knowing that your running on a single CPU linode instance makes this all a mute point.