![]() Node.js(3 instances) on AWS EB with AWS RDS The results were a bit worse than in Node.js, I could reach up to 23K requests in 60 seconds, so, 389 requests per second. ![]() I created the exact same conditions for the Django app with an equivalent handler and deployed it to the same server. Then, I asked what happens if I try the same with a technology that is not single-threaded. So, my Node.js instance was capable to handle 31K requests in 60 seconds, which means an average of 515 requests per second. ![]() Then I sent requests as much as I can do without increasing the average latency. I deployed the application in Heroku on $25/month hardware. The response size was around 12KB, each user object looked like this Also some light computations and stdout (Date.now, console.log - they consume computation resources too).Recursively convert to camelCase the 20 user objects.So, I installed express.js for my benchmarks and created a small API handler with various types of operations, and did load tests In most cases, proven frameworks like express(15K) are better, because, really, you are not going to handle 100K reqs per sec with a single instance. To have a real-world API we have to create a handler that communicates with DB or other services. So, what makes the API “real-world”? The data, the data transmission, and the interaction between components. But the benchmarks are usually made on a tiny API handler, which is far from a real-world API. Even 15K rps result by express.js sounds really great. I tried it with a Macbook Pro 15" 2015 and got almost the same result. There’s a benchmark made by Fastify creators, it shows that express.js can handle ~15K requests per second, and the vanilla HTTP module can handle 70K rps. But at this moment let’s forget about those factors and only think about the backend hardware and software, about Node.js particularly. Well, 40K rps is really huge, and also depends on some other factors besides the backend server. They handle 40K requests per second having Node.js (mostly) for the backend. Last year I read something very interesting for me in an article from a unicorn company PicsArt. ![]() Javascript Fetch Api Example - A Real World App ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |