Performance Orthanc

Hello Guys.

I need some help with the performance of my Orthanc server. Before describing the issue, I would like to explain the infrastructure I am using.

  • Orthanc is running on an EC2 instance (t3.2xlarge) with 8 vCPUs and 32 GB of RAM

  • For storage, I am using Amazon S3

  • As a database, I am using PostgreSQL running on RDS

Note: All services are in the same region (us-east-1).

The problem is that my server is taking about 7 minutes to process a study with around 1,400k instances. Below is my server configuration:

orthanc.secret.json :

{
  "Name": "DICOM-SERVER",
  "StorageDirectory" : "/var/lib/orthanc/db",
  "RemoteAccessAllowed": true,
  "AuthenticationEnabled": false,
  "OrthancExplorerEnabled": false,
  "Worklists": {
    "Enable": false
  },
  "Plugins" : ["/usr/share/orthanc/plugins/"],
  "PostgreSQL" : {
    "EnableIndex" : true,
    "EnableStorage" : false,
    "Host" : "<rds_host>",
    "Port" : 5432,
    "Database" : "database_name",
    "Username" : "username",
    "Password" : "pg_password",
    "Lock" : false,
    "EnableSsl" : true,                   
    "MaximumConnectionRetries" : 10,       
    "ConnectionRetryInterval" : 5,              
    "TransactionMode": "ReadCommitted", 
    "EnableVerboseLogs": false,            
    "HousekeepingInterval": 120,             
    "AllowInconsistentChildCounts": false, 
    "UseDynamicConnectionPool": true   
  },
  "AwsS3Storage": {
    "BucketName": "bucket_name",
    "Region": "us-east-1",
    "AccessKey" : "access_key",
    "SecretKey" : "secret_key",
    "EnableAwsSdkLogs": true
  },
  "DicomWeb" : {
    "Enable" : false
  },
  "StableAge": 30,
  "PythonScript" : "/etc/orthanc/script.py",
  "RestApiWriteToFileSystemEnabled": false,
  "ExecuteLuaEnabled": false,
  "StorageCompression" : false,
  "KeepAlive" : true,
  "TcpNoDelay" : true,
  "SaveJobs" : false,
  "DicomAet" : "MY_AET_TITLE",
  "DicomCheckCalledAet" : true,
  "StrictAetComparison" : true,
  "DicomAlwaysAllowEcho" : true,
  "DicomAlwaysAllowStore" : true,
  "DicomAlwaysAllowFind" : true,
  "DicomAlwaysAllowFindWorklist" : false,
  "DicomAlwaysAllowGet" : false,
  "DicomAlwaysAllowMove" : false,
  "DicomCheckModalityHost" : false
}

And here are the settings from my docker-compose.yml:

services:
    orthanc:
        build:
          context: .
          dockerfile: Dockerfile
        restart: unless-stopped
        ports: ["4242:4242"]
        volumes:
          - "./script.py:/etc/orthanc/script.py:ro"
        environment:
          ORTHANC__DICOM_SERVER_ENABLED: "true"
          ORTHANC__DICOM_THREADS_COUNT: 8
          ORTHANC__DICOM_ALWAYS_ALLOW_STORE: "true"
          ORTHANC__OVERWRITE_INSTANCES: "true"
        secrets:
          - orthanc.secret.json

secrets:
  orthanc.secret.json:
    file: orthanc.secret.json

And here is my dockerfile:

FROM orthancteam/orthanc:latest

RUN apt-get update && \
    apt-get install -y python3-pip && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

Where am I going wrong for Orthanc to take so long to process this?
How can I reduce the processing time?

Hi @rafaapcode

What do you mean by process ? Receive/Send/Download/Modify ? Through DICOM, DICOMweb, Rest API ?

And, as always, make sur to check/share the logs in verbose mode, they give a lot of information about timings …

Best,

Alain

By process, we mean the reception of images via standard DICOM (C-STORE).
The problem is not related to sending, downloading, or modifying the data, nor to DICOMweb or REST APIs.

We are currently reviewing the verbose logs and will share them, as they provide detailed timing information.

Hello,

This is presumably the bottleneck. Try using the hard drive of the VM to see if performance is improved.

Regards,
Sébastien-

@alainmazy
I am using DCMTK to send the images (I’m not sure if this could be causing the issue). These are the only logs I receive in Orthanc while i receiving the instances:

These are my log settings (am I doing something wrong?):

services:
    orthanc:
        build:
          context: .
          dockerfile: Dockerfile
        restart: unless-stopped
        ports: ["4242:4242"]
        volumes:
          - "./script.py:/etc/orthanc/script.py:ro"
        environment:
          ORTHANC__DICOM_SERVER_ENABLED: "true"
          ORTHANC__DICOM_THREADS_COUNT: 8
          ORTHANC__DICOM_ALWAYS_ALLOW_STORE: "true"
          ORTHANC__OVERWRITE_INSTANCES: "true"
          ORTHANC__VERBOSE_ENABLED: true
          ORTHANC__VERBOSE_STARTUP: true
        secrets:
          - orthanc.secret.json

