Help with Orthanc connection

Hello,

…and thanks for the great work that you folks are doing.

I installed the OHIF viewer and the Dockerized version of Orthanc on a Google Cloud Storage VM. Installation was easy and OHIF connect flawlessly. I then proceeded to add 260GB of data from about 800 patients from the TCGA collection. By that time responsiveness through OHIF had significantly slowed. Assuming (hoping) that the Dockerized version of Orthanc might not have been built with the -DCMAKE_BUILD_TYPE=Release switch, I built Orthanc on the same machine from source, but that does not seem to have helped. I also built the DicomWeb plugin with the Release switch.

For example, a 144 slice series takes about 6 seconds to load into OHIF from a relatively empty DB and 47 seconds from the populated DB. While loading a series into OHIF, CPU utilization is about 30%. I’m running Ubuntu 17.10, n1-standard-4 (4 core, 15GB mem) processor, 10GB boot/local HDD. The DB is on a 500GB HDD.

Can you suggest what I might need to do to resolve this? Is this likely a mysql issue and would postgreSQL help? Anything else I should look at?

Thanks,
Bill

Oops…I see that I have the wrong subject. Shoud be “Need help with Orthanc performance”. I was earlier having trouble getting OHIF to connect to Orthanc, started to ask for help. then realized that I need to build the DicomWeb plugin. Apologies for the confusion.

Bill

Hello,

You should definitely give a try to the PostgreSQL “index” plugin for Orthanc. Quoting the Orthanc Book:

“The default database engine that is built in Orthanc is SQLite. As SQLite is above all a lightweight database engine, it is not designed to store very large datasets. If you are sure that you have properly disabled run-time debug assertions (cf. above), but still experience degradation in performance over time, you should seriously consider switching to a more scalable database engine. To this end, you can notably check out the official PostgreSQL plugin. As a rule of thumb, the performance of the default SQLite engine built in Orthanc should run fine up to about 50,000 DICOM instances.” [Troubleshooting — Orthanc Book documentation]

Instructions for using PostgreSQL from Docker is also available in the Orthanc Book:

http://book.orthanc-server.com/users/docker.html#postgresql-and-orthanc-inside-docker

HTH,
Sébastien-

Hello,

I’ve been trying to get the PostgreSQL solution to perform, but without much success. I currently have about 230 patients, comprising about 240K DICOM instances loaded into Orthanc/PostgeSQL, with “EnableIndex” and “EnableStorage” both set to True. I am again using the OHIF viewer. Now running on an 8-core VM (but going from 4 to 8 cores didn’t really seem to make much difference.)

Loading the study list into OHIF takes over 650 seconds, and loading the metadata for a particular study which I have used as my test study took 107s.

Curiously, Orthanc Explorer displays the same list of patients in just one or two seconds, and it is similarly fast to display the study, series and instance information as well as to open a series in the Orthanc Web Viewer (I have not yet tried Osimis on this large a DB population). Thus, it doesn’t seem like the bottleneck is in PG. Also the same data set loaded into Orthanc/SQLite yields similar performance through Orthanc Explorer.

This might suggest that the bottleneck is in OHIF, but different Orthanc configurations yield different performance through OHIF. For example, with the Orthanc/SQLite configuration, OHIF loads the study list in 70-100s, and loads that same study as above in 30-50s. This suggests it’s not an OHIF issue. That leaves what? the REST API?

One thing that is not clear to me is the interaction of the SQLite and the “EnableIndex” and “EnableStorage” PostgreSQL configuration parameters. If EnableIndex is false, is the index somehow maintained in SQLite? Similarly EnableStorage? Apologies if this is covered somewhere in the Orthanc Book.

Any other thoughts on this performance issue?

Regards,
Bill

Hello,

This symptom seems to indicate that OHIF is doing many successive, synchronous queries to the REST API of Orthanc, presumably one for each study. In opposition, Orthanc Explorer issues just one REST API to get the list of patients, which avoid the HTTP connection overhead.

You can validate this explanation by using the network debugging view of your Web browser (in Firefox e.g., hit “F12” and open the “Network” tab).

If this is actually the case, there’s nothing that can be done in the core of Orthanc: Such an optimization must be done by OHIF. One could however imagine to develop an “OHIF accelerator plugin” for Orthanc that would extend the REST API of Orthanc with new endpoints to speed up access with OHIF:
http://book.orthanc-server.com/developers/creating-plugins.html

Regarding the “650 seconds (PostgreSQL) vs. 100 seconds (SQLite)”, this most probably indicates that your Orthanc server is not running on the same host as the PostgreSQL database. The Orthanc database SDK is currently not optimized to take into account the network latency, which is necessary in such enterprise scenarios (we plan to soon work on such an optimization):
https://blog.2ndquadrant.com/postgresql-latency-pipelining-batching/

For the time being, make sure that both Orthanc and PostgreSQL run on the same computer.

Please keep us updated.

HTH,
Sébastien-