Skip to content

Commit ff24ff7

Browse files
committed
interconnect: increase UDP unack queue size and fix mem size unit handling
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 882fbf2 commit ff24ff7

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
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 (12)
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 (12)
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);

src/backend/utils/misc/guc_gp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3788,7 +3788,7 @@ struct config_int ConfigureNamesInt_gp[] =
37883788
NULL
37893789
},
37903790
&Gp_interconnect_mem_size,
3791-
10, 1, 1024,
3791+
1, 1, 1024,
37923792
NULL, NULL, NULL
37933793
},
37943794

0 commit comments

Comments
 (0)