When running housekeeping mysqld.exe searching and dicom transfer is slow

We’re using the following setup:
Windows Server 2019
Orthanc 24.7.3
MariaDB 10.11 (x64)

When running houskeeping, mysqld.exe has a 33% CPU load (the VM has 3 cores). Searching via Explorer 2 and the dicom transfer is slow.

What can we change on th MariaDB config? Or are there any other hints to fix that?

Thank you very much for your answers!

It seems, that even when housekeeping is not running mysqld.exe takes about 33% CPU load.

We’re using the lastest MySQL Plugin: OrthancMySQLIndex-mainline.dll

The query that runs is: SELECT CAST(COALESCE(SUM(compressedSize), 0) AS UNSIGNED INTEGER) FROM AttachedFiles

Hi,

This query is executed when one calls the /statistics route. Unlike in the PostgreSQL plugin, this query has not been optimized in the MySQL plugin. If you have a service calling the /statistics route at regular interval, I would reduce the polling frequency.

HTH,

Alain

Hi Alain,

we don’t configured something like this, how can i find out - and how can i disable that?

check your logs in verbose mode: Collecting logs — Orthanc Book documentation

Hi, i activated the verbose logging:

I0722 16:00:27.456321     DICOM-SERVER CommandDispatcher.cpp:334] (dicom) Association Received from AET NETGATEQR on IP XXX.XXX.XXX.XXX
I0722 16:00:27.456321     DICOM-SERVER main.cpp:321] Incoming connection from AET NETGATEQR on IP XXX.XXX.XXX.XXX, calling AET ORTHANC
I0722 16:00:27.456321     DICOM-SERVER CommandDispatcher.cpp:667] (dicom) Association Acknowledged (Max Send PDV: 64222) to AET NETGATEQR on IP XXX.XXX.XXX.XXX
I0722 16:00:27.503205          DICOM-1 main.cpp:356] Incoming Store request from AET NETGATEQR on IP XXX.XXX.XXX.XXX, calling AET ORTHANC
I0722 16:00:27.503205          DICOM-1 FilesystemStorage.cpp:127] Creating attachment "4b9011d1-27e5-4c57-ad3a-7dab1af68c7d" of "DICOM" type
I0722 16:00:27.518807          DICOM-1 FilesystemStorage.cpp:157] Created attachment "4b9011d1-27e5-4c57-ad3a-7dab1af68c7d" (539.38KB in 15.60ms = 283.21Mbps)
I0722 16:00:27.753195          DICOM-1 ServerContext.cpp:767] New instance stored (0cd61bf1-5eba4efd-8eec31bc-2ad51829-16706367)
I0722 16:00:27.753195             1d18 OrthancPlugins.cpp:3224] (plugins) Plugin making REST GET call on URI /instances/0cd61bf1-5eba4efd-8eec31bc-2ad51829-16706367/metadata/4202 (built-in API)
I0722 16:00:27.753195             2f34 OrthancPlugins.cpp:3224] (plugins) Plugin making REST GET call on URI /instances/0cd61bf1-5eba4efd-8eec31bc-2ad51829-16706367 (built-in API)
I0722 16:00:27.753195          CHANGES PluginsManager.cpp:162] (plugins) New instance has been added to series 782d3ba5-e98bfb8d-751a40bf-ae921c35-3929e9e1, invalidating it
I0722 16:00:27.768808             1d18 OrthancPlugins.cpp:3224] (plugins) Plugin making REST GET call on URI /instances/0cd61bf1-5eba4efd-8eec31bc-2ad51829-16706367/tags?short (built-in API)
I0722 16:00:27.768808             1d18 FilesystemStorage.cpp:183] Reading attachment "4b9011d1-27e5-4c57-ad3a-7dab1af68c7d" of "DICOM" content type (range from 0 to 28028)
I0722 16:00:27.768808             1d18 FilesystemStorage.cpp:190] Read range of attachment "4b9011d1-27e5-4c57-ad3a-7dab1af68c7d" (27.37KB in 0ns = infGbps)
I0722 16:00:27.768808             1d18 OrthancPlugins.cpp:3281] (plugins) Plugin making REST PUT call on URI /instances/0cd61bf1-5eba4efd-8eec31bc-2ad51829-16706367/metadata/4202 (built-in API)
I0722 16:00:27.800067          DICOM-1 main.cpp:356] Incoming Store request from AET NETGATEQR on IP XXX.XXX.XXX.XXX, calling AET ORTHANC
I0722 16:00:27.800067          DICOM-1 FilesystemStorage.cpp:127] Creating attachment "2a482611-00df-4ae5-b0ff-de20bc0e4ee8" of "DICOM" type
I0722 16:00:27.815689          DICOM-1 FilesystemStorage.cpp:157] Created attachment "2a482611-00df-4ae5-b0ff-de20bc0e4ee8" (593.82KB in 15.62ms = 311.39Mbps)
I0722 16:00:28.065704          DICOM-1 ServerContext.cpp:767] New instance stored (48170840-bf5cfb93-8096cad2-bdcfe6bb-24f846fb)
I0722 16:00:28.065704          CHANGES PluginsManager.cpp:162] (plugins) New instance has been added to series 782d3ba5-e98bfb8d-751a40bf-ae921c35-3929e9e1, invalidating it
I0722 16:00:28.065704             2f34 OrthancPlugins.cpp:3224] (plugins) Plugin making REST GET call on URI /instances/48170840-bf5cfb93-8096cad2-bdcfe6bb-24f846fb (built-in API)
I0722 16:00:28.065704             1d18 OrthancPlugins.cpp:3224] (plugins) Plugin making REST GET call on URI /instances/48170840-bf5cfb93-8096cad2-bdcfe6bb-24f846fb/metadata/4202 (built-in API)
I0722 16:00:28.065704             1d18 OrthancPlugins.cpp:3224] (plugins) Plugin making REST GET call on URI /instances/48170840-bf5cfb93-8096cad2-bdcfe6bb-24f846fb/tags?short (built-in API)
I0722 16:00:28.065704             1d18 FilesystemStorage.cpp:183] Reading attachment "2a482611-00df-4ae5-b0ff-de20bc0e4ee8" of "DICOM" content type (range from 0 to 83772)
I0722 16:00:28.065704             1d18 FilesystemStorage.cpp:190] Read range of attachment "2a482611-00df-4ae5-b0ff-de20bc0e4ee8" (81.81KB in 0ns = infGbps)
I0722 16:00:28.065704             1d18 OrthancPlugins.cpp:3281] (plugins) Plugin making REST PUT call on URI /instances/48170840-bf5cfb93-8096cad2-bdcfe6bb-24f846fb/metadata/4202 (built-in API)
I0722 16:00:28.112568          DICOM-1 main.cpp:356] Incoming Store request from AET NETGATEQR on IP XXX.XXX.XXX.XXX, calling AET ORTHANC
I0722 16:00:28.112568          DICOM-1 FilesystemStorage.cpp:127] Creating attachment "d76eca13-9d3a-4a13-8d91-a2cfb9ee43f8" of "DICOM" type
I0722 16:00:28.112568          DICOM-1 FilesystemStorage.cpp:157] Created attachment "d76eca13-9d3a-4a13-8d91-a2cfb9ee43f8" (517.41KB in 0ns = infGbps)
I0722 16:00:28.362564          DICOM-1 ServerContext.cpp:767] New instance stored (e5b075d1-b83f6d61-ab9bef23-0f897714-132e01d7)
I0722 16:00:28.362564          CHANGES PluginsManager.cpp:162] (plugins) New instance has been added to series fbc61753-17ab4e0e-459d79b7-f3cb4cb9-e034ee03, invalidating it
I0722 16:00:28.362564             2f34 OrthancPlugins.cpp:3224] (plugins) Plugin making REST GET call on URI /instances/e5b075d1-b83f6d61-ab9bef23-0f897714-132e01d7 (built-in API)
I0722 16:00:28.362564             1d18 OrthancPlugins.cpp:3224] (plugins) Plugin making REST GET call on URI /instances/e5b075d1-b83f6d61-ab9bef23-0f897714-132e01d7/metadata/4202 (built-in API)
I0722 16:00:28.378184             1d18 OrthancPlugins.cpp:3224] (plugins) Plugin making REST GET call on URI /instances/e5b075d1-b83f6d61-ab9bef23-0f897714-132e01d7/tags?short (built-in API)
I0722 16:00:28.378184             1d18 FilesystemStorage.cpp:183] Reading attachment "d76eca13-9d3a-4a13-8d91-a2cfb9ee43f8" of "DICOM" content type (range from 0 to 5528)
I0722 16:00:28.378184             1d18 FilesystemStorage.cpp:190] Read range of attachment "d76eca13-9d3a-4a13-8d91-a2cfb9ee43f8" (5.40KB in 0ns = infGbps)
I0722 16:00:28.378184             1d18 OrthancPlugins.cpp:3281] (plugins) Plugin making REST PUT call on URI /instances/e5b075d1-b83f6d61-ab9bef23-0f897714-132e01d7/metadata/4202 (built-in API)
I0722 16:00:28.425084          DICOM-1 main.cpp:356] Incoming Store request from AET NETGATEQR on IP XXX.XXX.XXX.XXX, calling AET ORTHANC
I0722 16:00:28.425084          DICOM-1 FilesystemStorage.cpp:127] Creating attachment "7329de3b-3f20-40a5-9a12-4f563fa81d5f" of "DICOM" type
I0722 16:00:28.425084          DICOM-1 FilesystemStorage.cpp:157] Created attachment "7329de3b-3f20-40a5-9a12-4f563fa81d5f" (517.41KB in 0ns = infGbps)
I0722 16:00:28.675069          DICOM-1 ServerContext.cpp:767] New instance stored (38545862-e2ed89cc-4d478f8a-5cf7e19b-cafb8556)
I0722 16:00:28.675069          CHANGES PluginsManager.cpp:162] (plugins) New instance has been added to series fbc61753-17ab4e0e-459d79b7-f3cb4cb9-e034ee03, invalidating it
I0722 16:00:28.675069             2f34 OrthancPlugins.cpp:3224] (plugins) Plugin making REST GET call on URI /instances/38545862-e2ed89cc-4d478f8a-5cf7e19b-cafb8556 (built-in API)
I0722 16:00:28.675069             1d18 OrthancPlugins.cpp:3224] (plugins) Plugin making REST GET call on URI /instances/38545862-e2ed89cc-4d478f8a-5cf7e19b-cafb8556/metadata/4202 (built-in API)
I0722 16:00:28.675069             1d18 OrthancPlugins.cpp:3224] (plugins) Plugin making REST GET call on URI /instances/38545862-e2ed89cc-4d478f8a-5cf7e19b-cafb8556/tags?short (built-in API)
I0722 16:00:28.690686             1d18 FilesystemStorage.cpp:183] Reading attachment "7329de3b-3f20-40a5-9a12-4f563fa81d5f" of "DICOM" content type (range from 0 to 5528)
I0722 16:00:28.690686             1d18 FilesystemStorage.cpp:190] Read range of attachment "7329de3b-3f20-40a5-9a12-4f563fa81d5f" (5.40KB in 0ns = infGbps)
I0722 16:00:28.690686             1d18 OrthancPlugins.cpp:3281] (plugins) Plugin making REST PUT call on URI /instances/38545862-e2ed89cc-4d478f8a-5cf7e19b-cafb8556/metadata/4202 (built-in API)
I0722 16:00:28.721954          DICOM-1 main.cpp:356] Incoming Store request from AET NETGATEQR on IP XXX.XXX.XXX.XXX, calling AET ORTHANC
I0722 16:00:28.721954          DICOM-1 FilesystemStorage.cpp:127] Creating attachment "8d9b3c6c-a924-447d-a624-f7e4f9f58ebd" of "DICOM" type
I0722 16:00:28.737566          DICOM-1 FilesystemStorage.cpp:157] Created attachment "8d9b3c6c-a924-447d-a624-f7e4f9f58ebd" (517.41KB in 15.61ms = 271.50Mbps)
I0722 16:00:28.971951          DICOM-1 ServerContext.cpp:767] New instance stored (16ed154a-064696f8-99a97be9-fd62890a-46a95171)
I0722 16:00:28.971951          CHANGES PluginsManager.cpp:162] (plugins) New instance has been added to series fbc61753-17ab4e0e-459d79b7-f3cb4cb9-e034ee03, invalidating it
I0722 16:00:28.971951             2f34 OrthancPlugins.cpp:3224] (plugins) Plugin making REST GET call on URI /instances/16ed154a-064696f8-99a97be9-fd62890a-46a95171 (built-in API)
I0722 16:00:28.971951             1d18 OrthancPlugins.cpp:3224] (plugins) Plugin making REST GET call on URI /instances/16ed154a-064696f8-99a97be9-fd62890a-46a95171/metadata/4202 (built-in API)
I0722 16:00:28.971951             1d18 OrthancPlugins.cpp:3224] (plugins) Plugin making REST GET call on URI /instances/16ed154a-064696f8-99a97be9-fd62890a-46a95171/tags?short (built-in API)
I0722 16:00:28.987586             1d18 FilesystemStorage.cpp:183] Reading attachment "8d9b3c6c-a924-447d-a624-f7e4f9f58ebd" of "DICOM" content type (range from 0 to 5528)
I0722 16:00:28.987586             1d18 FilesystemStorage.cpp:190] Read range of attachment "8d9b3c6c-a924-447d-a624-f7e4f9f58ebd" (5.40KB in 0ns = infGbps)
I0722 16:00:28.987586             1d18 OrthancPlugins.cpp:3281] (plugins) Plugin making REST PUT call on URI /instances/16ed154a-064696f8-99a97be9-fd62890a-46a95171/metadata/4202 (built-in API)
I0722 16:00:29.018823          DICOM-1 main.cpp:356] Incoming Store request from AET NETGATEQR on IP XXX.XXX.XXX.XXX, calling AET ORTHANC
I0722 16:00:29.018823          DICOM-1 FilesystemStorage.cpp:127] Creating attachment "d7feaadf-f287-4065-827b-1466036042b7" of "DICOM" type
I0722 16:00:29.018823          DICOM-1 FilesystemStorage.cpp:157] Created attachment "d7feaadf-f287-4065-827b-1466036042b7" (517.41KB in 0ns = infGbps)
I0722 16:00:29.284462          DICOM-1 ServerContext.cpp:767] New instance stored (51c9bc1d-dba4cbc8-91780c16-ccf2ae42-da2db5d1)
I0722 16:00:29.284462          CHANGES PluginsManager.cpp:162] (plugins) New instance has been added to series fbc61753-17ab4e0e-459d79b7-f3cb4cb9-e034ee03, invalidating it
I0722 16:00:29.284462             2f34 OrthancPlugins.cpp:3224] (plugins) Plugin making REST GET call on URI /instances/51c9bc1d-dba4cbc8-91780c16-ccf2ae42-da2db5d1 (built-in API)
I0722 16:00:29.284462             1d18 OrthancPlugins.cpp:3224] (plugins) Plugin making REST GET call on URI /instances/51c9bc1d-dba4cbc8-91780c16-ccf2ae42-da2db5d1/metadata/4202 (built-in API)
I0722 16:00:29.284462             1d18 OrthancPlugins.cpp:3224] (plugins) Plugin making REST GET call on URI /instances/51c9bc1d-dba4cbc8-91780c16-ccf2ae42-da2db5d1/tags?short (built-in API)
I0722 16:00:29.284462             1d18 FilesystemStorage.cpp:183] Reading attachment "d7feaadf-f287-4065-827b-1466036042b7" of "DICOM" content type (range from 0 to 5528)
I0722 16:00:29.284462             1d18 FilesystemStorage.cpp:190] Read range of attachment "d7feaadf-f287-4065-827b-1466036042b7" (5.40KB in 0ns = infGbps)
I0722 16:00:29.284462             1d18 OrthancPlugins.cpp:3281] (plugins) Plugin making REST PUT call on URI /instances/51c9bc1d-dba4cbc8-91780c16-ccf2ae42-da2db5d1/metadata/4202 (built-in API)
I0722 16:00:29.331321          DICOM-1 main.cpp:356] Incoming Store request from AET NETGATEQR on IP XXX.XXX.XXX.XXX, calling AET ORTHANC
I0722 16:00:29.331321          DICOM-1 FilesystemStorage.cpp:127] Creating attachment "29c52843-771b-4392-91e1-3b2ab095d2c4" of "DICOM" type
I0722 16:00:29.331321          DICOM-1 FilesystemStorage.cpp:157] Created attachment "29c52843-771b-4392-91e1-3b2ab095d2c4" (517.41KB in 0ns = infGbps)
I0722 16:00:29.581318          DICOM-1 ServerContext.cpp:767] New instance stored (9bbcc032-e75cf8f0-768a4f2f-dbf6eabe-eefa9b78)
I0722 16:00:29.581318          CHANGES PluginsManager.cpp:162] (plugins) New instance has been added to series fbc61753-17ab4e0e-459d79b7-f3cb4cb9-e034ee03, invalidating it

