Proxy traffic consumption

Hello,
I am under Ubuntu 16.04 at location1 and location2 and my question is about haproxy.
I'd like to know when a port in location1 is redirected to another computer in location2, does incoming request to redirected port consume traffic both from 1 and 2 or just 2?
What I'd like to accomplish is just consume from location2.
Both location1 and location2 have different public ip addresses.

Thanks in advance
Boris

Want to you mean my "consume"?

Ports are end points for listening (and transmitting) sockets.

Sockets are bound to applications.

So all applications ( a proxy is an application) which listen on a port bind to that port and send and receive data on that port.

Hello Neo,
Thanks for your post.
I have made some tests. When I send a download request to a proxied port at location1, it sends my download request to location2. I can see that traffic is between location1,2 and my house... Not between my house and location2. It seems ridiculous.
When I search "how to set up loadbalance in multiple servers in linux", shown answers are related to haproxy. So, with regard to your answer, loadbalance and haproxy have entirely different functions.

Kind regards
Boris

Sorry, I cannot understand your posts because you are not using the correct technical terms.

For example "location" normally described a physical location, for example, something that can be defined by GPS coordinates.

You are not using terms like "ports" and "sockets" and "hosts" and "server" and "IP address" to describe your problems; and since I'm busy writing code, I don't have time to try to figure out what you are talking about.

You need to describe your problem in terms of the correct technical terms. If you do not understand the correct computer science terms, then I suggest to you that you need to learn these concepts before trying set up a proxy.

Hello,
Long time passed. I have come across the same problem definition at another board.

So, the final question is: How to redirect a request to another ip address:port
Normally in current configuration it forwards incoming requests, not redirecting. So it cause 2x traffic.

Keep searching..

Kind regards
Boris

What you want is called DSR, meaning direct server return.
This is stateless load balancing, since the LB only balances the connection initially, and does nothing else.
The result will be that after initial balance to one of the servers, a client - server connection will not go thru LB after that.

It requires your load balanced servers to have VIP ip address defined on localhost interface (alias).
Also, your load balanced servers must not answer to ARP requests.
And a load balancer software which supports that functionality with a network environment which allows it, since this is MAC spoofing :slight_smile:

Hope that helps
Regards
Peasant.

1 Like

Thank you Peasant,
I think a load balancing software provider can handle all this.
I will mark this topic "sorted"

Kind regards
Boris