# Very slow anonymization

**URL:** https://discourse.orthanc-server.org/t/very-slow-anonymization/655
**Category:** Google Groups archive
**Created:** [April 11, 2017, 11:02pm UTC](https://discourse.orthanc-server.org/t/very-slow-anonymization/655 "2017-04-11T23:02:15Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Joe\_Mesterhazy](https://discourse.orthanc-server.org/letter_avatar_proxy/v4/letter/j/bbe5ce/32.png) [@Joe\_Mesterhazy](https://discourse.orthanc-server.org/u/Joe_Mesterhazy)
#### Post date: [April 11, 2017, 11:02pm UTC](https://discourse.orthanc-server.org/t/very-slow-anonymization/655/1 "2017-04-11T23:02:15Z")

</div>

Hi all,

I’m running Orthanc on Windows, using PostgreSQL as the database. I have about 1TB of CT images (~15,000 studies) already in Orthanc, which I would like to anonymize. I’m using a Python script to do this via the REST API.

I have found that the anonymization process is very, very slow. If I anonymize a CT study with 500 images, ~110MB, it takes just over a minute. It’s writing the anonymized studies at about 2MB/s. At this rate it will take almost a week to anonymize the entire database! This is on a dual-core Xeon workstation with fairly fast SATA disks.

Are there any tricks to making this go faster? Should I have used Linux instead?

Thanks,

Joe

---

<div class="post-metadata">

### Author: ![Thibault\_Nelis](https://discourse.orthanc-server.org/letter_avatar_proxy/v4/letter/t/48db29/32.png) [@Thibault\_Nelis](https://discourse.orthanc-server.org/u/Thibault_Nelis)
#### Post date: [April 12, 2017, 8:02am UTC](https://discourse.orthanc-server.org/t/very-slow-anonymization/655/2 "2017-04-12T08:02:17Z")

</div>

Hello,

Are you using Postgres for both the index and storage, or just for the  
index?

To troubleshoot this you'll need some monitoring data on the various  
resources of the machine: CPU usage, memory usage, storage I/O, even  
network I/O (it could just be waiting on network roundtrips  
intermittently with dramatic effects on the overall performance). It  
will be best to gather samples of these over time. Once you've isolated  
the bottleneck, you can search for the culprit.

Just in case I would also run storage I/O benchmarks that do random  
reads and writes at the same time; if it's a mechanical drive seeking  
operations sometimes have a big effect on throughput).

Good luck,

---

<div class="post-metadata">

### Author: ![Alain\_Mazy3](https://discourse.orthanc-server.org/letter_avatar_proxy/v4/letter/a/eb9ed0/32.png) [@Alain\_Mazy3](https://discourse.orthanc-server.org/u/Alain_Mazy3)
#### Post date: [April 12, 2017, 8:23am UTC](https://discourse.orthanc-server.org/t/very-slow-anonymization/655/3 "2017-04-12T08:23:54Z")

</div>

Please also check the version of Orthanc you are using. There were some performance issues with 1.1 that have been fixed in 1.2

---

<div class="post-metadata">

### Author: ![Joe\_Mesterhazy](https://discourse.orthanc-server.org/letter_avatar_proxy/v4/letter/j/bbe5ce/32.png) [@Joe\_Mesterhazy](https://discourse.orthanc-server.org/u/Joe_Mesterhazy)
#### Post date: [April 12, 2017, 6:41pm UTC](https://discourse.orthanc-server.org/t/very-slow-anonymization/655/4 "2017-04-12T18:41:34Z")

</div>

Turns out the problem was Windows Defender. I excluded the Orthanc data directory and throughput increased 5x.

Just to answer the rest of your questions, this was the latest Orthanc 1.2 for Windows. Postgres is used only for the index, not storage. Postgres is on SSD, but the data is on spinning disk. All connections (scripts, postgres, etc.) were pointed to 127.0.0.1 not localhost.

Thanks – Joe
