aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/backend/storage/aio/read_stream.c7
-rw-r--r--src/backend/utils/misc/postgresql.conf.sample4
-rw-r--r--src/include/port/pg_iovec.h8
3 files changed, 12 insertions, 7 deletions
diff --git a/src/backend/storage/aio/read_stream.c b/src/backend/storage/aio/read_stream.c
index d65fa07b44c..45bdf819d57 100644
--- a/src/backend/storage/aio/read_stream.c
+++ b/src/backend/storage/aio/read_stream.c
@@ -515,9 +515,10 @@ read_stream_begin_impl(int flags,
* finishes we don't want to have to wait for its buffers to be consumed
* before starting a new one.
*
- * Be careful not to allow int16 to overflow (even though that's not
- * possible with the current GUC range limits), allowing also for the
- * spare entry and the overflow space.
+ * Be careful not to allow int16 to overflow. That is possible with the
+ * current GUC range limits, so this is an artificial limit of ~32k
+ * buffers and we'd need to adjust the types to exceed that. We also have
+ * to allow for the spare entry and the overflow space.
*/
max_pinned_buffers = (max_ios + 1) * io_combine_limit;
max_pinned_buffers = Min(max_pinned_buffers,
diff --git a/src/backend/utils/misc/postgresql.conf.sample b/src/backend/utils/misc/postgresql.conf.sample
index 66bda60f4ca..6abd1baeac8 100644
--- a/src/backend/utils/misc/postgresql.conf.sample
+++ b/src/backend/utils/misc/postgresql.conf.sample
@@ -200,9 +200,9 @@
#backend_flush_after = 0 # measured in pages, 0 disables
#effective_io_concurrency = 16 # 1-1000; 0 disables prefetching
#maintenance_io_concurrency = 16 # 1-1000; 0 disables prefetching
-#io_max_combine_limit = 128kB # usually 1-32 blocks (depends on OS)
+#io_max_combine_limit = 128kB # usually 1-128 blocks (depends on OS)
# (change requires restart)
-#io_combine_limit = 128kB # usually 1-32 blocks (depends on OS)
+#io_combine_limit = 128kB # usually 1-128 blocks (depends on OS)
#io_method = worker # worker, sync (change requires restart)
#io_max_concurrency = -1 # Max number of IOs that one process
diff --git a/src/include/port/pg_iovec.h b/src/include/port/pg_iovec.h
index d9891d3805d..df40c7208be 100644
--- a/src/include/port/pg_iovec.h
+++ b/src/include/port/pg_iovec.h
@@ -33,8 +33,12 @@ struct iovec
#endif
-/* Define a reasonable maximum that is safe to use on the stack. */
-#define PG_IOV_MAX Min(IOV_MAX, 32)
+/*
+ * Define a reasonable maximum that is safe to use on the stack in arrays of
+ * struct iovec and other small types. The operating system could limit us to
+ * a number as low as 16, but most systems have 1024.
+ */
+#define PG_IOV_MAX Min(IOV_MAX, 128)
/*
* Like preadv(), but with a prefix to remind us of a side-effect: on Windows