We are using Orthanc for about two years now as a larger installation with 10 TB of data on Alma Linux with all binaries, including plugins, being compiled from source. For over half a year now I had an Orthanc version running which I compiled back in Nov 2022 and recently I decided to do a system update and also recompile Orthanc and update the binaries and plugins to the latest version. Updating went smooth and everything is still working fine, however, I now sometimes have an error in the log files from the Database plugin:
E0711 14:30:04.268936 PluginsManager.cpp:153] Exception in database back-end: Database could not serialize access due to concurrent update, the transaction should be retried
We are using PostgreSQL as backend using the official plugin with multiple writers because the Orthanc setup consists of two Orthanc instances, one storage/receiver (only enabling C-STORE), and one client instance (C-MOVE, C-FIND). The REST-API of the client instance is queried on a regular basis by two Python scripts (auto-forward and auto-query) and also supplies a custom build web-interface (python/django) via the REST-API. So there is quite some traffic on the server, although hardware load is still minimal.
I do suspect that something is off with our database setup/config, although I do find it strange that this error did not occur before I updated Orthanc and the plugins to the latest versions and interestingly the error only occurs in the storage instance of Orthanc and never in the client instance.
Any ideas or help in debugging this further or tweaking the config would be highly appreciated
The relevant configs:
storage.json
{
"PostgreSQL" : {
"EnableIndex" : true,
"EnableStorage" : false,
"Host" : "localhost",
"Port" : 5432,
"EnableSsl" : false,
"Lock" : false,
"MaximumConnectionRetries" : 10,
"ConnectionRetryInterval" : 5,
"IndexConnectionsCount" : 12
},
[...]
"StorageCompression": false,
"StorageAccessOnFind": "Never",
"SaveJobs" : true,
"JobsHistorySize": 100,
"LimitFindResults" : 100,
"LimitFindInstances" : 100,
"TcpNoDelay" : true,
"KeepAlive" : true,
"DicomThreadsCount": 12,
"MaximumStorageCacheSize": 512,
"SyncStorageArea": false
}
client.json
{
"PostgreSQL" : {
"EnableIndex" : true,
"EnableStorage" : false,
"Host" : "localhost",
"Port" : 5432,
"EnableSsl" : false,
"Lock" : false,
"MaximumConnectionRetries" : 10,
"ConnectionRetryInterval" : 5,
"IndexConnectionsCount" : 5
},
[...],
"StorageCompression": false,
"StorageAccessOnFind": "Never",
"SaveJobs" : true,
"JobsHistorySize": 100,
"LimitFindResults" : 2000,
"LimitFindInstances" : 2000,
"TcpNoDelay" : true,
"KeepAlive" : true,
"DicomThreadsCount": 6,
"MaximumStorageCacheSize": 512,
"SyncStorageArea": false
}