Re: Getting size of response

2014-08-27 Thread Baptiste
On Wed, Aug 27, 2014 at 5:59 AM, Patrick Hemmer hapr...@stormcloud9.net wrote:
 From: Nick Jennings n...@silverbucket.net
 Sent: 2014-08-26 19:55:34 EDT
 To: haproxy haproxy@formilux.org
 Subject: Getting size of response

 Hi all, is there a way to get the size of a response as it's being sent out
 through haproxy during logging? The node.js app (restify) is sending gzip'd
 responses but not including a Content-Length due to some bug. I was
 wondering if I could get the size with haproxy and side-step the whole
 issue.

 Thanks,
 Nick


 If you're using `option httplog`, the 8th field is bytes sent to client. If
 you're using `option tcplog`, it's the 7th field.
 See http://cbonte.github.io/haproxy-dconv/configuration-1.5.html#8.2.3

 -Patrick




Hi Nick,

Patrick's answer is perfect :)
He forgot to mention that HAProxy is going to log the total bytes size
sent by the server, it includes both body and headers.
You could also use the log-format directive and log only the fields you want.

Are you sure the bug is in nodejs?
It might be doing chunked encoding...
Try dumping some traffic and check if you have a Transfer-Encoding
header in the response sent by the server.

Baptiste



Re: keep alive timeouts

2014-08-27 Thread Baptiste
On Tue, Aug 26, 2014 at 10:49 PM, Joseph Hardeman jwharde...@gmail.com wrote:
 Hi Lukas,

 Thank you for responding, I was told that the remote servers are sending
 keep alive request with microseconds between calls.  I have not actually
 investigated this, I am going off of what my Network Engineer is telling me
 with him running wireshark and looking at packet captures.

 The second and biggest issue I have is that we are using the haproxy
 embedded into the VMWare vSheild load balancer.  So I don't have any access
 to their configuration files.  I actually recommended we setup a second
 haproxy to use and move them off of that appliance for load balancing.  They
 are trying to insert an F5 load balancer instead.  I was just wondering if
 anyone might have seen something like this or something.  :-)

 Thanks for the reply and take care.

 Joe


Hey Joe, where you going' with that F5 in your hand ???
(Sorry, I tried to avoid, but I couldnt. quoting Jimi, RIP)

I agree with Lukas, you're issue looks a bit weird!
microsecond keepalives don't make any sense!

Well, look a bit on internet, there are real HAProxy appliances or
Virtual Appliances much cheaper than your F5 and much better than
vshield (at least you could configure HAProxy in it) :)
hint: http://www.haproxy.com/

Baptiste



Re: Getting size of response

2014-08-27 Thread Nick Jennings
Hi Baptiste, ah - of course - it's a chunked response. I overlooked that.

So, in this case, is haproxy the only way to measure bandwidth usage?
Subracting average header size from the total.


On Wed, Aug 27, 2014 at 9:00 AM, Baptiste bed...@gmail.com wrote:

 On Wed, Aug 27, 2014 at 5:59 AM, Patrick Hemmer hapr...@stormcloud9.net
 wrote:
  From: Nick Jennings n...@silverbucket.net
  Sent: 2014-08-26 19:55:34 EDT
  To: haproxy haproxy@formilux.org
  Subject: Getting size of response
 
  Hi all, is there a way to get the size of a response as it's being sent
 out
  through haproxy during logging? The node.js app (restify) is sending
 gzip'd
  responses but not including a Content-Length due to some bug. I was
  wondering if I could get the size with haproxy and side-step the whole
  issue.
 
  Thanks,
  Nick
 
 
  If you're using `option httplog`, the 8th field is bytes sent to client.
 If
  you're using `option tcplog`, it's the 7th field.
  See http://cbonte.github.io/haproxy-dconv/configuration-1.5.html#8.2.3
 
  -Patrick
 
 


 Hi Nick,

 Patrick's answer is perfect :)
 He forgot to mention that HAProxy is going to log the total bytes size
 sent by the server, it includes both body and headers.
 You could also use the log-format directive and log only the fields you
 want.

 Are you sure the bug is in nodejs?
 It might be doing chunked encoding...
 Try dumping some traffic and check if you have a Transfer-Encoding
 header in the response sent by the server.

 Baptiste



Re: acl set as side effect of reqrep ?

2014-08-27 Thread Baptiste
On Tue, Aug 26, 2014 at 5:31 PM, Jim Freeman jfree...@gmail.com wrote:
 Is there an easy/efficient way to set an acl as a direct side-effect
 of a reqrep (not) matching/replacing ?

 Thanks,
 ...jfree


Hi Jim,

Please clearly explain us what you want to do; step by step.
And we'll be able to help you.

Baptiste



Re: acl set as side effect of reqrep ?

