this is the server code
app.get("/test", (req, res, next) => {
res.json("test")
})
frontend code, 1000 requests
<Menu.Item key="abc">
<a onClick={() => {
for (let i = 0; i < 1000; iPP) {
fetch("http://localhost:3001/test")
.then((res) => {
return res.json()
})
.then((data) => {
console.log(data);
})
}
}}>abc</a>
</Menu.Item>
this is the usage time of browser requests, and it all increases gradually. In the end, it has been more than 2 seconds. Why can we still say that nodejs is high concurrency, or that the back-end code I wrote is wrong, or that we have to do extra operations to achieve high concurrency? ask God to solve the puzzle
.