From c8270d6eb6699e620f1ac09c7ed3a4f8c94c8c95 Mon Sep 17 00:00:00 2001 From: Aiko Mastboom Date: Mon, 7 Dec 2015 22:16:06 +0100 Subject: [PATCH] update --- mywiki/tiddlers/GIT server.tid | 18 +++++ ...our Config With Minimal Service Impact.tid | 79 +++++++++++++++++++ mywiki/tiddlers/Node-RED.tid | 5 +- mywiki/tiddlers/Programming.tid | 75 ++++++++++++++++++ mywiki/tiddlers/Safari.tid | 15 ++++ mywiki/tiddlers/Squid sslbump.tid | 41 ++++++++++ mywiki/tiddlers/boot2docker reset.tid | 12 +++ mywiki/tiddlers/docker install.tid | 17 ++++ mywiki/tiddlers/functional programming.tid | 8 +- 9 files changed, 267 insertions(+), 3 deletions(-) create mode 100644 mywiki/tiddlers/GIT server.tid create mode 100644 mywiki/tiddlers/HAProxy_ Reloading Your Config With Minimal Service Impact.tid create mode 100644 mywiki/tiddlers/Programming.tid create mode 100644 mywiki/tiddlers/Safari.tid create mode 100644 mywiki/tiddlers/Squid sslbump.tid create mode 100644 mywiki/tiddlers/boot2docker reset.tid create mode 100644 mywiki/tiddlers/docker install.tid diff --git a/mywiki/tiddlers/GIT server.tid b/mywiki/tiddlers/GIT server.tid new file mode 100644 index 0000000..a6a9560 --- /dev/null +++ b/mywiki/tiddlers/GIT server.tid @@ -0,0 +1,18 @@ +created: 20151125110622808 +creator: user +modified: 20151207171352867 +modifier: user +tags: +title: GIT server +type: text/vnd.tiddlywiki + +https://gogs.io + +``` +ssh aiko@nas +cd /volume1/homes/aiko/repos +mkdir gitproject.git +cd gitproject.git +git --bare init +git update-server-info +``` diff --git a/mywiki/tiddlers/HAProxy_ Reloading Your Config With Minimal Service Impact.tid b/mywiki/tiddlers/HAProxy_ Reloading Your Config With Minimal Service Impact.tid new file mode 100644 index 0000000..7f53598 --- /dev/null +++ b/mywiki/tiddlers/HAProxy_ Reloading Your Config With Minimal Service Impact.tid @@ -0,0 +1,79 @@ +created: 20151204110112790 +creator: user +modified: 20151204113747216 +modifier: user +tags: +title: HAProxy: Reloading Your Config With Minimal Service Impact +type: text/vnd.tiddlywiki + +docker image: https://hub.docker.com/r/million12/haproxy/~/dockerfile/ + +source: https://web.archive.org/web/20150219063018/http://www.mgoff.in/2010/04/18/haproxy-reloading-your-config-with-minimal-service-impact +posted by: Michael Goffin + +[[HAProxy| http://haproxy.org ]] is a high performance load balancer. It is very light-weight, and free, making it a great option if you are in the market for a load balancer and need to keep your costs down. + +Lately we’ve been making a lot of load balancer changes at work to accommodate new systems and services. Even though we have two load balancers running with [[keepalived| http://www.keepalived.org/ ]] taking care of any failover situations, I was thinking about how we go about reloading our configuration files. In the event of a change, the “common” way to get the changes to take effect is to run ''/etc/init.d/haproxy restart''. This is bad for a couple major reasons: + +# You are temporarily shutting your load balancer down +# You are severing any current connections going through the load balancer +You might say, “if you have two load balancers with keepalived, restarting the service should be fine since keepalived will handle the failover.” This, however, isn’t always true. Keepalived uses advertisements to determine when to fail over. The default advertisement interval is 1 second (configurable in keepalived.conf). The skew time helps to keep everyone from trying to transition at once. It is a number between 0 and 1, based on the formula ''(256 – priority) / 256''. As defined in the RFC, the backup must receive an advertisement from the master every ''(3 * advert_int) + skew_time'' seconds. If it doesn’t hear anything from the master, it takes over. + +Let’s assume you are using the default interval of 1 second. On my test machine, this is the duration of time it takes to restart haproxy: + +``` +# time /etc/init.d/haproxy restart + * Restarting haproxy haproxy + ...done. + +real 0m0.022s +user 0m0.000s +sys 0m0.016s +``` +In this situation, haproxy would restart much faster than your 1 second interval. You could get lucky and happen to restart it just before the check, but luck is not consistent enough to be useful. Also, in very high-traffic situations, you’ll be causing a lot of connection issues. So we cannot rely on keepalived to solve the first problem, and it definitely doesn’t solve the second problem. + +After sifting through haproxy documentation (the text-based documentation, not the man page) (/usr/share/doc/haproxy/haproxy-en.txt.gz on Ubuntu), I came across this: + +``` +313 +314 global +315 daemon +316 quiet +317 nbproc 2 +318 pidfile /var/run/haproxy-private.pid +319 +320 # to stop only those processes among others : +321 # kill $(