Project

General

Profile

Bug #2882

fastcgi.balance not working

Added by taffff 15 days ago. Updated 4 days ago.

Status:
Patch Pending
Priority:
Normal
Assignee:
-
Category:
mod_fastcgi
Target version:
Start date:
2018-04-09
Due date:
% Done:

0%

Estimated time:
Missing in 1.5.x:

Description

when setting fastcgi.balance="round-robin" (or anything else than least-connection) and setting fastcgi.debug=1
i get logs saying i'm using least-connection proxy

2018-04-09 14:52:30: (gw_backend.c.1468) --- gw spawning local \n\tproc: /usr/lib/cgi-bin/httptime.fpl \n\tport: 0 \n\tsocket /var/run/lighttpd/httptime-30373.sock \n\tmin-procs: 2 \n\tmax-procs: 2
2018-04-09 14:52:30: (gw_backend.c.1492) --- gw spawning \n\tport: 0 \n\tsocket /var/run/lighttpd/httptime-30373.sock \n\tcurrent: 0 / 2
2018-04-09 14:52:30: (gw_backend.c.461) new proc, socket: 0 /var/run/lighttpd/httptime-30373.sock-0
2018-04-09 14:52:30: (gw_backend.c.1492) --- gw spawning \n\tport: 0 \n\tsocket /var/run/lighttpd/httptime-30373.sock \n\tcurrent: 1 / 2
2018-04-09 14:52:30: (gw_backend.c.461) new proc, socket: 0 /var/run/lighttpd/httptime-30373.sock-1
2018-04-09 14:52:30: (gw_backend.c.841) proxy - used least connection
2018-04-09 14:52:30: (gw_backend.c.933) gw - found a host 127.0.0.1 5000
2018-04-09 14:52:30: (gw_backend.c.841) proxy - used least connection
2018-04-09 14:52:30: (gw_backend.c.933) gw - found a host 127.0.0.1 5000
2018-04-09 14:52:30: (gw_backend.c.841) proxy - used least connection
2018-04-09 14:52:30: (gw_backend.c.933) gw - found a host 192.168.1.2 5000
2018-04-09 14:52:30: (gw_backend.c.841) proxy - used least connection
2018-04-09 14:52:30: (gw_backend.c.933) gw - found a host 192.168.1.2 5000
2018-04-09 14:52:30: (gw_backend.c.841) proxy - used least connection
2018-04-09 14:52:30: (gw_backend.c.933) gw - found a host 192.168.1.3 5000
2018-04-09 14:52:30: (gw_backend.c.841) proxy - used least connection
2018-04-09 14:52:30: (gw_backend.c.933) gw - found a host 192.168.1.3 5000
2018-04-09 14:52:30: (gw_backend.c.234) got proc: pid: 0 socket: tcp:127.0.0.1:5000 load: 1
2018-04-09 14:52:30: (gw_backend.c.234) got proc: pid: 0 socket: tcp:192.168.1.2:5000 load: 1
2018-04-09 14:52:30: (gw_backend.c.234) got proc: pid: 0 socket: tcp:192.168.1.3:5000 load: 1
2018-04-09 14:52:30: (gw_backend.c.308) released proc: pid: 0 socket: tcp:192.168.1.3:5000 load: 0
2018-04-09 14:52:30: (gw_backend.c.841) proxy - used least connection

when setting some other string to fastcgi.balance i receive correct error:
2018-04-09 14:33:15: (server.c.1423) server started (lighttpd/1.4.49 (PLD Linux))
2018-04-09 14:33:15: (gw_backend.c.1634) xxxxx.balance has to be one of: least-connection, round-robin, hash, sticky, but not: static
2018-04-09 14:33:15: (server.c.1431) Configuration of plugins failed. Going down.

konfff.conf (67.7 KB) konfff.conf taffff, 2018-04-09 12:31

History

#1

Updated by taffff 15 days ago

forgot to mention: using lighttpd/1.4.49

#2

Updated by taffff 15 days ago

Added config that was used to test this

#3

Updated by gstrauss 15 days ago

  • Status changed from New to Patch Pending
  • Target version changed from 1.4.x to 1.4.50

Thanks for your report. Looks like this was never merged into configs for mod_fastcgi. I have to make a similar patch to mod_scgi.

--- a/src/mod_fastcgi.c
+++ b/src/mod_fastcgi.c
@@ -463,6 +463,7 @@ static int fcgi_patch_connection(server *srv, connection *con, plugin_data *p) {
        PATCH(exts_auth);
        PATCH(exts_resp);
        PATCH(debug);
+       PATCH(balance);
        PATCH(ext_mapping);

        /* skip the first, the global context */
@@ -483,6 +484,8 @@ static int fcgi_patch_connection(server *srv, connection *con, plugin_data *p) {
                                PATCH(exts_resp);
                        } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("fastcgi.debug"))) {
                                PATCH(debug);
+                       } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("fastcgi.balance"))) {
+                               PATCH(balance);
                        } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("fastcgi.map-extensions"))) {
                                PATCH(ext_mapping);
                        }

Also available in: Atom