HAProxy ratelimit based on bandwidth

2021-01-25 Thread Sangameshwar Babu
Hello Team, I would like to get some suggestions on setting up ratelimit on HAProxy 1.8 version, my current setup is as below. 1000+ rsyslog clients(TCP) > HAProxy (TCP mode)> backend centralized rsyslog server. I have the below stick table and acl's through which I am able to ma

Re: [PATCH] MINOR: abort() on my_unreachable() when DEBUG_USE_ABORT is set.

2021-01-25 Thread Илья Шипицин
there's another one not reported coverity finding in src/hlua.c I tried to suppress it by adding DEFINE=-DDEBUG_USE_ABORT to coverity build (please notice BUG_ON(...) which is not recognized by coverity). but I did something wrong and it did not help :) 4155lua_settable(L, -3); 4156 4157

[PATCH] MINOR: abort() on my_unreachable() when DEBUG_USE_ABORT is set.

2021-01-25 Thread Tim Duesterhus
Hopefully this helps static analysis tools detecting that the code after that call is unreachable. See GitHub Issue #1075. --- include/haproxy/compiler.h | 4 1 file changed, 4 insertions(+) diff --git a/include/haproxy/compiler.h b/include/haproxy/compiler.h index e5fae3e27..fba6dc358 1006

[PATCH v2 3/4] MEDIUM: stats: allow to select one field in `stats_fill_sv_stats`

2021-01-25 Thread William Dauchy
prometheus approach requires to output all values for a given metric name; meaning we iterate through all metrics, and then iterate in the inner loop on all objects for this metric. In order to allow more code reuse, adapt the stats API to be able to select one field or fill them all otherwise. Thi

[PATCH v2 2/4] MINOR: contrib/prometheus-exporter: use fill_be_stats for backend dump

2021-01-25 Thread William Dauchy
use `stats_fill_be_stats` when possible to avoid duplicating code; make use of field selector to get the needed field only. the only difference is on `haproxy_backend_downtime_seconds_total` as stats.c is testing `px->srv`. This behaviour is present since commit 7344f4789321ef8ce2ce17cf73dabd672f7

[PATCH v2 4/4] MINOR: contrib/prometheus-exporter: use fill_sv_stats for server dump

2021-01-25 Thread William Dauchy
use `stats_fill_sv_stats` when possible to avoid duplicating code. the following metrics have a change of behaviour: haproxy_server_limit_sessions haproxy_server_queue_limit haproxy_server_check_failures_total haproxy_server_check_up_down_total haproxy_server_downtime_seconds_total haproxy_server

[PATCH v2 1/4] MEDIUM: stats: allow to select one field in `stats_fill_be_stats`

2021-01-25 Thread William Dauchy
prometheus approach requires to output all values for a given metric name; meaning we iterate through all metrics, and then iterate in the inner loop on all objects for this metric. In order to allow more code reuse, adapt the stats API to be able to select one field or fill them all otherwise. Thi

Re: [PATCH 5/6] MEDIUM: stats: allow to select one field in `stats_fill_sv_stats`

2021-01-25 Thread William Dauchy
Hello Christopher, Thanks for the review. On Mon, Jan 25, 2021 at 4:33 PM Christopher Faulet wrote: > The "via" parameter is unused. No reason to pass it. good catch. surprised gcc did not triggered it fixed in v2 > Same comment than for stats_fill_b_stats. The metric variable must be > initi

Re: [PATCH 3/6] MEDIUM: stats: allow to select one field in `stats_fill_be_stats`

2021-01-25 Thread William Dauchy
Hi Christopher, Thanks for the review. On Mon, Jan 25, 2021 at 4:26 PM Christopher Faulet wrote: > Here, you must take care to increment "*nbup" and "*nbsrv" in the for loop. > But > changing it this way gcc then complains these variables are now unused. Thus > to > make it happy, I must use l

Re: [PATCH 5/6] MEDIUM: stats: allow to select one field in `stats_fill_sv_stats`

2021-01-25 Thread Christopher Faulet
Le 22/01/2021 à 21:09, William Dauchy a écrit : prometheus approach requires to output all values for a given metric name; meaning we iterate through all metrics, and then iterate in the inner loop on all objects for this metric. In order to allow more code reuse, adapt the stats API to be able t

Re: [PATCH 3/6] MEDIUM: stats: allow to select one field in `stats_fill_be_stats`

2021-01-25 Thread Christopher Faulet
Le 22/01/2021 à 21:09, William Dauchy a écrit : prometheus approach requires to output all values for a given metric name; meaning we iterate through all metrics, and then iterate in the inner loop on all objects for this metric. In order to allow more code reuse, adapt the stats API to be able t

Re: [PATCH 2/6] CLEANUP: stats: improve field selection for frontend http fields

2021-01-25 Thread Christopher Faulet
Le 22/01/2021 à 21:09, William Dauchy a écrit : while working on backend/servers I realised I could have written that in a better way and avoid one extra break. This is slightly improving readiness. also while being here, fix function declaration which was not 100% accurate. this patch does not

Re: [PATCH 1/6] MINOR: contrib/prometheus-exporter: better output of Not-a-Number

2021-01-25 Thread Christopher Faulet
Le 22/01/2021 à 21:09, William Dauchy a écrit : Not necessarily mandatory but I saw a few prometheus client parsing only `NaN`. Also most librarries do output `NaN` Signed-off-by: William Dauchy --- contrib/prometheus-exporter/service-prometheus.c | 8 1 file changed, 4 insertions(+