Load-testing a DICOM receiver: association throughput
- DICOM load testing should measure association churn and bulk payload throughput as separate stress vectors.
- High association churn can exhaust file descriptors, TCP ports in TIME_WAIT, and thread or process pools.
- Large bulk transfers can be limited by small PDU sizes, in-memory buffering, and slow disk writes.
- DCMTK's storescu combined with xargs can simulate concurrent associations, while dcmsend with --single-association tests sustained throughput.
- Increasing the negotiated PDU size from 16 KB toward 64 or 128 KB can meaningfully cut CPU overhead.
Load-testing a DICOM receiver requires testing two separate physical stress vectors: association churn and large payload throughput. A receiver that handles 10 concurrent scanners sending 2,000-slice CT scans can easily crash when 50 modalities open and close connections every second. If you only test raw transfer speed, production hospital traffic will surprise you.
Real clinical environments produce both traffic types. Outpatient clinics query worklists and push single X-rays. Meanwhile, surgical suites stream multi-gigabyte CT scans.
To test your receiver properly, simulate both patterns independently. You must measure what fails first when your listener reaches its limits.
What breaks during DICOM load testing and association throughput tests?
When developers benchmark a DICOM listener, they often make one mistake. They point a single test client at the receiver and stream 5,000 files in one continuous association.
That test proves your disk write speed and network card bandwidth. It does not test your association management engine.
DICOM operates over two distinct layers defined in the standard. The Upper Layer Protocol manages associations, while the DIMSE layer delivers service commands like C-STORE.
Stress Vector 1: Association Churn
Modality ──> [Connect -> Negotiate -> C-STORE (1 file) -> Release] ──> Receiver
(Stresses TCP sockets, TLS handshakes, thread pools, and ACSE state machines)
Stress Vector 2: Bulk Payload Ingestion
CT Scanner ──> [Connect -> Negotiate -> 2,500 C-STORE commands -> Release] ──> Receiver
(Stresses PDU reassembly, disk write queues, memory allocation, and socket buffers)
Pushing your receiver along both axes reveals two completely different sets of bottlenecks.
Association churn: why rapid connections fail before bandwidth fills
Association churn tests how fast your server accepts, negotiates, and tears down DICOM connections. Network bandwidth is rarely the bottleneck here. Your CPU and operating system limits break first.
Every DICOM connection starts with an association handshake. The client opens a TCP socket and sends an A-ASSOCIATE-RQ packet. The receiver parses presentation contexts, checks Application Entity (AE) titles, and replies with an A-ASSOCIATE-AC.
If you run DICOM over TLS, you also complete a cryptographic handshake before DICOM data moves. Under high churn, four components fail first:
-
File descriptor exhaustion. Every active socket consumes one file descriptor. When clients connect faster than your server closes old sockets, your process hits its
ulimit -ncap. The operating system throwsEMFILE: Too many open filesand drops new connections. -
TCP socket exhaustion in TIME_WAIT. When an association closes, the closing endpoint places the TCP socket into
TIME_WAITfor 60 to 120 seconds. This state prevents delayed packets from corrupting new connections. At 200 connections per second, you quickly exhaust ephemeral ports. -
Thread and process pool saturation. Many DICOM receivers spawn a new OS thread or child process for every inbound association. If 80 modalities connect at once, your host spends more CPU cycles on context switches than on processing images.
-
Listen backlog drops. When the operating system TCP listen queue overflows, the kernel drops new
SYNpackets. Clients see connection timeouts before the DICOM handshake even begins.
If your receiver rejects associations under churn, read our guide on debugging a failed DICOM association to inspect rejection reason codes.
Large-study payloads: why gigabytes expose buffer and disk traps
Bulk payload testing applies the opposite stress pattern. You open a single association and hold it open for several minutes while transmitting thousands of instances.
This tests the Storage Service Class mechanics defined in DICOM Part 4 Annex B. Here, connection overhead disappears. Memory allocation and storage I/O take over.
Modern CT scanners produce studies with 1,500 to 3,500 slices. If your receiver handles large scans poorly, you hit three specific bottlenecks:
-
PDU size bottlenecks. DICOM fragments large datasets into Protocol Data Units (PDUs). The default maximum PDU size in many legacy libraries is 16,384 bytes (16 KB). Transferring a 2 GB study with 16 KB PDUs creates over 130,000 network frames. Upgrading your negotiated PDU size to 65,536 bytes (64 KB) or 131,072 bytes (128 KB) cuts CPU overhead by more than 60%.
-
Resident memory bloat. If your listener parses the full DICOM dataset into RAM before writing it, memory consumption multiplies. Ten concurrent 500 MB transfers can consume 10 GB of memory. When RAM runs out, the Linux kernel Out-Of-Memory (OOM) killer terminates your process.
-
Disk write latency stalls. Writing thousands of individual 512 KB slice files causes severe filesystem thrashing. If your disk write queue fills up, your receiver stops reading from the TCP socket. The sender socket buffer fills, TCP window size drops to zero, and the sender aborts with a DIMSE timeout
0110or0111.
To avoid buffering multi-gigabyte studies entirely, see our article on handling large DICOM studies.
How do you test DICOM association throughput without buying commercial tools?
You do not need expensive commercial test suites to benchmark your DICOM listener. Standard open-source tools produce repeatable load tests.
We tested all commands in this guide using DCMTK 3.7.0 on Linux and macOS. DCMTK provides CLI binaries that simulate both association churn and bulk transfers.
Before starting, prepare one synthetic DICOM instance without Protected Health Information (PHI). You can download our sample synthetic file or create one following our DCMTK commands reference.
For initial setup and receiver verification, review our quickstart guide to confirm your network port and AE title answer standard verification pings.
Simulating association churn with storescu and xargs
To test association churn, we open many short-lived connections at the exact same moment. Each connection sends a single image and closes immediately.
DCMTK’s storescu opens one association, sends named files, and releases the connection. Combining storescu with xargs -P simulates dozens of modalities pushing studies in parallel.
Here is a bash command that launches 20 concurrent workers to execute 100 separate associations:
seq 1 100 | xargs -n 1 -P 20 -I {} \
storescu -v -aec TESTSCP -aet LOADCLIENT \
-to 5 -ta 10 -ts 10 \
localhost 11112 synthetic-sample.dcm +II
This command uses four important flags:
-
-P 20: Tellsxargsto run 20 worker processes in parallel. This forces 20 simultaneous association requests against your receiver. -
-to 5: Sets a 5-second connection timeout. If your receiver drops packets because its TCP backlog is full, the client aborts quickly instead of hanging. -
-ta 10: Sets a 10-second ACSE timeout for association negotiation. -
+II: Invent new SOP Instance UID. This flag is essential. A compliant DICOM storage receiver will reject or overwrite instances with identical UIDs. The+IIflag tellsstorescuto generate a fresh, unique UID for every single image it transmits.
Run this test while monitoring your server logs. Look for dropped connections, ECONNRESET errors, or association negotiation failures.
If your server passes 20 concurrent workers, increase -P to 40, then 80. Watch where the error rate climbs above zero. That threshold is your true association concurrency ceiling.
Measuring bulk throughput and PDU limits with dcmsend
To test raw throughput, you want the exact opposite pattern: one association pushing thousands of instances continuously.
DCMTK provides dcmsend for high-throughput batch transfers. Unlike storescu, dcmsend can hold a single association open across a whole directory tree.
First, create a test directory holding 1,000 synthetic CT slices. You can generate them by copying your synthetic sample file into a test folder:
mkdir -p ./test-study
for i in $(seq 1 1000); do
cp apps/web/public/synthetic-sample.dcm "./test-study/slice_${i}.dcm"
done
Now execute dcmsend with an optimized PDU size and single-association mode:
dcmsend -v -aec TESTSCP -aet BULKCLIENT \
-ma \
-pdu 131072 \
localhost 11112 ./test-study/
We used two key options here:
-
-ma(--single-association): Sends all 1,000 instances over one DICOM association. This tests sustained throughput without reconnection pauses. -
-pdu 131072: Proposes a 128 KB maximum receive PDU size. Compare your speed against the default 16 KB PDU (-pdu 16384). On gigabit networks, a 128 KB PDU routinely doubles transfer throughput.
To test if disk writes or network protocol processing causes a bottleneck, run a baseline with DCMTK’s storescp:
storescp -v -pdu 131072 --ignore 11112
The --ignore flag receives all DICOM datasets over the network but discards them without writing to disk. If your transfer rate jumps from 20 MB/s to 90 MB/s with --ignore, disk I/O is your bottleneck.
Key metrics to monitor while your receiver runs hot
Do not judge a load test solely by whether the client completed with exit code 0. You must inspect the health of the host operating system during the run.
Open a separate terminal on your receiver host and monitor these four indicators:
-
Active and waiting sockets. Run
ss -son Linux ornetstat -an | grep 11112on macOS. Track how many sockets linger inTIME_WAITandCLOSE_WAIT. A growingCLOSE_WAITcount means your application fails to close sockets promptly after association release. -
Open file descriptors. Find your receiver process ID (
PID) and check open files:lsof -p <PID> | wc -lCompare this number against
ulimit -n. If your process approaches 80% of the limit during churn tests, increase the limit in your service configuration. -
Resident set size (RSS) memory. Track memory with
ps -o rss,vsz -p <PID>. If RSS climbs steadily during a 2,000-slice transfer without dropping, your server buffers whole studies in RAM or leaks dataset handles. -
DICOM DIMSE response status codes. Check how many C-STORE responses return status
0x0000(Success) versus warning codes or temporary out-of-resources errors (0xA700).
For instructions on configuring hospital sender connections and timeouts before testing, check our guide on how to connect a DICOM sender.
Architecture trade-offs: picking your concurrency model
Your load test results expose the limits of your receiver architecture.
A process-fork model (like DCMTK storescp --fork) isolates each association in memory. A crash on one transfer will not drop other modalities. However, forking 50 processes per second burns massive CPU time and memory under churn.
Thread-per-connection designs handle churn better, but thread stacks still consume memory. An asynchronous, event-driven I/O engine offers the highest concurrency. It handles thousands of connections on a small thread pool by separating socket I/O from instance parsing.
One limitation matters: benchmarking over local loopback (localhost) tests CPU and memory, but hides network latency and packet loss. Over a hospital WAN, association negotiation latency multiplies. A 50-millisecond ping turns a 4-packet handshake into a 200-millisecond delay.
Always design your ingress pipeline for high association concurrency first. Hospital workflows generate erratic connection bursts that punish slow handshakes long before you saturate network bandwidth.
Dicomly builds infrastructure for healthcare software teams that receive DICOM studies from hospitals. Why we built Dicomly →