]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[MINOR] move the initial task's nice value to the listener
authorWilly Tarreau <w@1wt.eu>
Sun, 16 Aug 2009 17:12:36 +0000 (19:12 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 16 Aug 2009 17:36:56 +0000 (19:36 +0200)
Since the listener is the one indicating what analyser and session
handlers to call, it makes sense that it also sets the task's nice
value. This also helps getting rid of the last trace of the stats
in the proto_uxst file.

include/types/protocols.h
src/client.c
src/dumpstats.c
src/proto_uxst.c

index 0b4b7123a620414240c27efb0e018066191ab710..9247ef16ed86760d812fe3f693fda32308a0bafa 100644 (file)
@@ -2,7 +2,7 @@
   include/types/protocols.h
   This file defines the structures used by generic network protocols.
 
-  Copyright (C) 2000-2008 Willy Tarreau - w@1wt.eu
+  Copyright (C) 2000-2009 Willy Tarreau - w@1wt.eu
 
   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
@@ -90,6 +90,7 @@ struct listener {
        int  *timeout;                  /* pointer to client-side timeout */
        void *private;                  /* any private data which may be used by accept() */
        unsigned int analysers;         /* bitmap of required protocol analysers */
+       int nice;                       /* nice value to assign to the instanciated tasks */
        union {                         /* protocol-dependant access restrictions */
                struct {                /* UNIX socket permissions */
                        uid_t uid;      /* -1 to leave unchanged */
index 93bd8946a2338896d9370408d0b5d8d7fb1377cb..b2e7d782a30cfdbce93b18e68fd90eba165e487d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Client-side variables and functions.
  *
- * Copyright 2000-2008 Willy Tarreau <w@1wt.eu>
+ * Copyright 2000-2009 Willy Tarreau <w@1wt.eu>
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -173,6 +173,7 @@ int event_accept(int fd) {
 
                t->process = l->handler;
                t->context = s;
+               t->nice = l->nice;
 
                s->task = t;
                s->listener = l;
index 91c90e9226caed8f528a79028462b3278d7b1f40..24aab05946e9425dc20975dd022c20e414795849 100644 (file)
@@ -121,6 +121,7 @@ static int stats_parse_global(char **args, int section_type, struct proxy *curpx
                global.stats_sock.accept = uxst_event_accept;
                global.stats_sock.handler = process_session;
                global.stats_sock.analysers = AN_REQ_STATS_SOCK;
+               global.stats_sock.nice = -64;  /* we want to boost priority for local stats */
                global.stats_sock.private = global.stats_fe; /* must point to the frontend */
 
                global.stats_fe->timeout.client = MS_TO_TICKS(10000); /* default timeout of 10 seconds */
index 5078369798655dea7a2b30b745eb0ecc543b336b..880ec993a7d021ccc09b261d5ecab1bc9843f07d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * UNIX SOCK_STREAM protocol layer (uxst)
  *
- * Copyright 2000-2008 Willy Tarreau <w@1wt.eu>
+ * Copyright 2000-2009 Willy Tarreau <w@1wt.eu>
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -432,7 +432,7 @@ int uxst_event_accept(int fd) {
 
                t->process = l->handler;
                t->context = s;
-               t->nice = -64;  /* we want to boost priority for local stats */
+               t->nice = l->nice;
 
                s->task = t;
                s->listener = l;