2014-08-27 Thread Jim Freeman
On Wed, Aug 27, 2014 at 4:39 AM, Baptiste bed...@gmail.com wrote:
 On Tue, Aug 26, 2014 at 5:31 PM, Jim Freeman jfree...@gmail.com wrote:
 Is there an easy/efficient way to set an acl as a direct side-effect
 of a reqrep (not) matching/replacing ?

 Thanks,
 ...jfree

 Hi Jim,

 Please clearly explain us what you want to do; step by step.
 And we'll be able to help you.

 Baptiste

I'd hope for something like (near-trivial case):

acl req_dynamic ! reqrep ^([^\ :]*)\ /static/(.*) \1\ /\2
...
use_backend dynamic_content   req_dynamic

where the acl criterion is met if the request regexp is found/replaced.

IOW - does(/could) reqrep constitute a fetch (where the fetched data
has now been replaced)?  The fact that the data was there (though it
is now replaced) is latched in the acl.



Re: acl set as side effect of reqrep ?

2014-08-27 Thread Baptiste
On Wed, Aug 27, 2014 at 4:56 PM, Jim Freeman jfree...@gmail.com wrote:
 On Wed, Aug 27, 2014 at 4:39 AM, Baptiste bed...@gmail.com wrote:
 On Tue, Aug 26, 2014 at 5:31 PM, Jim Freeman jfree...@gmail.com wrote:
 Is there an easy/efficient way to set an acl as a direct side-effect
 of a reqrep (not) matching/replacing ?

 Thanks,
 ...jfree

 Hi Jim,

 Please clearly explain us what you want to do; step by step.
 And we'll be able to help you.

 Baptiste

 I'd hope for something like (near-trivial case):

 acl req_dynamic ! reqrep ^([^\ :]*)\ /static/(.*) \1\ /\2
 ...
 use_backend dynamic_content   req_dynamic

 where the acl criterion is met if the request regexp is found/replaced.

 IOW - does(/could) reqrep constitute a fetch (where the fetched data
 has now been replaced)?  The fact that the data was there (though it
 is now replaced) is latched in the acl.

Hi Jim,

I still don't clearly understand what you want to do.

That said, you can do the reqrep into the static backend and do the
content switching in the frontend based on your static matching
criterias.

  use-backend dynamic_content unless { req.path_beg -i /static/ }
  default_backend static

Baptiste



smtp cluster with haproxy

2014-08-27 Thread Fraj KALLEL
hello,

i use postfix 2.11 and haproxy 1.5 for setting up cluster smtp.
above is my configuration and the cluster doesn't work.

have you any idea please for solving this problem?

i have 3 servers:
192.168.1.32 haproxy server
192.168.1.38 smtp server1
192.168.1.39 smtp server2

192.168.1.40 virtual ip

in attachements you find my configuration files

Sincerly yours,
Fraj KALLEL


haproxy.cfg
Description: Binary data


main.cf
Description: Binary data


master.cf
Description: Binary data


Re: smtp cluster with haproxy

2014-08-27 Thread PiBa-NL

Hi Fraj,

Please define , 'doesnt work' ?

With the config you attached you should get a error while starting 
haproxy with that config? Something like this:

haproxy -c -f /tmp/Fraj_haproxy.cfg
[ALERT] 238/191742 (98396) : parsing [/tmp/Fraj_haproxy.cfg:10] : 
'server smtp1' unknown keyword 'option'. Registered keywords : .etc etc


You should replace 'option smtpchk' on the server line by 'check' the 
option smtpchk in the section will already make sure the checks will be 
using smtp.

option smtpchk
server  smtp1 192.168.1.38:10024  maxconn 100  check

If it then still doesn't work i would add a listen section for stats to 
check if haproxy does 'see' the servers are 'up'.


Greets PiBa-NL

Fraj KALLEL schreef op 27-8-2014 18:05:



hello,

i use postfix 2.11 and haproxy 1.5 for setting up cluster smtp.
above is my configuration and the cluster doesn't work.

have you any idea please for solving this problem?

i have 3 servers:
192.168.1.32 haproxy server
192.168.1.38 smtp server1
192.168.1.39 smtp server2

192.168.1.40 virtual ip

in attachements you find my configuration files

Sincerly yours,
Fraj KALLEL






Busy Poll Support

2014-08-27 Thread Ben Burkert
Hello,

The 3.11 release of the Linux kernel added a new feature for low
latency network polling. Using the SO_BUSY_POLL socket option, an
application can enable busy polling. This instructs the kernel to poll
the network device driver directly for a period of time when the
application does a read or poll on the socket before new packets have
been recieved. For HAproxy deployments sensitive to latency or jitter,
supporting busy polling could provide a mechanism to trade higher CPU
load for reduced latency and jitter.

I'm intersted in adding a feature to HAproxy for setting SO_BUSY_POLL
on a listener socket. I was thinking the socket option could be
enabled by setting a busy_poll keyword in the listen section. Is
there any interest in accepting patches for such a feature?

Cheers,
-Ben



广东广州林氏集团(邀请函)

2014-08-27 Thread 民财


广东广州林氏集团(邀请函).xlsx
Description: MS-Excel 2007 spreadsheet