On Thu, May 28, 2015 at 3:08 PM, Илья Ненахов <zergoodso...@gmail.com>
wrote:

> Here it is https://github.com/zergood/akka-http-loadbalancer.git.
> Actualy this implemetation is not good, because I've relized that with
> Http().superFlow I miss request-response ordering.
>

This is why you can attach context to the requests and that will be
returned with the response.


> Some requests get wrong responses, it is not so important for this
> implementation, because all responses are the same.
> How can I repair request-response ordering? I think about mapping request
> to some id, and store all unhandled requests before I get (response, id)
> from server, another variant is passing RequestContext to superFlow. Are
> there another ways how to do this?
>
> P.S in this implementation balancer performance ~900r/s. Single local http
> server performance is ~4800r/s.
>

I just realized that because you are using the common pool (Http.request is
using the same one, too), balancing will have no real effect since all the
requests are routed to the same pool anyway. What you need is host level
connection pools on each balance edge, pinned to the server you target on
that graph edge.

-Endre



>
> 2015-05-28 13:09 GMT+03:00 Endre Varga <endre.va...@typesafe.com>:
>
>> Can you bundle up a very simple self-contained app that just fires up a
>> couple of server systems locally (can be on the same JVM), and uses the
>> balancing logic above? Then we can look into that and see what is going on.
>>
>> -Endre
>>
>> On Wed, May 27, 2015 at 8:45 PM, Илья Ненахов <zergoodso...@gmail.com>
>> wrote:
>>
>>> I added Http().superPool() to my implementation, but performance is
>>> still low. Performance does not increase after adding third server. It
>>> seems strange to me.
>>> Adam, yeah we have a reason not to use nginx or something similar,
>>> because there will be an additional business logic, not only load
>>> balancing. But if we can't fix the performance issue, nginx and etc would
>>> be a "plan b".
>>>
>>> 2015-05-27 17:14 GMT+03:00 Adam Shannon <adam.shan...@banno.com>:
>>>
>>>> Is there a specific reason to not use another piece of software for
>>>> this? I'm thinking of something like nginx or haproxy. Both of which are
>>>> much more hardened and performant in regards to serving as proxies for HTTP
>>>> traffic.
>>>>
>>>> On Wed, May 27, 2015 at 7:34 AM, Viktor Klang <viktor.kl...@gmail.com>
>>>> wrote:
>>>>
>>>>>
>>>>>
>>>>> On Wed, May 27, 2015 at 2:33 PM, Viktor Klang <viktor.kl...@gmail.com>
>>>>> wrote:
>>>>>
>>>>>>
>>>>>>
>>>>>> On Wed, May 27, 2015 at 2:01 PM, Endre Varga <
>>>>>> endre.va...@typesafe.com> wrote:
>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> Instead of Http.request, you should use the Flow returned by
>>>>>>> Http.superPool() (see
>>>>>>> http://doc.akka.io/docs/akka-stream-and-http-experimental/1.0-RC3/scala/http/client-side/request-level.html).
>>>>>>> That flattens out the Futures and you get responses instead. That also
>>>>>>> makes Balance actually aware of response times.
>>>>>>>
>>>>>>> OTOH I don't think performance wise akka-http is currently up to the
>>>>>>> task of being a balancer.
>>>>>>>
>>>>>>
>>>>>> …at the moment.
>>>>>>
>>>>>
>>>>> Doh, that "currently" eluded me, see my response as emphasis :)
>>>>>
>>>>>
>>>>>>
>>>>>>
>>>>>>>
>>>>>>> -Endre
>>>>>>>
>>>>>>> On Wed, May 27, 2015 at 1:21 PM, zergood <zergoodso...@gmail.com>
>>>>>>> wrote:
>>>>>>>
>>>>>>>> Hello!
>>>>>>>>
>>>>>>>> I have a task to develop a http balance loader for my 2 servers.
>>>>>>>> Here is my qucik and very dirty implementation
>>>>>>>> https://gist.github.com/zergood/e705cd6ce4cfec47c0a5. The main
>>>>>>>> problem with it is performance, this solution is slower than my single
>>>>>>>> server.
>>>>>>>> What is the reason of performance degradation? Could you give me
>>>>>>>> any advices how to make http load balancer with akka-http? I am using
>>>>>>>> scala-2.11 and akka-http 1.0-RC3.
>>>>>>>>
>>>>>>>> --
>>>>>>>> >>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>> >>>>>>>>>> Check the FAQ:
>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>> >>>>>>>>>> Search the archives:
>>>>>>>> https://groups.google.com/group/akka-user
>>>>>>>> ---
>>>>>>>> You received this message because you are subscribed to the Google
>>>>>>>> Groups "Akka User List" group.
>>>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>>>> send an email to akka-user+unsubscr...@googlegroups.com.
>>>>>>>> To post to this group, send email to akka-user@googlegroups.com.
>>>>>>>> Visit this group at http://groups.google.com/group/akka-user.
>>>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>>>
>>>>>>>
>>>>>>>  --
>>>>>>> >>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>> >>>>>>>>>> Check the FAQ:
>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>> >>>>>>>>>> Search the archives:
>>>>>>> https://groups.google.com/group/akka-user
>>>>>>> ---
>>>>>>> You received this message because you are subscribed to the Google
>>>>>>> Groups "Akka User List" group.
>>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>>> send an email to akka-user+unsubscr...@googlegroups.com.
>>>>>>> To post to this group, send email to akka-user@googlegroups.com.
>>>>>>> Visit this group at http://groups.google.com/group/akka-user.
>>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Cheers,
>>>>>> √
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Cheers,
>>>>> √
>>>>>
>>>>> --
>>>>> >>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>> >>>>>>>>>> Check the FAQ:
>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>> >>>>>>>>>> Search the archives:
>>>>> https://groups.google.com/group/akka-user
>>>>> ---
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "Akka User List" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>>> an email to akka-user+unsubscr...@googlegroups.com.
>>>>> To post to this group, send email to akka-user@googlegroups.com.
>>>>> Visit this group at http://groups.google.com/group/akka-user.
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Adam Shannon | Software Engineer | Banno | Jack Henry
>>>> 206 6th Ave Suite 1020 | Des Moines, IA 50309 | Cell: 515.867.8337
>>>>
>>>> --
>>>> >>>>>>>>>> Read the docs: http://akka.io/docs/
>>>> >>>>>>>>>> Check the FAQ:
>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>> >>>>>>>>>> Search the archives:
>>>> https://groups.google.com/group/akka-user
>>>> ---
>>>> You received this message because you are subscribed to a topic in the
>>>> Google Groups "Akka User List" group.
>>>> To unsubscribe from this topic, visit
>>>> https://groups.google.com/d/topic/akka-user/_wd1vl0mzfE/unsubscribe.
>>>> To unsubscribe from this group and all its topics, send an email to
>>>> akka-user+unsubscr...@googlegroups.com.
>>>> To post to this group, send email to akka-user@googlegroups.com.
>>>> Visit this group at http://groups.google.com/group/akka-user.
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>  --
>>> >>>>>>>>>> Read the docs: http://akka.io/docs/
>>> >>>>>>>>>> Check the FAQ:
>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>> >>>>>>>>>> Search the archives:
>>> https://groups.google.com/group/akka-user
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "Akka User List" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to akka-user+unsubscr...@googlegroups.com.
>>> To post to this group, send email to akka-user@googlegroups.com.
>>> Visit this group at http://groups.google.com/group/akka-user.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>  --
>> >>>>>>>>>> Read the docs: http://akka.io/docs/
>> >>>>>>>>>> Check the FAQ:
>> http://doc.akka.io/docs/akka/current/additional/faq.html
>> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
>> ---
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Akka User List" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/akka-user/_wd1vl0mzfE/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> akka-user+unsubscr...@googlegroups.com.
>> To post to this group, send email to akka-user@googlegroups.com.
>> Visit this group at http://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>  --
> >>>>>>>>>> Read the docs: http://akka.io/docs/
> >>>>>>>>>> Check the FAQ:
> http://doc.akka.io/docs/akka/current/additional/faq.html
> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
> ---
> You received this message because you are subscribed to the Google Groups
> "Akka User List" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to akka-user+unsubscr...@googlegroups.com.
> To post to this group, send email to akka-user@googlegroups.com.
> Visit this group at http://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to