summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorTom Lane1999-02-21 01:41:55 +0000
committerTom Lane1999-02-21 01:41:55 +0000
commit9d197856dd5eda5cf85b15e564ae09ef8fef0e9e (patch)
treeac85492fb01823aeb836e54f5e5511366346f418 /src/include
parent75cccd0ad3184e3fa283f407c765520d3c774c86 (diff)
Rearrange handling of MAXBACKENDS a little bit. The default setting
of MAXBACKENDS is now 1024, since all it's costing is about 32 bytes of memory per array slot. configure's --with-maxbackends switch now controls DEF_MAXBACKENDS which is simply the default value of the postmaster's -N switch. Thus, the out-of-the-box configuration will still limit you to 64 backends, but you can go up to 1024 backends simply by restarting the postmaster with a different -N switch --- no rebuild required.
Diffstat (limited to 'src/include')
-rw-r--r--src/include/config.h.in11
-rw-r--r--src/include/storage/ipc.h3
-rw-r--r--src/include/storage/lock.h10
3 files changed, 15 insertions, 9 deletions
diff --git a/src/include/config.h.in b/src/include/config.h.in
index ad277bd001..07e48851ff 100644
--- a/src/include/config.h.in
+++ b/src/include/config.h.in
@@ -9,10 +9,17 @@
#define CONFIG_H
/*
- * Maximum number of backend server processes per postmaster.
+ * Default runtime limit on number of backend server processes per postmaster;
+ * this is just the default setting for the postmaster's -N switch.
* (Actual value is set by configure script.)
*/
-#undef MAXBACKENDS
+#undef DEF_MAXBACKENDS
+
+/*
+ * Hard limit on number of backend server processes per postmaster.
+ * Increasing this costs about 32 bytes per process slot as of v 6.5.
+ */
+#define MAXBACKENDS (DEF_MAXBACKENDS > 1024 ? DEF_MAXBACKENDS : 1024)
/*
* Size of a disk block --- currently, this limits the size of a tuple.
diff --git a/src/include/storage/ipc.h b/src/include/storage/ipc.h
index 76a11e5b13..e9a96c8190 100644
--- a/src/include/storage/ipc.h
+++ b/src/include/storage/ipc.h
@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: ipc.h,v 1.33 1999/02/19 06:06:33 tgl Exp $
+ * $Id: ipc.h,v 1.34 1999/02/21 01:41:47 tgl Exp $
*
* NOTES
* This file is very architecture-specific. This stuff should actually
@@ -96,7 +96,6 @@ extern void AttachSLockMemory(IPCKey key);
#ifdef HAS_TEST_AND_SET
-#define NSLOCKS 2048
#define NOLOCK 0
#define SHAREDLOCK 1
#define EXCLUSIVELOCK 2
diff --git a/src/include/storage/lock.h b/src/include/storage/lock.h
index 85af296a5b..ce1f30133f 100644
--- a/src/include/storage/lock.h
+++ b/src/include/storage/lock.h
@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: lock.h,v 1.22 1999/02/19 06:06:35 tgl Exp $
+ * $Id: lock.h,v 1.23 1999/02/21 01:41:47 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -28,14 +28,14 @@ typedef int MASK;
/* ----------------------
* The following defines are used to estimate how much shared
* memory the lock manager is going to require.
+ * See LockShmemSize() in lock.c.
*
- * MAXBACKENDS - The max number of concurrently running backends (config.h)
* NLOCKS_PER_XACT - The number of unique locks acquired in a transaction
* NLOCKENTS - The maximum number of lock entries in the lock table.
* ----------------------
*/
-#define NLOCKS_PER_XACT 40
-#define NLOCKENTS (NLOCKS_PER_XACT*MAXBACKENDS)
+#define NLOCKS_PER_XACT 40
+#define NLOCKENTS(maxBackends) (NLOCKS_PER_XACT*(maxBackends))
typedef int LOCKMODE;
typedef int LOCKMETHOD;
@@ -242,7 +242,7 @@ extern bool LockRelease(LOCKMETHOD lockmethod, LOCKTAG *locktag,
LOCKMODE lockmode);
extern void GrantLock(LOCK *lock, LOCKMODE lockmode);
extern bool LockReleaseAll(LOCKMETHOD lockmethod, SHM_QUEUE *lockQueue);
-extern int LockShmemSize(void);
+extern int LockShmemSize(int maxBackends);
extern bool LockingDisabled(void);
extern bool DeadLockCheck(SHM_QUEUE *lockQueue, LOCK *findlock,
bool skip_check);