Skip to content

Commit ad59772

Browse files
committed
interconnect: increase UDP unack queue size and fix mem size unit handling
Increase MAX_QUEUE_SIZE from 64 to 128 to allow a larger unacknowledged packet window in UDP interconnect, reducing stalls under high-latency or bursty workloads. Fix calculation of per-queue capacity in SetupUDPIFCInterconnect by properly converting gp_interconnect_mem_size from MB to bytes. Without this conversion, the derived send queue depth could be severely underestimated, leading to suboptimal throughput.
1 parent a042ccc commit ad59772

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

contrib/interconnect/udp/ic_udpifc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ static ICGlobalControlInfo ic_control_info;
595595

596596
#define MAX_SEQS_IN_DISORDER_ACK (4)
597597

598-
#define MAX_QUEUE_SIZE (64)
598+
#define MAX_QUEUE_SIZE (128)
599599
/*
600600
* UnackQueueRing
601601
*
@@ -3753,7 +3753,7 @@ SetupUDPIFCInterconnect(EState *estate)
37533753
Gp_interconnect_queue_depth == 4 &&
37543754
Gp_interconnect_snd_queue_depth == 2)
37553755
{
3756-
int32 perQueue = Gp_interconnect_mem_size /
3756+
int32 perQueue = ((int64)Gp_interconnect_mem_size * 1024 * 1024) /
37573757
(Gp_max_packet_size * sliceNum);
37583758

37593759
calcSndDepth = Max(Gp_interconnect_snd_queue_depth, perQueue / 2);

contrib/udp2/ic_udp2.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
#include "ic_types.h"
4848
#include "udp2/ic_udp2.h"
4949

50-
#define MAX_QUEUE_SIZE (64)
50+
#define MAX_QUEUE_SIZE (128)
5151

5252
#define HandleLastError() \
5353
do { \
@@ -179,7 +179,7 @@ SetupInterconnectUDP2(EState *estate)
179179
Gp_interconnect_queue_depth == 4 &&
180180
Gp_interconnect_snd_queue_depth == 2)
181181
{
182-
int32 perQueue = Gp_interconnect_mem_size /
182+
int32 perQueue = ((int64)Gp_interconnect_mem_size * 1024 * 1024) /
183183
(Gp_max_packet_size * sliceNum);
184184

185185
calcSndDepth = Max(Gp_interconnect_snd_queue_depth, perQueue / 2);

0 commit comments

Comments
 (0)