Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Figure out why haproxy seems to require restarting quite often. #11

Open
jamiees2 opened this issue Apr 7, 2015 · 9 comments
Open

Figure out why haproxy seems to require restarting quite often. #11

jamiees2 opened this issue Apr 7, 2015 · 9 comments

Comments

@jamiees2
Copy link
Owner

jamiees2 commented Apr 7, 2015

This is a somewhat annoying issue. It might just be an issue with HAProxy, but it might be possible to resolve with better config generation.

@chocolatebegood
Copy link

I think the problem is that HAProxy does the address resolution on start up and then Netflix etc slowly change the ip addresses.

@jamiees2
Copy link
Owner Author

jamiees2 commented Apr 8, 2015

Hmm, how would you propose resolving that? I can't seem to find a fix that is different from adding service haproxy restart to crontab.

@jamiees2
Copy link
Owner Author

jamiees2 commented Apr 8, 2015

Perhaps other alternatives to HAProxy like sniproxy are worth looking into. Regarding the automated restarts, perhaps this is enough: http://www.forouzani.com/reload-haproxy-cfg-without-restarting.html.

@Dan-Wood
Copy link

Dan-Wood commented Sep 7, 2015

You need to add the check inter line to each backend server, this is force HAProxy to check the server and see if its up or down, IP chnage etc.

Something such as this (probably smaller numbers)

use-server cp143012-i.akamaihd.net if { req_ssl_sni -i cp143012-i.akamaihd.net }
server cp143012-i.akamaihd.net cp143012-i.akamaihd.net:443 check inter 60000 fast
inter 60000 down inter 60000 fall 14430

@jamiees2
Copy link
Owner Author

jamiees2 commented Sep 7, 2015

Oh neat! As you clearly know more about this than I do, would you mind sending a PR? :^)

@Dan-Wood
Copy link

Dan-Wood commented Sep 7, 2015

Sure, will do that sometime tomorrow. Will probably jump on that Named/BIND generator too.

@kcd83
Copy link

kcd83 commented Oct 4, 2015

Any suggestions for getting haproxy to start if a domain has gone completely? Today I found atv.amazon.com did not resolve causing

[ALERT] 276/003112 (4325) : parsing [/etc/haproxy/haproxy.cfg:119] : 'server atv.amazon.com' : invalid address: 'atv.amazon.com' in 'atv.amazon.com:80'

I just pointed it to localhost in /etc/hosts as a workaround

@jamiees2
Copy link
Owner Author

jamiees2 commented Oct 4, 2015

Hmm, no, not really. I have yet to investigate the HAProxy configuration better, although I was researching sniproxy last weekend and am considering adding a generator for it, as it just seemed to work better regarding DNS lookups.

@ck-ws
Copy link
Contributor

ck-ws commented Oct 26, 2015

sniproxy is nice and I used it before, but Amazon Instant Video in combination with a Fire TV gave me headaches, until I found out that the Fire TV resolves some hostnames via DNS but sends the HTTP requests directly to the resolved IP. I was not able to find a workaround like the dnat setup here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants