# HG changeset patch # User Alain Mazy # Date 1707407195 -3600 # Node ID bbcec5f44c34e03cdfcf15c1876b39c69f2864a2 # Parent f3f320632887dfff0fc59cada10a1844d0412219 PG 6.0 diff -r f3f320632887 -r bbcec5f44c34 Sphinx/source/faq/scalability.rst --- a/Sphinx/source/faq/scalability.rst Fri Feb 02 16:37:54 2024 +0100 +++ b/Sphinx/source/faq/scalability.rst Thu Feb 08 16:46:35 2024 +0100 @@ -100,7 +100,7 @@ * Since Orthanc 1.9.2 and PostgreSQL plugins 4.0: By default, the PostgreSQL index plugin uses 1 single connection to the PostgreSQL database. You can have multiple connections by setting the - ``IndexConnectionsCount`` to a higher value (for instance ``5``) in + ``IndexConnectionsCount`` to a higher value (for instance ``50`` or one per HTTP thread) in the ``PostgreSQL`` section of the configuration file. This will improve concurrency. Check out :ref:`the explanation below `. @@ -111,6 +111,10 @@ ingesting of DICOM instances, and multiple "reader" Orthanc servers with features such as DICOMweb or viewers. +* Since Orthanc 1.12.3 and PostgreSQL plugins 6.0: You may enable + the ``ReadCommitted`` transaction mode to allow multiple threads to + write in DB at the same time. + * From Orthanc 1.11.0: you have the ability to add more :ref:`main DICOM tags ` in the Orthanc Index to speed up C-Find, ``tools/find``, DICOMWeb QIDO-RS, WADO-RS and diff -r f3f320632887 -r bbcec5f44c34 Sphinx/source/plugins/postgresql.rst --- a/Sphinx/source/plugins/postgresql.rst Fri Feb 02 16:37:54 2024 +0100 +++ b/Sphinx/source/plugins/postgresql.rst Thu Feb 08 16:46:35 2024 +0100 @@ -133,7 +133,8 @@ "MaximumConnectionRetries" : 10, // New in release 3.0 "ConnectionRetryInterval" : 5, // New in release 3.0 "IndexConnectionsCount" : 1, // New in release 4.0 - "TransactionMode": "SERIALIZABLE" // New in beta version (not released yet) + "TransactionMode": "Serializable", // New in release 6.0 + "EnableVerboseLogs": false // New in release 6.0 }, "Plugins" : [ "/home/user/orthanc-databases/BuildPostgreSQL/libOrthancPostgreSQLIndex.so", @@ -236,7 +237,9 @@ * ``MaximumConnectionRetries`` governs how many times Orthanc tries to connect to the database, as well as how many times Orthanc replays - transactions to deal with collisions between multiple writers. + transactions to deal with collisions between multiple writers in + ``Serializable`` transaction mode or with any transient transaction errors + in all transaction modes. * ``IndexConnectionsCount`` controls the number of connections from the index plugin to the PostgreSQL database. It is set to ``1`` by @@ -245,9 +248,9 @@ * ``ConnectionRetryInterval`` is only used when opening one database connection to PostgreSQL. -* ``TransactionMode`` has been added in the ``pg-transactions`` beta version only. 2 values are - allowed: ``SERIALIZABLE`` (that has always been the default mode for Orthanc) - and ``READ COMMITTED`` that is available only from this beta version. See +* ``TransactionMode`` has been added in the release 6.0. 2 values are + allowed: ``Serializable`` (that has always been the default mode for Orthanc) + and ``ReadCommitted`` that is available only from release 6.0. See below. * The PostgreSQL plugin supports the :ref:`revision mechanism @@ -316,34 +319,23 @@ When configuring your PostgreSQL plugin, ensure you've read the :ref:`scalability section ` -Transaction modes (``pg-transactions`` beta version only) -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Transaction modes (new in version 6.0) +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. highlight:: json -Starting from the current beta version, orthanc supports 2 transaction modes that +Starting from the release 6.0 of the plugin and Orthanc 1.12.3, orthanc supports 2 transaction modes that can be configured in the ``TransactionMode`` configuration of the ``PostgreSQL`` plugin: -- ``SERIALIZABLE`` in which all write transactions are serialized which might lead +- ``Serializable`` in which all write transactions are serialized which might lead to performance bottlenecks when lots of threads or Orthanc instances are trying to write to the same Database. -- ``READ COMMITTED`` that allows multiple threads or Orthanc instances to write at the +- ``ReadCommitted`` that allows multiple threads or Orthanc instances to write at the same time to the same Database. -*Remark:* This feature is only available in a beta version of both Orthanc and the -PostgreSQL plugin (``pg-transactions`` branches in the code). This beta version is -only available in the ``orthancteam/orthanc-pre-release:pg-transactions-unstable`` Docker image. -*Remark:* This beta version is really a beta version and **should not be used on a -production database**. It shall only be used on a DB that you can delete or recover. -The reason why it shall not be used on a production database is because this revision -modifies the DB schema to a :ref:`version `/revision ``6.2`` that might be different from the -final schema of the future release although it will share the same version/revision. -We can not guarantee to maintain migration scripts from this temporary schema to the final -one. - -Upgrades/Downgrades (``pg-transactions`` beta version only) -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Upgrades/Downgrades +^^^^^^^^^^^^^^^^^^^ New vesions of the PostgreSQL might modify the DB schema by adding new columns/tables/triggers. Upgrades from one revision to the other is always automatic. @@ -351,13 +343,13 @@ However, if, for some reasons, you would like to reinstall a previous plugin version, the older plugin might refuse to start because the revision is newer and unknown to it. -Starting from this beta version, we are providing a downgrade script in case you want, e.g, -to reinstall Orthanc 1.12.3 and PostgreSQL 5.1 (DB schema revision 6.1). +Starting from version 6.0 of the plugin, we are providing a downgrade script in case you want, e.g, +to reinstall Orthanc 1.12.3 and PostgreSQL 5.1 (whose DB schema is at revision 1). -To downgrade from the beta to the PostgreSQL 5.1, one might run this procedure:: +To downgrade from revision 2 to revision 1, one might run this procedure:: - $ wget https://orthanc.uclouvain.be/hg/orthanc-databases/raw-file/pg-transactions/PostgreSQL/Plugins/SQL/Downgrades/V6.2ToV6.1.sql - $ psql -U postgres -f V6.2ToV6.1.sql + $ wget https://orthanc.uclouvain.be/hg/orthanc-databases/raw-file/default/PostgreSQL/Plugins/SQL/Downgrades/Rev2ToRev1.sql + $ psql -U postgres -f Rev2ToRev1.sql Troubleshooting