DICOM test load generator

  • This script generates a heavy load of storing dicom data, the same image is sent over an over again with modified UIDs to make it look as a new image, with a new series per 100 images and a new study per 1000 images:

    file testload.lua

    Code
    x = DicomObject:new()
    x:Read('t.dcm')
    for i=0, 1000000 do
      x.SOPInstanceUID = genuid()..p
      if (i%100)==0 then x.SeriesInstanceUID = genuid()..p end
      if (i%1000)==0 then x.StudyInstanceUID = genuid()..p end
      x:Script('forward to CONQUESTSRV1')
      print(i)
    end

    Call e.g. from a windows command prompt as:

    dgate "--dolua:p=2;dofile('lua/testload.lua')"

    where the value p you pass must be unique for each client that you start at the same time (as many as you like). My fast PC (mysql database) stores about 100 512^2 images per second and seems to limited mostly by disk speed.

    I added

    ForwardAssociationLevel = SERIES

    to dicom.ini to use one association per generated series of 100 images.

    Marcel

    Marcel van Herk is developer of the Conquest DICOM server together with Lambert Zijp.

  • Hi,

    if you want to run this from multiple systems at once: you only need files

    dgate.exe
    dgate.dic
    dicom.ini
    acrnema.map
    dicom.sql
    t.dcm

    where t.dcm is a sample dicom image. As installation is not needed, it runs fine from a memory stick. I edited the above script a bit to remove the hard path to t.dcm.

    This stripped dicom.ini is enough:

    Code
    [sscscp]
    MicroPACS                = sscscp
    UIDPrefix                = 1.1
    ForwardAssociationLevel  = SERIES

    run as:

    dgate "--dolua:p=2;dofile('testload.lua')"

    Also acrnema.map can be totally empty if you write e.g., script('forward to localhost:5678) in testload.lua. File dicom.sql is needed if you want to run queries in the test program.

    Marcel

    Marcel van Herk is developer of the Conquest DICOM server together with Lambert Zijp.

  • This script will run from zbs and start 3 threads at the same time to heavily bombard the server with data:

    with

    ImportConverter0 = destroy

    The script shows a throughput of 320 MB/s writing (and reading) with 3 threads on my 8 core I7 machine. Not bad! Similar scripts resulted in some of the bug reports for heavy load. The script uses some features of version 1.4.17b, though.

    Marcel

    Marcel van Herk is developer of the Conquest DICOM server together with Lambert Zijp.

  • The above script runs in 4.5 - 5 s, with logging to file only.

    If I add line script('compression j2') to the script after loading the dicom image (3 threads), the script runs in 11 seconds, showing that 3000 j2 decompressions in 3 threads takes 6 seconds (512 x 512 images). I.e., for 512^2 images with 3 threads, jpeg images are decompressed in 2 ms. Actually a little longer (about 7.5s and 2.5ms), because the image transfer of compressed images will be somewhat faster, i.e. 3.5s.

    If I add line script('compression n1') to the script after loading the dicom image (3 threads), the script runs in 5.6 seconds, showing that 3000 n1 decompressions in 3 threads takes 2 seconds (512 x 512 images). I.e., for 512^2 images with 3 threads, NKI N1 images are decompressed in 0.66 ms.

    If I add line script('compression n4') to the script after loading the dicom image (3 threads), the script runs in 6.5 seconds, showing that 3000 j2 decompressions in 3 threads takes 3 seconds (512 x 512 images). I.e., for 512^2 images with 3 threads, NKI N4 images are decompressed in 1 ms.

    If I add line script('compression jk') to the script after loading the dicom image (3 threads), the script runs in 65 seconds, showing that 3000 jk (jpeg 2000) decompressions in 3 threads takes 60 seconds (512 x 512 images). I.e., for 512^2 images with 3 threads, jpeg2000 images are decompressed in 20 ms.

    Note that all these timings exclude disc access since images are not stored or network speed since the transfers are local.

    Marcel

    Marcel van Herk is developer of the Conquest DICOM server together with Lambert Zijp.

  • Hi

    I copy paste the above script in PACS lua folder and then execute the script with provided command. But i got series of error appended below both on windows command prompt as well as server.

    On Windows Command Prompt i am getting these messages

    106

    ImportConverter19.0: forwarded object to PACS

    *** ImportConverter19.0: Forward failed because SopClass is missing

    and on server console

    [PACS] UPACS THREAD 194: STARTED AT: Tue Mar 28 14:09:34 2023

    [PACS] *** connection terminated

    [PACS] UPACS THREAD 194: ENDED AT: Tue Mar 28 14:09:34 2023

    [PACS] UPACS THREAD 194: TOTAL RUNNING TIME: 0 SECONDS

    Will you please guide me where i am missing something.

    Regards

  • No, nothing was saved. I only received these messages on server console

    [PACS] Monitoring for files in: c:\pacs\data\incoming\

    [PACS] DGATE (1.5.0c, build Tue Aug 30 11:00:44 2022, bits 64) is running as threaded server

    [PACS] Database type: native MySQL connection

    [PACS] Starting 1 DelayedForwarderThreads

    [PACS] Starting 1 DelayedForwarderThreads

    [PACS] Starting 1 DelayedForwarderThreads

    [PACS] Started 3 export queue thread(s)

    [PACS] User interface test: local server is running!

    [PACS] Server command sent using DGATE -- option

    [PACS] Server command sent using DGATE -- option

    [PACS] Server command sent using DGATE -- option

    [PACS] Server command sent using DGATE -- option


    imagegenerator.lua

    t = os.clock()

    if p==nil then

    for j=1,3 do servercommand("luastart:p="..j..";dofile('c:/PACS/lua/testload.lua')") end

    return

    end


    testload.lua


    x = DicomObject:new()

    x:Read('t.dcm')

    for i=0, 1000000 do

    x.SOPInstanceUID = genuid()..p

    if (i%100)==0 then x.SeriesInstanceUID = genuid()..p end

    if (i%1000)==0 then x.StudyInstanceUID = genuid()..p end

    x:Script('forward to PACS')

    print(i)

    end

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!