Merge pull request #1814 from lonvia/disable-jit

Disable JIT and parallel workers when indexing
This commit is contained in:
Sarah Hoffmann 2020-06-01 22:13:07 +02:00 committed by GitHub
commit 3661c75b39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 6 deletions

View File

@ -36,8 +36,8 @@ For compiling:
For running Nominatim:
* [PostgreSQL](https://www.postgresql.org) (9.3 - 11)
* [PostGIS](https://postgis.org) (2.2 - 2.5)
* [PostgreSQL](https://www.postgresql.org) (9.3+)
* [PostGIS](https://postgis.org) (2.2+)
* [Python 3](https://www.python.org/)
* [Psycopg2](https://initd.org/psycopg)
* [PHP](https://php.net) (7.0 or later)
@ -45,10 +45,6 @@ For running Nominatim:
* PHP-intl (bundled with PHP)
* a webserver (apache or nginx are recommended)
!!! danger "Important"
Postgresql 12+ and Postgis 3.0+ are known to cause performance issues. They are
not recommended for a production installation at the moment.
For running continuous updates:
* [pyosmium](https://osmcode.org/pyosmium/) (with Python 3)

View File

@ -124,6 +124,15 @@ class DBConnection(object):
self.wait()
self.cursor = self.conn.cursor()
# Disable JIT and parallel workers as they are known to cause problems.
# Update pg_settings instead of using SET because it does not yield
# errors on older versions of Postgres where the settings are not
# implemented.
self.perform(
""" UPDATE pg_settings SET setting = -1 WHERE name = 'jit_above_cost';
UPDATE pg_settings SET setting = 0
WHERE name = 'max_parallel_workers_per_gather';""")
self.wait()
def wait(self):
""" Block until any pending operation is done.