I can’t see enything strange here, another DICOM Stream:

I0722 16:03:54.842868     DICOM-SERVER CommandDispatcher.cpp:334] (dicom) Association Received from AET GEMEDICO on IP XXX.XXX.XXX.XXX
I0722 16:03:54.842868     DICOM-SERVER main.cpp:321] Incoming connection from AET GEMEDICO on IP XXX.XXX.XXX.XXX, calling AET ORTHANC
I0722 16:03:54.842868     DICOM-SERVER CommandDispatcher.cpp:667] (dicom) Association Acknowledged (Max Send PDV: 131060) to AET GEMEDICO on IP XXX.XXX.XXX.XXX
I0722 16:03:54.842868          DICOM-1 main.cpp:356] Incoming Store request from AET GEMEDICO on IP XXX.XXX.XXX.XXX, calling AET ORTHANC
I0722 16:03:54.842868          DICOM-1 FilesystemStorage.cpp:127] Creating attachment "c0f8bb3c-7ae4-407c-83e8-0dd905b14109" of "DICOM" type
I0722 16:03:54.858490          DICOM-1 FilesystemStorage.cpp:157] Created attachment "c0f8bb3c-7ae4-407c-83e8-0dd905b14109" (612.73KB in 15.62ms = 321.31Mbps)
I0722 16:03:55.108492          DICOM-1 ServerContext.cpp:767] New instance stored (0e7fc165-ac44808a-5c26483d-f54e0de8-5dc12de8)
I0722 16:03:55.108492          CHANGES PluginsManager.cpp:162] (plugins) New instance has been added to series b6dd73c5-aa61a6f3-edee9f91-c7158032-6213ea89, invalidating it
I0722 16:03:55.108492             2f34 OrthancPlugins.cpp:3224] (plugins) Plugin making REST GET call on URI /instances/0e7fc165-ac44808a-5c26483d-f54e0de8-5dc12de8 (built-in API)
I0722 16:03:55.108492             1d18 OrthancPlugins.cpp:3224] (plugins) Plugin making REST GET call on URI /instances/0e7fc165-ac44808a-5c26483d-f54e0de8-5dc12de8/metadata/4202 (built-in API)
I0722 16:03:55.108492             1d18 OrthancPlugins.cpp:3224] (plugins) Plugin making REST GET call on URI /instances/0e7fc165-ac44808a-5c26483d-f54e0de8-5dc12de8/tags?short (built-in API)
I0722 16:03:55.108492             1d18 FilesystemStorage.cpp:183] Reading attachment "c0f8bb3c-7ae4-407c-83e8-0dd905b14109" of "DICOM" content type (range from 0 to 2792)
I0722 16:03:55.108492             1d18 FilesystemStorage.cpp:190] Read range of attachment "c0f8bb3c-7ae4-407c-83e8-0dd905b14109" (2.73KB in 0ns = infGbps)
I0722 16:03:55.108492             1d18 OrthancPlugins.cpp:3281] (plugins) Plugin making REST PUT call on URI /instances/0e7fc165-ac44808a-5c26483d-f54e0de8-5dc12de8/metadata/4202 (built-in API)
I0722 16:03:55.108492          DICOM-1 CommandDispatcher.cpp:932] (dicom) Finishing association with AET GEMEDICO on IP XXX.XXX.XXX.XXX: DUL Peer Requested Release
I0722 16:03:55.108492          DICOM-1 CommandDispatcher.cpp:940] (dicom) Association Release with AET GEMEDICO on IP XXX.XXX.XXX.XXX

Have you configured MaximumStorageSize or MaximumPatientCount ?

Hi Alain,

“MaximumStorageSize” : 500000,

and

“MaximumPatientCount” : 0,

Hi,

it seems that with every new DICOM stream the CPU Load reaches 33%, after the end of the transfer it falls back to 1 / 2 %

Actually, this “heavy” SQL query is also called everytime you receive a file when you have defined a MaximumStorageSize. I have added this issue to our todo list but I can not tell you when this will be implemented. The workaround right now is to avoid using MaximumStorageSize or MaximumPatientCount with MySQL.

Hi Alain,

OK, how can i prevent, that the disk is running full?

And - we can switch to Postgres, which installer do you prefer?

You would then have to implement an external script to monitor the usage and delete studies …

The PostgreSQL plugin is far more optimized than the MySQL one.