secrets:
  orthanc.secret.json:
    file: orthanc.secret.json


And these are the DCMTK logs:

Ok @jodogne I will try this and get back to you as soon as possible with the results I obtained.

This is not the issue, as Orthanc also uses DCMTK. Your issue is clearly related to the network communications between, on the one hand, your virtual machine and, on the other end, your storage area or your PostgreSQL server.

@jodogne Ok, thank you for the clarification. I will set up Orthanc using SQLite and local storage and run the tests. As soon as I get the results, I’ll get back to you here. Thank you!

@alainmazy @jodogne

Hello everyone,

I was able to resolve the issue, and it was related to the region where my VPS was located. This was due to an oversight on my part.

Thank you for your attention.

@alainmazy @jodogne

Hello everyone,

I’m facing a performance issue with Orthanc and would appreciate some guidance.

All my services are running in the same AWS region (sa-east-1):

  • Orthanc servers
  • RDS
  • S3

They are all inside the same VPC.

Here is the behavior I’m observing:

  • When I send 300 DICOM instances using DCMTK, Orthanc receives all of them in approximately 20 seconds.
  • However, when I send the same set of instances from a medical imaging equipment, Orthanc takes around 1 minute and 21 seconds to receive them.

Both tests are performed under the same network conditions and target the same Orthanc instance.

Below is my server configuration:

orthanc.secret.json :

{
  "Name": "DICOM-SERVER",
  "StorageDirectory" : "/var/lib/orthanc/db",
  "RemoteAccessAllowed": true,
  "AuthenticationEnabled": false,
  "OrthancExplorerEnabled": false,
  "Worklists": {
    "Enable": false
  },
  "Plugins" : ["/usr/share/orthanc/plugins/"],
  "PostgreSQL" : {
    "EnableIndex" : true,
    "EnableStorage" : false,
    "Host" : "<rds_host>",
    "Port" : 5432,
    "Database" : "database_name",
    "Username" : "username",
    "Password" : "pg_password",
    "Lock" : false,
    "EnableSsl" : true,                   
    "MaximumConnectionRetries" : 10,       
    "ConnectionRetryInterval" : 5,              
    "TransactionMode": "ReadCommitted", 
    "EnableVerboseLogs": false,            
    "HousekeepingInterval": 120,             
    "AllowInconsistentChildCounts": false, 
    "UseDynamicConnectionPool": true   
  },
  "AwsS3Storage": {
    "BucketName": "bucket_name",
    "Region": "us-east-1",
    "AccessKey" : "access_key",
    "SecretKey" : "secret_key",
    "EnableAwsSdkLogs": true
  },
  "DicomWeb" : {
    "Enable" : false
  },
  "StableAge": 30,
  "PythonScript" : "/etc/orthanc/script.py",
  "RestApiWriteToFileSystemEnabled": false,
  "ExecuteLuaEnabled": false,
  "StorageCompression" : false,
  "KeepAlive" : true,
  "TcpNoDelay" : true,
  "SaveJobs" : false,
  "DicomAet" : "MY_AET_TITLE",
  "DicomCheckCalledAet" : true,
  "StrictAetComparison" : true,
  "DicomAlwaysAllowEcho" : true,
  "DicomAlwaysAllowStore" : true,
  "DicomAlwaysAllowFind" : true,
  "DicomAlwaysAllowFindWorklist" : false,
  "DicomAlwaysAllowGet" : false,
  "DicomAlwaysAllowMove" : false,
  "DicomCheckModalityHost" : false
}

And here are the settings from my docker-compose.yml :

services:
    orthanc:
        build:
          context: .
          dockerfile: Dockerfile
        restart: unless-stopped
        ports: ["4242:4242"]
        volumes:
          - "./script.py:/etc/orthanc/script.py:ro"
        environment:
          ORTHANC__DICOM_SERVER_ENABLED: "true"
          ORTHANC__DICOM_THREADS_COUNT: 8
          ORTHANC__DICOM_ALWAYS_ALLOW_STORE: "true"
          ORTHANC__OVERWRITE_INSTANCES: "true"
        secrets:
          - orthanc.secret.json

secrets:
  orthanc.secret.json:
    file: orthanc.secret.json

And here is my dockerfile :

FROM orthancteam/orthanc:latest

RUN apt-get update && \
    apt-get install -y python3-pip && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

Has anyone experienced a similar discrepancy between DCMTK and real equipment?
Are there specific Orthanc, DICOM association, or network parameters that could explain this difference in transfer time?

Any insights or suggestions would be greatly appreciated.

Thank you in advance.

And why not question the equipment itself !?!?!? You pay them a support contract to answer this kind of questions.

Hello,

This possibility does indeed exist; however, with other PACS systems the equipment is able to send the 300 instances in the same amount of time as DCMTK (20 seconds), which is why I ruled out this possibility. Nevertheless, I will contact them as suggested. Thank you for your attention.