]> granicus.if.org Git - postgresql/commitdiff
Allow setting effective_io_concurrency even on unsupported systems
authorPeter Eisentraut <peter_e@gmx.net>
Sun, 19 Oct 2014 01:35:46 +0000 (21:35 -0400)
committerPeter Eisentraut <peter_e@gmx.net>
Sun, 19 Oct 2014 01:35:46 +0000 (21:35 -0400)
This matches the behavior of other parameters that are unsupported on
some systems (e.g., ssl).

Also document the default value.

doc/src/sgml/config.sgml
src/backend/utils/misc/guc.c
src/bin/initdb/initdb.c

index 6ee17d847723e1fc4d917b7a60a43b7dee51c2b1..47b11922455efb599bf3a528692add0715c2dcdb 100644 (file)
@@ -1892,6 +1892,10 @@ include_dir 'conf.d'
          in an error.  On some operating systems (e.g., Solaris), the function
          is present but does not actually do anything.
         </para>
+
+        <para>
+         The default is 1 on supported systems, otherwise 0.
+        </para>
        </listitem>
       </varlistentry>
 
index dca533ac916fd843715d7784e38a5ac1065083bb..d7142d218dce40e336154f464ac1d775ae148da7 100644 (file)
@@ -2258,11 +2258,7 @@ static struct config_int ConfigureNamesInt[] =
 
        {
                {"effective_io_concurrency",
-#ifdef USE_PREFETCH
                        PGC_USERSET,
-#else
-                       PGC_INTERNAL,
-#endif
                        RESOURCES_ASYNCHRONOUS,
                        gettext_noop("Number of simultaneous requests that can be handled efficiently by the disk subsystem."),
                        gettext_noop("For RAID arrays, this should be approximately the number of drive spindles in the array.")
index c8ff2cbc7bc493d64b8907538f58ab6629201a79..e6c9e480d3396eadb3d65a6befc94746ada4ae0e 100644 (file)
@@ -1288,6 +1288,12 @@ setup_config(void)
        conflines = replace_token(conflines, "#dynamic_shared_memory_type = posix",
                                                          repltok);
 
+#if !USE_PREFETCH
+       conflines = replace_token(conflines,
+                                                         "#effective_io_concurrency = 1",
+                                                         "#effective_io_concurrency = 0");
+#endif
+
        snprintf(path, sizeof(path), "%s/postgresql.conf", pg_data);
 
        writefile(path, conflines);