[PATCH 2/2] MEDIUM: Differentiate between DRAIN and DRAIN (agent)

2015-04-08 Thread Simon Horman
Differentiate between DRAIN and DRAIN (agent) when reporting stats.
This is consistent with the distinction made between DOWN and DOWN (agent).

Signed-off-by: Simon Horman 
---
 src/dumpstats.c | 21 ++---
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/src/dumpstats.c b/src/dumpstats.c
index 9f5a4349d231..efc08ab38764 100644
--- a/src/dumpstats.c
+++ b/src/dumpstats.c
@@ -2924,7 +2924,7 @@ static int stats_dump_li_stats(struct stream_interface 
*si, struct proxy *px, st
  * The caller is responsible for clearing the trash if needed. Returns non-zero
  * if it emits anything, zero otherwise. The  parameter can take the
  * following values : 0=DOWN, 1=DOWN(agent) 2=going up, 3=going down, 4=UP, 
5,6=NOLB,
- * 7,8=DRAIN, 9=unchecked.
+ * 7,8=DRAIN, 9=DRAIN(agent), 10=unchecked.
  */
 static int stats_dump_sv_stats(struct stream_interface *si, struct proxy *px, 
int flags, struct server *sv, int state)
 {
@@ -2943,7 +2943,7 @@ static int stats_dump_sv_stats(struct stream_interface 
*si, struct proxy *px, in
ref = ref->track;
 
if (appctx->ctx.stats.flags & STAT_FMT_HTML) {
-   static char *srv_hlt_st[10] = {
+   static char *srv_hlt_st[11] = {
"DOWN",
"DOWN (agent)",
"DN %d/%d ↑",
@@ -2953,6 +2953,7 @@ static int stats_dump_sv_stats(struct stream_interface 
*si, struct proxy *px, in
"NOLB",
"DRAIN %d/%d ↓",
"DRAIN",
+   "DRAIN (agent)",
"no check"
};
 
@@ -3197,7 +3198,7 @@ static int stats_dump_sv_stats(struct stream_interface 
*si, struct proxy *px, in
chunk_appendf(&trash, "-\n");
}
else { /* CSV mode */
-   static char *srv_hlt_st[10] = {
+   static char *srv_hlt_st[11] = {
"DOWN,",
"DOWN (agent),",
"DOWN %d/%d,",
@@ -3207,6 +3208,7 @@ static int stats_dump_sv_stats(struct stream_interface 
*si, struct proxy *px, in
"NOLB,",
"DRAIN %d/%d,",
"DRAIN,",
+   "DRAIN (agent),",
"no check,"
};
 
@@ -3864,8 +3866,9 @@ static int stats_dump_proxy_to_buffer(struct 
stream_interface *si, struct proxy
 *   - UP, draining, going down=> state = 7
 *   - UP, going down  => state = 3
 *   - UP, draining=> state = 8
+*   - UP, draining (agent)=> state = 9
 *   - UP, checked => state = 4
-*   - UP, not checked nor tracked => state = 9
+*   - UP, not checked nor tracked => state = 10
 */
 
if ((svs->check.state & CHK_ST_ENABLED) &&
@@ -3874,11 +3877,15 @@ static int stats_dump_proxy_to_buffer(struct 
stream_interface *si, struct proxy
else
sv_state = 4;
 
-   if (sv->admin & SRV_ADMF_DRAIN)
-   sv_state += 4;
+   if (sv->admin & SRV_ADMF_DRAIN) {
+   if (svs->agent.state & CHK_ST_ENABLED)
+   sv_state = 9;
+   else
+   sv_state += 4;
+   }
 
if (sv_state == 4 && !(svs->check.state & 
CHK_ST_ENABLED))
-   sv_state = 9; /* unchecked UP */
+   sv_state = 10; /* unchecked UP */
}
else if (sv->state == SRV_ST_STOPPING) {
if ((!(sv->check.state & CHK_ST_ENABLED) && 
!sv->track) ||
-- 
2.1.4




[PATCH 1/2] MEDIUM: Only report drain state in stats if server has SRV_ADMF_DRAIN set

2015-04-08 Thread Simon Horman
There are some similarities between a weight of zero and the
administratively set drain state: both allow existing connections
to continue while not accepting any new ones.

However, when reporting a server state generally a distinction is made
between state=UP,weight=0 and state=DRAIN,weight=*. This patch makes
stats reporting consistent in this regard.

Signed-off-by: Simon Horman 
---
 src/dumpstats.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/dumpstats.c b/src/dumpstats.c
index d82ce8538841..9f5a4349d231 100644
--- a/src/dumpstats.c
+++ b/src/dumpstats.c
@@ -3874,7 +3874,7 @@ static int stats_dump_proxy_to_buffer(struct 
stream_interface *si, struct proxy
else
sv_state = 4;
 
-   if (server_is_draining(sv))
+   if (sv->admin & SRV_ADMF_DRAIN)
sv_state += 4;
 
if (sv_state == 4 && !(svs->check.state & 
CHK_ST_ENABLED))
-- 
2.1.4




[PATCH 0/2] Minor enhancements to drain state

2015-04-08 Thread Simon Horman
Hi,

these two patches suggest the following enhancements to Drain.
The second patch has context dependencies on the first one.

1. Only report drain state in stats if server has SRV_ADMF_DRAIN set

   The motivation is to consistently differentiate between
   between state=UP,weight=0 and state=DRAIN,weight=* when reporting stats.

2. Differentiate between DRAIN and DRAIN (agent)

   The motivation here is to make DRAIN consistent with DOWN.


Patches have been lightly tested.


Simon Horman (2):
  MEDIUM: Only report drain state in stats if server has SRV_ADMF_DRAIN
set
  MEDIUM: Differentiate between DRAIN and DRAIN (agent)

 src/dumpstats.c | 21 ++---
 1 file changed, 14 insertions(+), 7 deletions(-)

-- 
2.1.4




Re: Haproxy session time out

2015-04-08 Thread Cyril Bonté

Hi,

Le 08/04/2015 15:49, RAKESH P B a écrit :

Hi All,

  I have installed haproxy from ubuntu repo (haproxy version : 1.5.9. ).
The session time out happens  when client browser sit idle for 5 min.
Please let me know which parameter will causing the time out.


What is the issue here ? Are you talking about a HTTP keep-alive timeout 
of 5 minutes or a timeout occuring because the client or the server 
didn't provide a complete request/response, with no trafic for 5 minutes ?


Please provide your configuration. But you can already have a look to 
"timeout client" [1] and "timeout server" [2] and even other timeouts 
depending on your configuration.


> How  I can

enable to  send the keep alive packets from haproxy to client  to check
whether client active or not.


If you are talking about tcp keepalive this won't be of any help here.


[1] 
http://cbonte.github.io/haproxy-dconv/configuration-1.5.html#timeout%20client
[2] 
http://cbonte.github.io/haproxy-dconv/configuration-1.5.html#timeout%20server


--
Cyril Bonté



Accessories Display

2015-04-08 Thread May

  
  
Nice to meet you!
 
We are a professional designer and producer of wooden products,acryilc display props and boxes,
And we can help you solve the troubles in current procurement.
 
Hope to offer you longteam and pleasant purchase,and look forward to you reply!
 
Thanks
May
  


[SPAM] New commitment invitation - haproxy@formilux.org

2015-04-08 Thread Carolyn Self







  

  



  


  

  

  

Jean-Paul
Jaquilti


  
  
Hi
Namailu User, 


You
have a commitment invitation from Jean-Paul Jaquilti. To view
your commitment invitation please follow this link:


View
Invitation


  

  

  


  

  

  
Copyright
© 2015, Namailu Online Ltd


  
  
|


  
  
User 
Agreement


  
  
|


  
  
Privacy
Policy


  
  
|


  
  
Privacy
Settings


  

  

  

  


 









Haproxy session time out

2015-04-08 Thread RAKESH P B
Hi All,

 I have installed haproxy from ubuntu repo (haproxy version : 1.5.9. ). The
session time out happens  when client browser sit idle for 5 min. Please
let me know which parameter will causing the time out. How  I can enable to
 send the keep alive packets from haproxy to client  to check whether
client active or not.


Re: Compression does not seem to work in my setup

2015-04-08 Thread Krishna Kumar Unnikrishnan (Engineering)
Thanks Igor. With that change, the amount of data transferred mirrors the
gzip output.

Regards,
- KK

On Wed, Apr 8, 2015 at 11:40 AM, Igor Cicimov <
ig...@encompasscorporation.com> wrote:

>
>
> On Wed, Apr 8, 2015 at 3:47 PM, Krishna Kumar Unnikrishnan (Engineering) <
> krishna...@flipkart.com> wrote:
>
>> Hi all,
>>
>> I am trying to use the compression feature, but don't seem to get it
>> working when
>> trying to curl some text files (16K containing a-zA-Z, also smaller files
>> like 1024
>> bytes):
>>
>> $ curl -o/dev/null -D - "http://192.168.122.110:80/TEXT_16K"; -H
>> "Accept-Encoding: gzip"
>>   % Total% Received % Xferd  Average Speed   TimeTime Time
>> Current
>>  Dload  Upload   Total   SpentLeft
>> Speed
>>   0 00 00 0  0  0 --:--:-- --:--:--
>> --:--:-- 0HTTP/1.1 200 OK
>> Server: nginx/1.6.2
>> Date: Wed, 08 Apr 2015 05:00:35 GMT
>> *Content-Type: application/octet-stream*
>>^
>>^
>>
> Well, compare the Content-Type of the file you are returning with the
> types specified in your config:
>
>
> *compression type text/html text/plain text/javascript
> application/javascript application/xml text/css*
> it is not on the list is it ???
>
> Content-Length: 16384
>> Last-Modified: Wed, 08 Apr 2015 04:45:12 GMT
>> ETag: "5524b258-4000"
>> Accept-Ranges: bytes
>>
>> 100 16384  100 163840 0  4274k  0 --:--:-- --:--:-- --:--:--
>> 5333k
>>
>> My configuration file has these parameters:
>>
>> 
>> compression algo gzip
>> *compression type text/html text/plain text/javascript
>> application/javascript application/xml text/css*
>> server nginx-1 192.168.122.101:80 maxconn 15000 check
>> server nginx-2 192.168.122.102:80 maxconn 15000 check
>> .
>> ..
>>
>> Tcpdump at the proxy shows:
>>
>> GET /TEXT_16K HTTP/1.1
>> User-Agent: curl/7.26.0
>> Host: 192.168.122.110
>> Accept: */*
>> Accept-Encoding: gzip
>> X-Forwarded-For: 192.168.122.1
>>
>>
>> HTTP/1.1 200 OK
>> Server: nginx/1.6.2
>> Date: Wed, 08 Apr 2015 05:25:09 GMT
>> Content-Type: application/octet-stream
>> Content-Length: 16384
>> Last-Modified: Wed, 08 Apr 2015 04:28:01 GMT
>> Connection: keep-alive
>> ETag: "5524ae51-4000"
>> Accept-Ranges: bytes
>>
>> HTTP/1.1 200 OK
>> Server: nginx/1.6.2
>> Date: Wed, 08 Apr 2015 05:25:09 GMT
>> Content-Type: application/octet-stream
>> Content-Length: 16384
>> Last-Modified: Wed, 08 Apr 2015 04:28:01 GMT
>> Connection: keep-alive
>> ETag: "5524ae51-4000"
>> Accept-Ranges: bytes
>>
>> haproxy build info:
>> HA-Proxy version 1.5.8 2014/10/31
>> Copyright 2000-2014 Willy Tarreau 
>>
>> Build options :
>>   TARGET  = linux2628
>>   CPU = generic
>>   CC  = gcc
>>   CFLAGS  = -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat
>> -Werror=format-security -D_FORTIFY_SOURCE=2
>>   OPTIONS = USE_ZLIB=1 USE_OPENSSL=1 USE_PCRE=1
>>
>> Default settings :
>>   maxconn = 2000, bufsize = 16384, maxrewrite = 8192, maxpollevents = 200
>>
>> Encrypted password support via crypt(3): yes
>> Built with zlib version : 1.2.7
>> Compression algorithms supported : identity, deflate, gzip
>> Built with OpenSSL version : OpenSSL 1.0.1e 11 Feb 2013
>> Running on OpenSSL version : OpenSSL 1.0.1e 11 Feb 2013
>> OpenSSL library supports TLS extensions : yes
>> OpenSSL library supports SNI : yes
>> OpenSSL library supports prefer-server-ciphers : yes
>> Built with PCRE version : 8.30 2012-02-04
>> PCRE library supports JIT : no (USE_PCRE_JIT not set)
>> Built with transparent proxy support using: IP_TRANSPARENT
>> IPV6_TRANSPARENT IP_FREEBIND
>>
>> Available polling systems :
>>   epoll : pref=300,  test result OK
>>poll : pref=200,  test result OK
>>  select : pref=150,  test result OK
>> Total: 3 (3 usable), will use epoll.
>>
>> How can I fix this? Thanks for any help,
>>
>> Regards,
>> - KK
>>
>
>
>
> --
> Igor Cicimov | DevOps
>
>
> p. +61 (0) 433 078 728
> e. ig...@encompasscorporation.com 
> w*.* encompasscorporation.com
> a. Level 4, 65 York Street, Sydney 2000
>