C-Find performance

124 views
Skip to first unread message

jef...@gmail.com

unread,
Sep 14, 2016, 3:13:50 PM9/14/16
to Orthanc Users
Hi,

First thanks for creating a PACS that is so easy to get running. I have setup what may be a fairly large instance of Orthanc- here are the stats:

{
"CountInstances" : 920510,
"CountPatients" : 1777,
"CountSeries" : 22914,
"CountStudies" : 2368,
"TotalDiskSize" : "397710981171",
"TotalDiskSizeMB" : 379286,
"TotalUncompressedSize" : "397710981171",
"TotalUncompressedSizeMB" : 379286
}

I am trying to issue a C-Find request to find all the SeriesInstanceUIDs in a given study- it looks something like this:

dcm4che-3.3.7/bin/findscu -c ORT...@mypacs.edu:4242 -m StudyInstanceUID=1.2.323.3680043.4.1008.1.1.1.1 -L SERIES -M StudyRoot -i SeriesDescription

It takes a very long time (in the minutes), although seems to speed up on subsequent requests. I am using the postgres plugin with images stored in the database. When I log the postgres queries (see bottom), it looks like it might be trying to read a number of DICOM files from the DB

Does Orthanc have to read the DICOM files themselves out of the DB to answer this query? If so, would it be better to use the disk storage rather than in the db?

Thanks,
Jeff

LOG: statement: BEGIN
LOG: execute 1a0e32a7-777f-4993-9fa1-cda8e4d326c4: SELECT content FROM StorageArea WHERE uuid=$1 AND type=$2
DETAIL: parameters: $1 = 'ff0e65a6-6bfc-48bd-9672-dea25ea77d61', $2 = '2'
LOG: fastpath function call: "lo_open" (OID 952)
LOG: fastpath function call: "lo_lseek" (OID 956)
LOG: fastpath function call: "lo_tell" (OID 958)
LOG: fastpath function call: "lo_lseek" (OID 956)
LOG: fastpath function call: "loread" (OID 954)
LOG: fastpath function call: "lo_close" (OID 953)
LOG: statement: COMMIT
LOG: execute da8e8964-89c7-47fa-8bf5-6cf92046b426: SELECT internalId, resourceType FROM Resources WHERE publicId=$1
DETAIL: parameters: $1 = '5ad6070c-c670c133-056b18d3-911b9836-953ffc3c'
LOG: execute 004244f2-9a10-489c-9cee-dc16fb5c0ada: SELECT uuid, uncompressedSize, compressionType, compressedSize, uncompressedHash, compressedHash FROM AttachedFiles WHERE id=$1 AND fileType=$2
DETAIL: parameters: $1 = '187915', $2 = '2'
LOG: statement: BEGIN
LOG: execute 1a0e32a7-777f-4993-9fa1-cda8e4d326c4: SELECT content FROM StorageArea WHERE uuid=$1 AND type=$2
DETAIL: parameters: $1 = '86f1c2ec-9e01-498c-aa30-9a79f60c587a', $2 = '2'
LOG: fastpath function call: "lo_open" (OID 952)
LOG: fastpath function call: "lo_lseek" (OID 956)
LOG: fastpath function call: "lo_tell" (OID 958)
LOG: fastpath function call: "lo_lseek" (OID 956)
LOG: fastpath function call: "loread" (OID 954)
LOG: fastpath function call: "lo_close" (OID 953)

Sébastien Jodogne

unread,
Sep 16, 2016, 6:27:40 AM9/16/16
to Orthanc Users
Dear Jeffrey,

I thank you much for reporting this performance issue.

I confirm this is a bug within the core of Orthanc. I have just applied a patch to the mainline code, and a Docker build has just been triggered:

Would it be possible for you to confirm this patch actually solves your problem?

Regards,
Sébastien-

Sébastien Jodogne

unread,
Sep 16, 2016, 8:59:14 AM9/16/16
to Orthanc Users
BTW, also make sure to compile Orthanc in Release mode:

Jeffrey Miller

unread,
Sep 16, 2016, 9:22:30 AM9/16/16
to Orthanc Users
Thanks Sébastien, I pulled the latest orthanc-plugins docker image (docker.io/jodogne/orthanc-plugins         1.1.0               ed26dec33c16) but I am still seeing the delayed C-Find response. Was the fix included in that image?

Sébastien Jodogne

unread,
Sep 16, 2016, 9:46:57 AM9/16/16
to Orthanc Users
Thanks Sébastien, I pulled the latest orthanc-plugins docker image (docker.io/jodogne/orthanc-plugins         1.1.0               ed26dec33c16) but I am still seeing the delayed C-Find response. Was the fix included in that image?

The patch is introduced in the mainline version of Orthanc, not in the 1.1.0 release.

Here is a sample Docker session (you simply have to use "jodogne/orthanc-plugins" instead of "jodogne/orthanc-plugins:1.1.0"):

# sudo docker pull jodogne/orthanc-plugins
# sudo docker run --rm --entrypoint=cat jodogne/orthanc-plugins /etc/orthanc/orthanc.json > /tmp/orthanc.json

=> Add the following definition to the "DicomModalities" section of "/tmp/orthanc.json", and adapt your PostgreSQL parameters:

  "DicomModalities" : {
    "sample" : [ "FINDSCU", "127.0.0.1", 2000 ]
  }

=> Then, actually start Orthanc:

# sudo docker run -p 4242:4242 -p 8042:8042 --rm -v /tmp/orthanc.json:/etc/orthanc/orthanc.json:ro jodogne/orthanc-plugins /etc/orthanc --verbose

HTH,
Sébastien-

Jeffrey Miller

unread,
Sep 16, 2016, 10:10:16 AM9/16/16
to Orthanc Users
Thanks! That worked. The response is quick now. Ultimately I ended up using the the dicom_tools/lookup API to translate from DICOM UID to Orthanc ID, and then I just used the Orthanc REST API to get the information I needed. This actually allowed me to remove a dependency on GDCM in my code. Thanks again for a great project.

Sébastien Jodogne

unread,
Sep 16, 2016, 10:19:06 AM9/16/16
to Orthanc Users
Fine, thanks for the positive feedback!

Sébastien-
Reply all
Reply to author
Forward
0 new messages