I am working on a Node.js-based financial/trading app where the system needs to handle scenarios like placing 5000 API calls in a second. These can be the same or different APIs. I want to process all these requests in parallel with a high response time and low latency.
What would be the best approach for optimizing Node.js to handle such a high volume of parallel API calls? I'm looking for a solution that ensures low latency and fast responses. Any guidance or suggestions would be highly appreciated
Here’s what I’ve tried so far:
Implemented Node.js clustering to leverage all CPU cores. Used worker threads for parallel task execution. Conducted load testing using Artillery at 500-1000 requests per second (RPS). Despite these efforts, I'm facing issues with timeouts and high response times, particularly under load.
Top comments (1)
Where is your slowdown? Have you instrumented your code to see if a network or database call is the limiting factor?