[MINOR] move the initial task's nice value to the listener

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.
This commit is contained in:
Willy Tarreau 2009-08-16 19:12:36 +02:00
parent 5ca791da8d
commit 2c9f5b130f
4 changed files with 7 additions and 4 deletions

View 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 */

View 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;

View 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 */

View 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;