I encountered a scenario where using the spop command with count on master resulted in high QPS on salve.

After analysis, it was found that the command was rewritten into multiple srem commands during synchronization. If the count is large, salve has to receive a large number of srem commands, leading to high QPS.

In my opinion, we can use the srem key member [member ...], so that it only needs to be rewritten as one command. Alternatively, we can set a threshold for the number of members in the srem command.

Comment From: madolson

This is probably a reasonable optimization. We're already accumulating the SREM commands into a multi-exec before submitting them to the replica, so there isn't a lot of reason to not just send a single SREM command.

Comment From: ztxiuyuan

This is probably a reasonable optimization. We're already accumulating the SREM commands into a multi-exec before submitting them to the replica, so there isn't a lot of reason to not just send a single SREM command.

Do you think it should be rewrite as a single SREM command or set a threshold?