Why Filter, Interceptor and Authenticator are mono threaded?

19 views
Skip to first unread message

kevin.s...@dooapp.com

unread,
Nov 25, 2016, 10:20:07 AM11/25/16
to wisdom-discuss
Hi,

I noticed that  Filter, Interceptor and Authenticator are mono threaded. Is there any reason ? It can dramatically slow down all the requests.

Given the case of a wisdom web app that is used by a lot of people, if filter/interceptor/authenticator check that the user is well authenticated (often trigerring BDD layer), usually this checking can take 1 seconds to X seconds depending of multi parameters of the sub layer (persistent store, index layer etc...)

If N peoples are connected to the web app, the first person will get a fast answer in opposite of the N-th person that will have to way until all previous persons call have been consumed.

Can we used Async annotation on Filter/Authenticator/Interceptor?

Thank you in advance

Kévin

kevin.s...@dooapp.com

unread,
Nov 25, 2016, 12:02:14 PM11/25/16
to wisdom-discuss
The problem is also located in controllers method that are'nt annotated with @Async.

If N users perform a simple crud action and the crud controller method is not annotated with @Async, the last N-th user will have to wait until all previous users request be performed...

A web server should execute requests in parrallel (and pool other request that cannot be performed due to system performance limitation), no?

In my opinion, the wisdom HttpHandler should have a HttpRequestExcecutor that can execute a set of requests in parallel and pool the other request with it's reach system limitation.

Clement Escoffier

unread,
Nov 27, 2016, 5:49:36 AM11/27/16
to wisdom-...@googlegroups.com
Hi,

It’s actually the expected behavior. Wisdom is based on the “event loops” and the non-async code must not block. This has been designed like this to improve scalability, because unlike what people think, reducing the number of threads improves scalability and performances. There is many talks about this such as https://www.youtube.com/watch?v=yLg-LPSRjho&t=1s or https://www.youtube.com/watch?v=qL5BGHPXrac&t=1s.

Clement


-- 
You received this message because you are subscribed to the Google Groups "wisdom-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wisdom-discus...@googlegroups.com.
Visit this group at https://groups.google.com/group/wisdom-discuss.
To view this discussion on the web visit https://groups.google.com/d/msgid/wisdom-discuss/086e008e-ef35-4e5b-8339-b26fdcef9004%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages