Description: php-fpm workers setproctitle When a php-fpm worker becomes busy, it will show "busy" in its process title, and "idle" if not. Author: Chris Danis Forwarded: no Last-Update: 2020-05-12 --- This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ --- a/sapi/fpm/fpm/fpm_request.c +++ b/sapi/fpm/fpm/fpm_request.c @@ -19,6 +19,7 @@ #include "fpm_status.h" #include "fpm_request.h" #include "fpm_log.h" +#include "fpm_env.h" #include "zlog.h" @@ -54,6 +55,13 @@ void fpm_request_accepting() /* {{{ */ /* idle++, active-- */ fpm_scoreboard_update(1, -1, 0, 0, 0, 0, 0, FPM_SCOREBOARD_ACTION_INC, NULL); + + struct fpm_scoreboard_s *scoreboard; + scoreboard = fpm_scoreboard_get(); + char *title; + spprintf(&title, 0, "pool %s: idle", scoreboard->pool); + fpm_env_setproctitle(title); + efree(title); } /* }}} */ @@ -97,6 +105,13 @@ void fpm_request_reading_headers() /* {{ /* idle--, active++, request++ */ fpm_scoreboard_update(-1, 1, 0, 0, 1, 0, 0, FPM_SCOREBOARD_ACTION_INC, NULL); + + struct fpm_scoreboard_s *scoreboard; + scoreboard = fpm_scoreboard_get(); + char *title; + spprintf(&title, 0, "pool %s: busy", scoreboard->pool); + fpm_env_setproctitle(title); + efree(title); } /* }}} */