rpc: Don't warn about "max_client_requests" in single-threaded daemons

The warning about max_client_requests is hit inside virtlogd every time
a VM starts which spams the logs.

Emit the warning only when the client request limit is not 1 and add a
warning into the daemon config to not configure it too low instead.

Fixes: 031878c236
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2145188
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Peter Krempa 2023-02-15 10:48:31 +01:00
parent 761cb8a087
commit b3f8e072fe
2 changed files with 3 additions and 1 deletions

View File

@ -374,6 +374,7 @@
# connection. To avoid one client monopolizing the server
# this should be a small fraction of the global max_workers
# parameter.
# Setting this too low may cause keepalive timeouts.
#max_client_requests = 5
# Same processing controls, but this time for the admin interface.

View File

@ -1261,7 +1261,8 @@ static virNetMessage *virNetServerClientDispatchRead(virNetServerClient *client)
client->rx->bufferLength = VIR_NET_MESSAGE_LEN_MAX;
client->rx->buffer = g_new0(char, client->rx->bufferLength);
client->nrequests++;
} else if (!client->nrequests_warning) {
} else if (!client->nrequests_warning &&
client->nrequests_max > 1) {
client->nrequests_warning = true;
VIR_WARN("Client hit max requests limit %zd. This may result "
"in keep-alive timeouts. Consider tuning the "