Health check of Redis only uses redis_version field in server section, however, info command without any section is used so that all sections of information of Redis will be returned. The size of responded result can be up to 3.5KB for each query. If health check interval is set low like 2 seconds, decoding/processing the result may cost unnecessary CPU time.

SpringBoot Redis health indicator requests more information than it needs resulting in unnecessarily large responses from Redis

This PR adds section argument server of info command for reducing sections to be queried.

Comment From: snicoll

Thanks for the PR.

Regardless of the outcome of this issue, a call to info should not lead to this so please consider reporting that against the Redisson project.

See also https://redis.io/commands/info

Comment From: snicoll

I find a little odd that we have to hardcode "server" in that method call there. Checking with @mp911de, this API was built to give maximum flexibility if Redis decided to change something. Mark is open to an update of the API to take also a Enum with the well-known command. Before proceeding, I'd like to see what the rest of the team thinks about hardcoding "server" there.

Comment From: wilkinsona

Given that server is documented as an input for the INFO command, hardcoding it seems fine to me. An enum of String constant would be an improvement, but in their absence I see no reason not to use the existing info(String) API with a hard-coded server argument.

Comment From: xJoeWoo

Thanks for the PR.

Regardless of the outcome of this issue, a call to info should not lead to this so please consider reporting that against the Redisson project.

See also https://redis.io/commands/info

It's my pleasure to make Spring Boot better.

Yes, I've made another PR for improving decoding performance in Redisson. Furthermore, reducing queried result size from source would be a better solution and make benefit to all Redis libraries.

Comment From: philwebb

I agree with @wilkinsona. I' wondering where we should target this one. Do we consider it a bug?

Comment From: snicoll

I was about to ask that, believe it or not. I think this can be considered as such and targeted to 2.2.x.

Comment From: snicoll

@xJoeWoo thank you for making your first contribution to Spring Boot. It has been applied to 2.2.x, 2.3.x and master.