Skip to content

Commit 59bdcdf

Browse files
Increase max ConsumerWorkService block size to 256
As suggested in #813. This has a few minor effects on consumers: * A low single-digit % throughput gain * A comparable reduction in mean consumer latency In general, it makes sense that consumers operating at peak throughput should run operations in blocks close to the QoS prefetch used. Since we usually recommend a value of 100-300 for environments that focus on throughput, the new default of 256 makes sense. The only negative effect I can think of a slightly higher GC pressure which can increase variability of the aforementioned metrics.
1 parent cf8ccec commit 59bdcdf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/com/rabbitmq/client/impl/ConsumerWorkService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
final public class ConsumerWorkService {
2929
private static final Logger LOGGER = LoggerFactory.getLogger(ConsumerWorkService.class);
30-
private static final int MAX_RUNNABLE_BLOCK_SIZE = 16;
30+
private static final int MAX_RUNNABLE_BLOCK_SIZE = 256;
3131
private static final int DEFAULT_NUM_THREADS = Math.max(1, Utils.availableProcessors());
3232
private final ExecutorService executor;
3333
private final boolean privateExecutor;

0 commit comments

Comments
 (0)