This repository has been archived by the owner on Dec 19, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
482 lines (409 loc) · 14.2 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
<head>
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,600italic,700italic,300,400,800' rel='stylesheet' type='text/css'>
<link href="css/impress-demo.css" rel="stylesheet" />
<script language="javascript" type="text/javascript" src="js/jit-yc.js"></script>
<script language="javascript" type="text/javascript" src="js/cluster_diagram.js"></script>
<style>
#infovis {
position:relative;
width:1000px;
height:700px;
margin:auto;
overflow:hidden;
font-color: black;
font-family: "Lucida Grande", Verdana;
font-size: 0.5em;
text-align: center;
background-color: black;
}
#log {
position:relative;
top:10px;
font-size:0em;
font-weight:bold;
color:#23A4FF;
}
#infovis-canvaswidget {
margin:25px 0 0 25px;
}
#gist1 {
width:800px;
height:700px;
}
backend {
font-size: 0.5em;
}
pre { white-space: pre; white-space: pre-wrap; word-wrap: break-word; font-family: "Courier"; font-size:0.8em; }
</style>
</head>
<body onload="init();">
<div id="impress" class="impress-not-supported">
<div class="fallback-message">
</div>
<div class="step" data-x="-2500" data-y="150">
</div>
<div class="step" data-x="-2160" data-y="150">
<q>Carlo Flores</q>
</div>
<div class="step" data-x="-2250" data-y="250">
<q>meetup.com/LADevOps</q><br />
</div>
<div class="step" data-x="-2080" data-y="300">
<q>js.la</q>
</div>
<div class="step" data-x="-2320" data-y="450">
Verizon Digital Media Services
</div>
<div class="step" data-x="-2370" data-y="600">
(this software is not used at my job)
</div>
<div class="step" data-x="-2290" data-y="650">
we're hiring for other stuff!
</div>
<div class="step" data-x="600" data-y="-500" data-scale="5">
Tooling around HAProxy
</div>
<div class="step" data-x="400" data-y="-300" data-scale="4">
and lessons learned along the way
</div>
<div class="step" data-x="-1000" data-y="300">
<q>
<strong>Fast, Configurable, Manageable</strong>
<ul>
<li>epoll, kqueue</li>
<li>event driven, single process</li>
<li>pcre-based acls</li>
<li>match on any header</li>
<li>queues, frontends/backends, hot-spares, enable/disable servers...</li>
<li>native SSL support (v 1.5), OCSP stapling, PROXY protocol...</li>
</ul>
</q>
</div>
<div class="step" data-x="0" data-y="300">
<q>
<strong>Mature</strong>
<ul>
<li>production since 2002 (v1.1)</li>
<li>100,000+ http requests/sec</li>
<li>great support community and mailing list</li>
<li>written by Willy Tarreau</li>
</ul>
</q>
</div>
<div class="step" data-x="2000" data-y="300" data-scale="3">
<img src="http://moar.edgecats.net/cats/tipincat.gif">
</div>
<div class="step" data-x="0" data-y="1500">
use case
</div>
<div class="step" data-x="-1000" data-y="4000" data-scale="5">
<div id="log">
</div>
<div id="infovis">
</div>
</div>
<div class="step" data-x="2900" data-y="2400">
<q>
that configuration
</q>
</div>
<div class="step" data-x="3000" data-y="2800">
<div id="gist1">
<img src="img/hairy_proxy.png">
</div>
</div>
<div class="step" data-x="2900" data-y="3100">
<q>
gets hairy fast
</q>
</div>
<div class="step" data-x="2900" data-y="3160">
<q>
enter <a href="https://github.com/joewilliams/haproxy_join">haproxy_join</a>
</q>
</div>
<div class="step" data-x="2900" data-y="3220">
<q>
<a href="https://github.com/joewilliams">github.com/joewilliams</a>
</q>
</div>
<div class="slide step" data-x="3500" data-y="2600">
/etc/haproxy/conf/global.cfg
<pre>
global
log 127.0.0.1 local0 notice
maxconn 50000
daemon
stats socket /tmp/proxystats level admin
</pre>
</div>
<div class="slide step" data-x="4500" data-y="2600">
/etc/haproxy/conf/defaults.cfg
<pre>
defaults
log global
mode http
option httplog
option dontlognull
stats enable
stats uri /proxystats
stats auth some:supersecretcredential
stats refresh 5s
contimeout 120000
clitimeout 120000
srvtimeout 120000
option redispatch
option forwardfor
option http-server-close
</pre>
</div>
<div class="slide step" data-x="3500" data-y="3500">
/etc/haproxy/conf/frontend.d/http.cfg
<pre>
frontend http
bind :80
acl rightfqdn hdr(host) www.ourdomain.com
acl static url_reg (html|js|css|png|jpg|gif)$
acl static url_beg /static
acl api url_beg /api
acl mobile url_beg /mobile
acl blog url_beg /blog
redirect location http://www.ourdomain.com if !rightfqdn
use_backend static if static
use_backend api if api
use_backend mobile if mobile
use_backend blog if blog
default_backend static
</pre>
</div>
<div class="slide step" data-x="4500" data-y="3500">
/etc/haproxy/conf/backend.d/api.cfg
<pre id="backend">
backend api
mode http
balance leastconn
monitor-uri /api_app_check
server api1 10.10.30.1:80 check inter 60s rise 5 fall 2
server api2 10.10.30.2:80 check inter 60s rise 5 fall 2
server api3 10.10.30.3:80 check inter 60s rise 5 fall 2
server api4 10.10.30.4:80 check inter 60s rise 5 fall 2
server api5 10.10.30.5:80 check inter 60s rise 5 fall 2
...
</pre>
</div>
<div class="step" data-x="3500" data-y="4400">
<pre>haproxy_join haproxy.cfg /etc/haproxy/</pre>
</div>
<div class="step" data-x="4500" data-y="4400">
<q>
worth noting there's wonderful alternatives at
<a href='https://github.com/finnlabs/haproxy'>github.com/finnlabs/haproxy</a>
</q>
<q>
and puppet's concat module
<a href="https://github.com/ripienaar/puppet-concat">github.com/ripienaar/puppet-concat</a>
</q>
</div>
<div class="step" data-x="-1000" data-y="6300" data-scale="2">
Managing running instances
</div>
<div class="step" data-x="-1600" data-y="6450">
Fancy web UI
</div>
<div class="step" data-x="-1750" data-y="6700">
<img src="img/haproxy_webui.png">
</div>
<div class="step" data-x="-1750" data-y="7000">
<ul>
<li>Real time statistics</li>
<li>ACL controlled for access restriction</li>
<li>(dis|en)able individual servers</li>
</ul>
</div>
<div class="step" data-x="-600" data-y="6450">
UNIX socket
</div>
<div class="step" data-x="-750" data-y="6700">
<img src="img/stats_socket.png">
</div>
<div class="step" data-x="-750" data-y="7100">
<ul>
<li>same features</li>
<li>but not friendly</li>
<li>despite being on the cli</li>
</ul>
</div>
<div class="step" data-x="750" data-y="6450">
enter haproxyctl
</div>
<div class="step" data-x="750" data-y="6510">
<a href="http://github.com/flores/haproxyctl">github.com/flores/haproxyctl</a>
</div>
<div class="step" data-x="1750" data-y="6100">
Health checks for programs or humans
</div>
<div class="slide step" data-x="1750" data-y="6510">
<pre>
# ./haproxyctl nagios
OK has listener + guys connected
</pre>
<pre>
# ./haproxyctl cloudkick
./haproxyctl cloudkick
status ok haproxy is running
metric connections int 1200
metric http_FRONTEND_request_rate int 451
metric http_FRONTEND_health_check_duration int 45
metric static_ngnix1_total_requests gauge 4720
metric static_ngnix1_health_check_duration int 7
metric static_ngnix2_total_requests gauge 4759
metric static_ngnix2_health_check_duration int 8
metric static_ngnix3_total_requests gauge 4571
metric static_ngnix3_health_check_duration int 8
...
metric static_BACKEND_total_requests gauge 27839
metric static_BACKEND_health_check_duration int 45
</pre>
</div>
<div class="slide step" data-x="1750" data-y="7410">
<pre>
# ./haproxyctl "show health"
pxname svname status weight
http FRONTEND OPEN
static ngnix1 UP 1
static ngnix2 UP 1
static ngnix3 UP 1
static nginx4 UP 1
static nginx5 UP 1
static nginx6 DOWN 1
static nginx7 UP 1
static nginx8 UP 1
static nginx9 UP 1
static nginx10 UP 1
static BACKEND UP 9
...
</pre>
</div>
<div class="slide step" data-x="1750" data-y="8310">
<pre>
./haproxyctl "show backends"
static BACKEND UP 9
api BACKEND UP 20
mobile BACKEND UP 20
blogs BACKEND UP 3
redis BACKEND UP 1
mysql BACKEND UP 2
</pre>
<pre>
./haproxyctl reload
gracefully stopping connections on pid 23162...
checking if connections still alive on 23162...
reloaded haproxy on pid 1119
</pre>
</div>
<div class="step" data-x="2750" data-y="6100">
(dis|en)able a server from every backend
</div>
<div class="slide step" data-x="2750" data-y="6510">
<pre>
./haproxyctl "show health"
# pxname svname status weight
http FRONTEND OPEN
api api1 UP 1
api api2 UP 1
api api3 UP 1
api BACKEND UP 3
abusers api1 UP 1
abusers api2 UP 1
abusers api3 UP 1
abusers BACKEND UP 3
</pre>
</div>
<div class="slide step" data-x="2750" data-y="7410">
<pre>
./haproxyctl "disable all api1"
./haproxyctl "show health"
# pxname svname status weight
http FRONTEND OPEN
api api1 MAINT 1
api api2 UP 1
api api3 UP 1
api BACKEND UP 2
abusers api1 MAINT 1
abusers api2 UP 1
abusers api3 UP 1
abusers BACKEND UP 2
</pre>
</div>
<div class="step" data-x="2750" data-y="8310">
First Ruby project for work (at the time), a lot to be improved<br />
Shared via blog post and SCaLE 10x's DevOps Day
</div>
<div class="step" data-x="4000" data-y="6100">
My favorite pull request ever
</div>
<div class="step" data-x="4000" data-y="6450">
"...I like your project and where you've gone with it. But this project needs tests... Badly. I'll start contributing some, once I gem-ify this, as I'm not sticking this in production without any :)." - <a href='https://github.com/flores/haproxyctl/pull/1' target='_blank'>@sgonyea</a>
</div>
<div class="step" data-x="4000" data-y="7010">
A contribution that is more than code:
<ul>
<li>* split the script into readable libraries</li>
<li>* general Ruby lessons and Rubyisms</li>
<li>* still a reference for me today</li>
</ul>
</div>
<div class="step" data-x="4000" data-y="7410">
Support multiple instances of HAProxy, contributed by <a href='https://github.com/flores/haproxyctl/pull/4/files' target='_blank'>@jbarbuto</a>
</div>
<div class="step" data-x="5500" data-y="6100">
<a href='https://github.com/flores/haproxyctl/pull/9/files' target='_blank'>@osterman</a> made it a grown up RubyGem<br />
(I did not think it was good enough)
</div>
<div class="step" data-x="5500" data-y="6450">
<img src='img/rubygems201501.png' alt="ruby gem stats">
</div>
<div class="step" data-x="5500" data-y="7010">
<a href='https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=739008' target='_blank'>@hggh</a> packages and maintains it for Debian</a>
</div>
<div class="step" data-x="5500" data-y="7410">
<strong>Easy to get on your box:</strong><br />
Debian Jessie and current sid/unstable:
<pre>apt-get install haproxyctl</pre>
Rubygems:
<pre>gem install haproxyctl</pre>
Easy shell script:
<pre>haproxy_src_install.sh</pre>
</div>
<div class="step" data-x="-770" data-y="7500" data-scale="2">
Thanks!
</div>
<div class="step" data-x="-1750" data-y="8000">
Contributors:
<ul>
<li><a href="https://github.com/sgonyea">Scott Gonyea aka <code>sgonyea</code></a></li>
<li><a href="https://github.com/blovett">Ben Lovett aka <code>blovett</code></a></li>
<li><a href="https://github.com/jbarbuto">John A. Barbuto aka <code>jbarbuto</code></a></li>
<li><a href="https://github.com/till">Till Klampaeckel aka <code>till</code></a></li>
<li><a href="https://github.com/osterman">Erik Osterman aka <code>osterman</code></a></li>
<li><a href="https://github.com/mhald">Martin Hald aka <code>mhald</code></a></li>
<li><a href="https://github.com/deniedboarding">deniedboarding</a></li>
<li><a href="https://github.com/blewa">Aaron Blew aka <code>blewa</code></a></li>
<li><a href="https://github.com/nicobrevin">Nick Griffiths aka <code>nicobrevin</code></a></li>
<li><a href="https://github.com/fh">Florian Holzhauer aka <code>fh</code></a></li>
<li><a href="https://github.com/hggh">Jonas Genannt aka <code>hggh</code></a></li>
</ul>
</div>
<div class="step" data-x="-750" data-y="7700">
Contact info:
<ul>
<li><a href="https://twitter.com/lolcatstevens">twitter.com/lolcatstevens</a></li>
<li><a href="https://github.com/flores">github.com/flores</a></li>
<li><a href="mailto:[email protected]">[email protected]</a></li>
</ul>
</div>
<div class="step" data-x="-1250" data-y="7950" data-scale="2">
</div>
</div>
<script src="js/impress.js"></script>
</body>