diff options
| -rw-r--r-- | src/backend/utils/misc/guc.c | 8 | ||||
| -rw-r--r-- | src/include/pgxc/squeue.h | 4 |
2 files changed, 7 insertions, 5 deletions
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index d24a5a4e99..2a595fb336 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -2941,7 +2941,8 @@ static struct config_int ConfigureNamesInt[] = */ { {"shared_queues", PGC_POSTMASTER, RESOURCES_MEM, - gettext_noop("Sets the number of shared memory queues used by the distributed executor."), + gettext_noop("Sets the number of shared memory queues used by the " + "distributed executor, minimum 1/4 of max_connections."), NULL }, &NSQueues, @@ -2951,12 +2952,13 @@ static struct config_int ConfigureNamesInt[] = { {"shared_queue_size", PGC_POSTMASTER, RESOURCES_MEM, - gettext_noop("Sets the amount of memory allocated for a shared memory queue."), + gettext_noop("Sets the amount of memory allocated for a shared" + " memory queue per datanode."), NULL, GUC_UNIT_KB }, &SQueueSize, - 64, 1, MAX_KILOBYTES, + 32, 1, MAX_KILOBYTES, NULL, NULL, NULL }, diff --git a/src/include/pgxc/squeue.h b/src/include/pgxc/squeue.h index c0a9807e43..5d5e7136bd 100644 --- a/src/include/pgxc/squeue.h +++ b/src/include/pgxc/squeue.h @@ -25,9 +25,9 @@ extern PGDLLIMPORT int NSQueues; extern PGDLLIMPORT int SQueueSize; /* Fixed size of shared queue, maybe need to be GUC configurable */ -#define SQUEUE_SIZE ((long) SQueueSize * 1024L) +#define SQUEUE_SIZE ((long) SQueueSize * MaxDataNodes * 1024L) /* Number of shared queues, maybe need to be GUC configurable */ -#define NUM_SQUEUES ((long) NSQueues) +#define NUM_SQUEUES Max((long) NSQueues, MaxConnections / 4) #define SQUEUE_KEYSIZE (64) |
