开发者

How does Spring handle multiple post requests?

开发者 https://www.devze.com 2023-04-12 13:26 出处:网络
In my application, I have a mult开发者_如何学Pythoniple file upload AJAX client. I noticed (using a stub file processing class) that Spring usually opens 6 threads at once, and the rest of the file up

In my application, I have a mult开发者_如何学Pythoniple file upload AJAX client. I noticed (using a stub file processing class) that Spring usually opens 6 threads at once, and the rest of the file upload requests are blocked until any of those 6 threads finishes its job. It is then assigned a new request, as in a thread pool.

I haven't done anything specific to reach this behavior. Is this something that Spring does by default behind the scenes?

While uploading, I haven't had any problems browsing the other parts of the application, with pretty much no significant overhead in performance.

I noticed however that one of my "behind the scenes" calls to the server (I poll for new notifications every 20 secs) gets blocked as well. On the server side, my app calls a Redis-based key-value store which should always return even if there are no new notifications. The requests to it start getting normally processed only after the uploads get finished. Any explanation for this kind of blocking?

Edit: I think it has to deal with a maximum of concurrent requests per session


I believe this type of treading belongs to the Servlet Container but not to Spring.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号