# HG changeset patch # User Alain Mazy # Date 1783343214 -7200 # Node ID 053ce2231c18379af6d229ec9146404f19f063c7 # Parent d286eec23500086a136d8c91251b802b479dfb3c clarified new configurations diff -r d286eec23500 -r 053ce2231c18 OrthancServer/Resources/Configuration.json --- a/OrthancServer/Resources/Configuration.json Mon Jul 06 15:06:09 2026 +0200 +++ b/OrthancServer/Resources/Configuration.json Mon Jul 06 15:06:54 2026 +0200 @@ -1157,6 +1157,11 @@ + // -> TODO-Streaming: move this into AdvancedConfiguration.json + + // add a page in the book: performance: fine tuning: limiting memory + increasing the number of threads blah blah blah + + // Number of threads that are used to parse DICOM files (when you need // to access the value of DICOM tags that are not store in DB). // (new in Orthanc 1.12.11+) @@ -1201,26 +1206,33 @@ "TranscoderCacheSize" : 128, // Number of threads that are used to provide DICOM files sequentially - // (currently used in Archive jobs, C-Store and C-Get). This limits - // the number of concurrent such jobs. - // TODO-Streaming: clarify the meaning with Seb. If the above definition - // is correct; shouldn't we simply set it to the same value as "ConcurrentJobs" if not defined ? - // (new in Orthanc 1.12.11+) + // (currently used in Archive jobs, C-Store and C-Get). + // Each time such a job needs to get a DICOM file content, it requests it from + // a sequential DICOM reader that will itself use a s torage loader thread. + // Therefore, by default, the value of this configuration is identical to + // "StorageLoaderThreads". + // (new in Orthanc 1.13.0) // You should monitor the "orthanc_seq_reader_available_threads" // metrics to determine the optimal value for your setup and usage. - "SequentialDicomReaderThreads": 2, + // "SequentialDicomReaderThreads": 4, - // TODO-Streaming: clarify the meaning with Seb. // Number of files each sequential DICOM reader is allowed to buffer // in advance before it is consumed by the related job. + // This is kind of equivalent to the older "LoaderThreads" configuration + // but, furthermore, you must make sure that there are enough "StorageLoaderThreads" + // and "SequentialDicomReaderThreads" for each job -> + // "StorageLoaderThreads" should be larger than "ConcurrentJobs" * "SequentialDicomReaderWindowCapacity" + // Together with "SequentialDicomReaderWindowCapacity", this also defines the amount of memory that is + // used by each job that required a SequentialDicomReader. "SequentialDicomReaderWindowSize": 4, - // TODO-Streaming: clarify the meaning with Seb. // Amount of RAM (in MB) that are allocated to each sequential DICOM - // Reader. + // Reader. The sequential DICOM reader stops pauses buffering as soon + // as one of the "SequentialDicomReaderWindowSize" or + // "SequentialDicomReaderWindowCapacity" limit is reached. // Note that this limit can be overpassed when a single file // exceeds this size. - // (new in Orthanc 1.12.11+). + // (new in Orthanc 1.13.0). "SequentialDicomReaderWindowCapacity": 64 } diff -r d286eec23500 -r 053ce2231c18 OrthancServer/Sources/OrthancConfiguration.h --- a/OrthancServer/Sources/OrthancConfiguration.h Mon Jul 06 15:06:09 2026 +0200 +++ b/OrthancServer/Sources/OrthancConfiguration.h Mon Jul 06 15:06:54 2026 +0200 @@ -57,10 +57,9 @@ #define ORTHANC_CONFIG_HTTP_THREADS_COUNT "HttpThreadsCount" #define ORTHANC_CONFIG_DICOM_THREADS_COUNT "DicomThreadsCount" -// TODO-Streaming: finalize the names with Seb #define ORTHANC_CONFIG_STORAGE_LOADER_THREADS "StorageLoaderThreads" #define ORTHANC_CONFIG_STORAGE_MEMORY_CAPACITY "StorageMemoryCapacity" -#define ORTHANC_CONFIG_MAXIMUM_STORAGE_CACHE_SIZE "MaximumStorageCacheSize" // TODO-Streaming: we keep the old naming for historical reasons ? +#define ORTHANC_CONFIG_MAXIMUM_STORAGE_CACHE_SIZE "MaximumStorageCacheSize" #define ORTHANC_CONFIG_DICOM_PARSER_SOURCE_THREADS "DicomParserThreads" #define ORTHANC_CONFIG_DICOM_PARSER_MEMORY_CAPACITY "DicomParserMemoryCapacity" #define ORTHANC_CONFIG_DICOM_PARSER_CACHE_SIZE "DicomParserCacheSize" diff -r d286eec23500 -r 053ce2231c18 OrthancServer/Sources/ServerContext.cpp --- a/OrthancServer/Sources/ServerContext.cpp Mon Jul 06 15:06:09 2026 +0200 +++ b/OrthancServer/Sources/ServerContext.cpp Mon Jul 06 15:06:54 2026 +0200 @@ -727,8 +727,15 @@ dicomParserThreads = lock.GetConfiguration().GetUnsignedIntegerParameter(ORTHANC_CONFIG_DICOM_PARSER_SOURCE_THREADS, 2); LOG(WARNING) << "'" << ORTHANC_CONFIG_DICOM_PARSER_SOURCE_THREADS << "' is set to " << dicomParserThreads; - sequentialReaderThreads = lock.GetConfiguration().GetUnsignedIntegerParameter(ORTHANC_CONFIG_SEQUENTIAL_DICOM_READER_THREADS, 2); - LOG(WARNING) << "'" << ORTHANC_CONFIG_SEQUENTIAL_DICOM_READER_THREADS << "' is set to " << sequentialReaderThreads; + if (!lock.GetConfiguration().LookupUnsignedIntegerParameter(sequentialReaderThreads, ORTHANC_CONFIG_SEQUENTIAL_DICOM_READER_THREADS)) + { + LOG(WARNING) << "'" << ORTHANC_CONFIG_SEQUENTIAL_DICOM_READER_THREADS << "' is not defined in your configuration, setting it to the same value as '" << ORTHANC_CONFIG_STORAGE_LOADER_THREADS << "': " << storageLoaderThreads; + sequentialReaderThreads = storageLoaderThreads; + } + else + { + LOG(WARNING) << "'" << ORTHANC_CONFIG_SEQUENTIAL_DICOM_READER_THREADS << "' is set to " << sequentialReaderThreads; + } // ----> IF you update values here, you must also update them in Configuration.json <----- GetMemoryConfiguration(storageMemoryCapacityMb, lock, ORTHANC_CONFIG_STORAGE_MEMORY_CAPACITY, 512);