]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: checks: don't needlessly take the server lock in health_adjust()
authorWilly Tarreau <w@1wt.eu>
Wed, 17 Feb 2021 14:20:19 +0000 (15:20 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 18 Feb 2021 09:06:45 +0000 (10:06 +0100)
commit4e9df2737dde3f6d1d171fa17e2594c4c765c00c
tree7ea9ffc4f42e67c84618854a0091c18665dc1c12
parent64ba5ebadcd5d98e00989d08dfaa3c94c15196c9
BUG/MEDIUM: checks: don't needlessly take the server lock in health_adjust()

The server lock was taken preventively for anything in health_adjust(),
including the static config checks needed to detect that the lock was not
needed, while the function is always called on the response path to update
a server's status. This was responsible for huge contention causing a
performance drop of about 17% on 16 threads. Let's move the lock only
where it should be, i.e. inside the function around the critical sections
only. By doing this, a 16-thread process jumped back from 575 to 675 krps.

This should be backported to 2.3 as the situation degraded there, and
maybe later to 2.2.
include/haproxy/check.h
src/check.c