DirtyHairy / async-mutex

A mutex for synchronizing async workflows in Javascript
MIT License
1.1k stars 60 forks source link

what is the limit of thread safe queue limit of asyn-mutex module? #56

Closed rajendraspringer closed 2 years ago

rajendraspringer commented 2 years ago

Hi everyone, Currently we are receiving the API request approx. 110 within a minute, also we are getting multiple requests in parallel. So I am using this module Mutex API with async/await style for locking the thread for api request in our code, It's working fine for 110 API request within a minute. https://www.npmjs.com/package/async-mutex

Is anyone know about the limit of thread safe queue limit? Meanwhile how much API request will be handle through above Mutex API approach? Can this approach will handle approx. 1000 API request on same time(within a minute)?

Please check this scenario and let us know the helpful answer, so that I can plan to use this approach for 1000 API request within a minute.

DirtyHairy commented 2 years ago

Depends what you do in those 1000 requests 😏What you are looking for is information on the load that a NodeJS server can handle and on how you can scale it horizontally. In any case, this library won't be the bottleneck, unless you cause a memory leak by queuing billions of waiters on a locked mutex.