]> granicus.if.org Git - postgresql/commit
Inherit max_safe_fds to child processes in EXEC_BACKEND mode.
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Thu, 29 Mar 2012 05:19:11 +0000 (08:19 +0300)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Thu, 29 Mar 2012 05:19:11 +0000 (08:19 +0300)
commit5762a4d9098ac0cba789ddd26286ac85c2d316f2
tree4a7343130d752fd2145d301a6ba9d81691f66a4a
parentd2c1740dc275543a46721ed254ba3623f63d2204
Inherit max_safe_fds to child processes in EXEC_BACKEND mode.

Postmaster sets max_safe_fds by testing how many open file descriptors it
can open, and that is normally inherited by all child processes at fork().
Not so on EXEC_BACKEND, ie. Windows, however. Because of that, we
effectively ignored max_files_per_process on Windows, and always assumed
a conservative default of 32 simultaneous open files. That could have an
impact on performance, if you need to access a lot of different files
in a query. After this patch, the value is passed to child processes by
save/restore_backend_variables() among many other global variables.

It has been like this forever, but given the lack of complaints about it,
I'm not backpatching this.
src/backend/postmaster/postmaster.c
src/backend/storage/file/fd.c
src/include/storage/fd.h