haproxy 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +10 -10
- data/lib/haproxy/version.rb +1 -1
- data/spec/spec_helper.rb +16 -20
- metadata +2 -2
data/README.md
CHANGED
@@ -21,11 +21,11 @@ TCP/HTTP Load Balancer_.
|
|
21
21
|
#! /usr/bin/env ruby
|
22
22
|
require 'haproxy'
|
23
23
|
require 'pp'
|
24
|
-
|
24
|
+
|
25
25
|
haproxy = HAProxy.read_stats '/path/to/haproxy.stats.socket'
|
26
|
-
|
26
|
+
|
27
27
|
pp haproxy.info
|
28
|
-
|
28
|
+
|
29
29
|
# {:name=>"HAProxy",
|
30
30
|
# :version=>"1.3.22",
|
31
31
|
# :release_date=>"2009/10/14",
|
@@ -46,9 +46,9 @@ TCP/HTTP Load Balancer_.
|
|
46
46
|
# :run_queue=>"1",
|
47
47
|
# :node=>"roke",
|
48
48
|
# :"description:"=>nil}
|
49
|
-
|
49
|
+
|
50
50
|
pp haproxy.stats
|
51
|
-
|
51
|
+
|
52
52
|
# [{:pxname=>"app1",
|
53
53
|
# :svname=>"thin1",
|
54
54
|
# :qcur=>"0",
|
@@ -90,7 +90,7 @@ TCP/HTTP Load Balancer_.
|
|
90
90
|
|
91
91
|
global
|
92
92
|
stats socket haproxy
|
93
|
-
|
93
|
+
|
94
94
|
defaults
|
95
95
|
mode http
|
96
96
|
option httplog
|
@@ -102,20 +102,20 @@ TCP/HTTP Load Balancer_.
|
|
102
102
|
clitimeout 50000
|
103
103
|
srvtimeout 50000
|
104
104
|
stats uri /haproxy
|
105
|
-
|
105
|
+
|
106
106
|
listen app1 0.0.0.0:10000
|
107
107
|
balance roundrobin
|
108
|
-
|
108
|
+
|
109
109
|
server thin1 127.0.0.1:10001
|
110
110
|
server thin1 127.0.0.1:10002
|
111
111
|
server thin1 127.0.0.1:10003
|
112
112
|
server thin1 127.0.0.1:10004
|
113
113
|
server thin1 127.0.0.1:10005
|
114
|
-
|
114
|
+
|
115
115
|
frontend app2
|
116
116
|
bind 0.0.0.0:10011
|
117
117
|
default_backend app2
|
118
|
-
|
118
|
+
|
119
119
|
backend app2
|
120
120
|
balance roundrobin
|
121
121
|
server thin1 127.0.0.1:10006
|
data/lib/haproxy/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -16,22 +16,18 @@ module HAProxy
|
|
16
16
|
path = self.temp_file_path
|
17
17
|
|
18
18
|
UNIXServer.open(path) do |socket|
|
19
|
-
|
20
|
-
Thread.abort_on_exception = true
|
21
|
-
|
22
|
-
Process.fork do
|
23
|
-
# print "#{self} awaiting for connections in #{path}\n"
|
19
|
+
pid = Process.fork do
|
24
20
|
client = socket.accept
|
25
|
-
# print "#{client} connected\n"
|
26
21
|
cmd, data = client.recvfrom(1024)
|
27
22
|
cmd.chomp!
|
28
|
-
# print "#{self} received '#{cmd}' from #{client}/#{data}\n"
|
29
23
|
client.send self.send(action || :unknown), 0
|
30
24
|
client.close
|
31
|
-
|
25
|
+
exit
|
32
26
|
end
|
33
27
|
|
34
28
|
block.call(path)
|
29
|
+
|
30
|
+
Process.kill "TERM", pid rescue nil
|
35
31
|
end
|
36
32
|
end
|
37
33
|
|
@@ -66,13 +62,13 @@ description
|
|
66
62
|
def with_errors
|
67
63
|
'''
|
68
64
|
[09/Mar/2011:16:05:48.038] frontend http-in (#1): invalid request
|
69
|
-
src
|
65
|
+
src 10.0.111.185, session #25765333, backend <NONE> (#-1), server <NONE> (#-1)
|
70
66
|
request length 352 bytes, error at position 23:
|
71
67
|
|
72
68
|
00000 POS LWqEQR/710 HTTP/1.1\x00\x00Content-Type: application/x-fcs\x00\x00
|
73
69
|
00058+ User- HTTP/1.1\r\n
|
74
70
|
00074 kwave Flash\r\n
|
75
|
-
00087 Host:
|
71
|
+
00087 Host: 10.0.49.24\x00\x00Content-Length: 1\x00\x00P\r\n
|
76
72
|
00128 xy-Connection: Keep\r\n
|
77
73
|
00149 live\x00\x00Pragm\r\n
|
78
74
|
00162 no-cache\x00\x00X-NovINet: v1.2\x00\x00\x00\n
|
@@ -95,16 +91,16 @@ description
|
|
95
91
|
end
|
96
92
|
|
97
93
|
def with_sessions
|
98
|
-
'''0xa14a288: proto=tcpv4 src=
|
99
|
-
0x9745898: proto=tcpv4 src=
|
100
|
-
0xa26cff0: proto=tcpv4 src=
|
101
|
-
0x9f2dff0: proto=tcpv4 src=
|
102
|
-
0xa2cb998: proto=tcpv4 src=
|
103
|
-
0xa04b7e8: proto=tcpv4 src=
|
104
|
-
0x97d0b90: proto=tcpv4 src=
|
105
|
-
0x96b1220: proto=tcpv4 src=
|
106
|
-
0xa12e7a8: proto=tcpv4 src=
|
107
|
-
0x9b5f570: proto=tcpv4 src=
|
94
|
+
'''0xa14a288: proto=tcpv4 src=10.0.16.1:56772 fe=http-in be=gelderlander_textlink srv=mongrel-10306 as=0 ts=08 age=49s calls=5 rq[f=00f0a0h,l=0,an=00h,rx=,wx=,ax=] rp[f=001000h,l=0,an=10h,rx=4s,wx=,ax=] s0=[7,0h,fd=13,ex=] s1=[7,0h,fd=16,ex=] exp=4s
|
95
|
+
0x9745898: proto=tcpv4 src=10.0.73.31:2778 fe=http-in be=gelderlander_textlink srv=mongrel-10315 as=0 ts=08 age=42s calls=4 rq[f=009080h,l=0,an=00h,rx=,wx=,ax=] rp[f=001000h,l=0,an=10h,rx=8s,wx=,ax=] s0=[7,0h,fd=19,ex=] s1=[7,8h,fd=20,ex=] exp=8s
|
96
|
+
0xa26cff0: proto=tcpv4 src=10.0.221.60:19546 fe=http-in be=limburger_textlink srv=mongrel-10708 as=0 ts=08 age=40s calls=4 rq[f=009080h,l=0,an=00h,rx=,wx=,ax=] rp[f=001000h,l=0,an=10h,rx=10s,wx=,ax=] s0=[7,0h,fd=25,ex=] s1=[7,8h,fd=26,ex=] exp=10s
|
97
|
+
0x9f2dff0: proto=tcpv4 src=10.0.45.76:59090 fe=http-in be=tctubantia_textlink srv=mongrel-10507 as=0 ts=08 age=38s calls=5 rq[f=00f0a0h,l=0,an=00h,rx=,wx=,ax=] rp[f=001000h,l=0,an=10h,rx=11s,wx=,ax=] s0=[7,0h,fd=23,ex=] s1=[7,0h,fd=24,ex=] exp=11s
|
98
|
+
0xa2cb998: proto=tcpv4 src=10.0.108.32:1734 fe=http-in be=tctubantia_textlink srv=mongrel-10505 as=0 ts=08 age=37s calls=3 rq[f=009080h,l=0,an=00h,rx=,wx=,ax=] rp[f=001000h,l=0,an=10h,rx=12s,wx=,ax=] s0=[7,0h,fd=28,ex=] s1=[7,8h,fd=29,ex=] exp=12s
|
99
|
+
0xa04b7e8: proto=tcpv4 src=10.0.148.59:1158 fe=http-in be=destentor_textlink srv=mongrel-10403 as=0 ts=08 age=34s calls=4 rq[f=009080h,l=0,an=00h,rx=,wx=,ax=] rp[f=001000h,l=0,an=10h,rx=16s,wx=,ax=] s0=[7,0h,fd=32,ex=] s1=[7,8h,fd=33,ex=] exp=16s
|
100
|
+
0x97d0b90: proto=tcpv4 src=10.0.133.111:50836 fe=http-in be=tctubantia_textlink srv=mongrel-10510 as=0 ts=08 age=21s calls=4 rq[f=009080h,l=0,an=00h,rx=,wx=,ax=] rp[f=001000h,l=0,an=10h,rx=29s,wx=,ax=] s0=[7,0h,fd=1,ex=] s1=[7,8h,fd=8,ex=] exp=29s
|
101
|
+
0x96b1220: proto=tcpv4 src=10.0.217.27:14445 fe=http-in be=gelderlander_textlink srv=mongrel-10310 as=0 ts=08 age=19s calls=4 rq[f=009080h,l=0,an=00h,rx=,wx=,ax=] rp[f=001000h,l=0,an=10h,rx=30s,wx=,ax=] s0=[7,0h,fd=21,ex=] s1=[7,8h,fd=22,ex=] exp=30s
|
102
|
+
0xa12e7a8: proto=tcpv4 src=10.0.34.84:49421 fe=http-in be=gelderlander_textlink srv=mongrel-10303 as=0 ts=08 age=16s calls=4 rq[f=009080h,l=0,an=00h,rx=,wx=,ax=] rp[f=001000h,l=0,an=10h,rx=33s,wx=,ax=] s0=[7,0h,fd=15,ex=] s1=[7,8h,fd=17,ex=] exp=33s
|
103
|
+
0x9b5f570: proto=tcpv4 src=10.0.242.177:50124 fe=http-in be=limburger_textlink srv=mongrel-10701 as=0 ts=08 age=14s calls=4 rq[f=009080h,l=0,an=00h,rx=,wx=,ax=] rp[f=001000h,l=0,an=10h,rx=35s,wx=,ax=] s0=[7,0h,fd=38,ex=] s1=[7,8h,fd=40,ex=] exp=35s
|
108
104
|
0x9fda668: proto=unix_stream as=2 ts=09 age=0s calls=2 rq[f=00e042h,l=10,an=20h,rx=10s,wx=,ax=] rp[f=048060h,l=2499,an=00h,rx=,wx=10s,ax=] s0=[7,0h,fd=2,ex=] s1=[0,0h,fd=-1,ex=] exp=10s
|
109
105
|
'''
|
110
106
|
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: haproxy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.3
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- "Leandro L\xC3\xB3pez (inkel)"
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-03-
|
13
|
+
date: 2011-03-12 00:00:00 -03:00
|
14
14
|
default_executable:
|
15
15
|
dependencies: []
|
16
16
|
|