NAGLE

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
Shaeto
Posts: 147
Joined: Tue, 2009-01-20, 17:50
Location: CA, USA
Contact:

NAGLE

#1 Post by Shaeto »

in dul.cc we can find DONT_DISABLE_NAGLE_ALGORITHM defined code block, this code by default disables NAGLE algorithm ( http://en.wikipedia.org/wiki/Nagle%27s_algorithm )

here is some facts why i suggest to add DONT_DISABLE_NAGLE_ALGORITHM to configs.

i used two DCMTK 3.6.0 powered dicom devices, one is sender and another is receiver (multithread server), linux, kernel 3.2.6

test file - 27265994 bytes MG modality from D.Clunie test repository.

the first stage: nagle is disabled

real 0m2.572s
user 0m0.191s
sys 0m0.331s

real 0m2.565s
user 0m0.173s
sys 0m0.314s

real 0m2.594s
user 0m0.193s
sys 0m0.307s

real 0m2.566s
user 0m0.198s
sys 0m0.365s

average is 2,57425s

tcpdump report (from receiving box, counts only incoming dicom packets)

19159 packets captured

19159 packets captured

19159 packets captured

19159 packets captured

the second stage: nagle is enabled

real 0m2.568s
user 0m0.192s
sys 0m0.361s

real 0m2.568s
user 0m0.197s
sys 0m0.352s

real 0m2.623s
user 0m0.195s
sys 0m0.343s

real 0m2.567s
user 0m0.191s
sys 0m0.384s

average is 2,5815s

18949 packets captured

18949 packets captured

18949 packets captured

18949 packets captured

so, we have network overweight if nagle is disabled (+210 packets) also i don't see serios reasons to "optimize" network speed in this manner.
Last edited by Shaeto on Sat, 2012-02-18, 20:09, edited 1 time in total.

J. Riesmeier
DCMTK Developer
Posts: 2501
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

#2 Post by J. Riesmeier »

Thank you for the detailed report. Did you read the documentation of this macro in macros.txt:

Code: Select all

DONT_DISABLE_NAGLE_ALGORITHM
  Affected: dcmnet
  Type of modification: Disables feature
  Explanation: By default, DCMTK disables the so-called Nagle algorithm
    for each DICOM transport connection.  This provides a 2-4 times
    performance improvement (WinNT4/SP4, 100Mbit/s Ethernet).  Effects on
    other environments are unknown.  When compiled with this macro, the
    code affecting the Nagle algorithm is disabled.  See documentation
    for environment variable TCP_NODELAY in config/docs/envvars.txt.

Shaeto
Posts: 147
Joined: Tue, 2009-01-20, 17:50
Location: CA, USA
Contact:

#3 Post by Shaeto »

of course, but by default this code is "defined" and runs. i think this block is harmful for modern OS.

J. Riesmeier
DCMTK Developer
Posts: 2501
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

#4 Post by J. Riesmeier »

Ok, I will add this issue to our to-do list ...

J. Riesmeier
DCMTK Developer
Posts: 2501
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: NAGLE

#5 Post by J. Riesmeier »

This issue has been fixed with commit ffecd24. See commit message for details.

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 1 guest