Discussion:
Architecture question
Mikhail Malchevskiy
2016-06-02 05:12:13 UTC
Permalink
Is it possible with Aleph to handle request in this way: when a service is
already processing "enough" request, it just immediately returns some
response (instead of the whole processing pipeline). The ultimate problem
I'm trying to solve is to be able to process each request in x milliseconds
or return empty response (for example). Any advice?
--
You received this message because you are subscribed to the Google Groups "Aleph" group.
To unsubscribe from this group and stop receiving emails from it, send an email to aleph-lib+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Zach Tellman
2016-06-02 05:27:42 UTC
Permalink
(d/timeout! (d/future (handler request)) {:status 504 :body "timeout"})

Of course, that won't actually stop processing the request, just return a
response at the defined timeout. But if that's all you want, that should
do the trick.
Post by Mikhail Malchevskiy
Is it possible with Aleph to handle request in this way: when a service is
already processing "enough" request, it just immediately returns some
response (instead of the whole processing pipeline). The ultimate problem
I'm trying to solve is to be able to process each request in x milliseconds
or return empty response (for example). Any advice?
--
You received this message because you are subscribed to the Google Groups "Aleph" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Aleph" group.
To unsubscribe from this group and stop receiving emails from it, send an email to aleph-lib+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Mikhail Malchevskiy
2016-06-02 05:36:08 UTC
Permalink
Thanks for your reply, Zach!

Yeah, that was my first thought. But when I am testing my service with ab
tool, it doesn't seem to work - if I'm adding more "concurrency" to ab,
response time grows. Am I missing something?
Not near the laptop right now, I can send more info a little bit later.
Post by Zach Tellman
(d/timeout! (d/future (handler request)) {:status 504 :body "timeout"})
Of course, that won't actually stop processing the request, just return a
response at the defined timeout. But if that's all you want, that should
do the trick.
Post by Mikhail Malchevskiy
Is it possible with Aleph to handle request in this way: when a service
is already processing "enough" request, it just immediately returns some
response (instead of the whole processing pipeline). The ultimate problem
I'm trying to solve is to be able to process each request in x milliseconds
or return empty response (for example). Any advice?
--
You received this message because you are subscribed to the Google Groups "Aleph" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Aleph" group.
To unsubscribe from this group and stop receiving emails from it, send an email to aleph-lib+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Mikhail Malchevskiy
2016-06-02 05:50:35 UTC
Permalink
Also, if I understood correctly, with high enough rate of messages your
variant will be just returning "timeout" for all of them (since all of them
will be fully processing either way). And I want to really process "sane"
amount of requests and return timeout for rest of them.
Post by Zach Tellman
(d/timeout! (d/future (handler request)) {:status 504 :body "timeout"})
Of course, that won't actually stop processing the request, just return a
response at the defined timeout. But if that's all you want, that should
do the trick.
Post by Mikhail Malchevskiy
Is it possible with Aleph to handle request in this way: when a service
is already processing "enough" request, it just immediately returns some
response (instead of the whole processing pipeline). The ultimate problem
I'm trying to solve is to be able to process each request in x milliseconds
or return empty response (for example). Any advice?
--
You received this message because you are subscribed to the Google Groups "Aleph" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Aleph" group.
To unsubscribe from this group and stop receiving emails from it, send an email to aleph-lib+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...