Internal queue causing too much delay in front end
How would we either work around or speed up the internal queue implemented by Discord.js?
At some point it seems there was an exposed setting for
burst
but I can't find this anywhere.
Unfortunately we are experiencing instances when performing multiple requests that mean the queue gets very long and sometimes requests are only ever actually sent to the Discord API after over 90 seconds.
Attached is an image of our Elastic APM transaction tracking to show the time that the reqeusts sit due to a backup in the queue, yet the queue is not being processed anywhere near the rate limit of 10/ second.4 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!Discord.js version:
14.11.0
Node version: 18.17.0
Ratelimits are dynamically assigned by the API based on current load and may change at any point.
- The scale from okay to API-spam is sliding and depends heavily on the action you are taking
- Rainbow roles, clock and counter channels, and DM'ing advertisements to all members are all examples of things that are not okay
anywhere near the rate limit of 10/ secondand it never will be anywhere near because of how dynamic all of this is firing those requests in a burst risks hitting something like the global limits so we still do everything sequentially most of the slowness/buildup that you see is literally just the I/O network round trip theres no "correct" way around this. if its a problem for you you're doing something wrong and should be making less requests to that endpoint or killing off the the feature that needs it