Commit c75c8a0
By default set NoDelay and Lingerstate to 5 sec (#3000)
Set NoDelay=true to disable the Nagle algorithm and set Lingerstate to 5 seconds by default.
After careful evaluation of the PR provided by @sxleixer in #2882 we found that the default setting of the socket with NoDelay=false can not only cause issues on the client side, but also on the server side.
Due to the nature of Nagle's implementation the issue only occurs when many small service requests or responses are sent over the network. In that case, when packets are still in flight, the secondary small packets are delayed and combined until the MTU is exceeded or the previous packages are acknoledged.
The expectation in the UA protocol is to not add additional latency in the client-server communication.
As a conclusion defaulting to NoDelay=true appears to be the better default option which works for all use cases.
If there are new bandwidth issues related to more and larger packets imposed by this change, they should be solved at the UA application level by combining service requests of the same type.
Setting Lingerstate to 5 seconds should help to finish communications when sockets are closed.
Co-authored-by: @sxleixer <[email protected]>1 parent 37cebe3 commit c75c8a0
File tree
2 files changed
+20
-41
lines changed- Stack/Opc.Ua.Core/Stack/Tcp
2 files changed
+20
-41
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
667 | 667 | | |
668 | 668 | | |
669 | 669 | | |
670 | | - | |
671 | | - | |
672 | | - | |
673 | | - | |
674 | | - | |
675 | | - | |
676 | | - | |
677 | | - | |
678 | | - | |
679 | | - | |
680 | | - | |
681 | | - | |
682 | | - | |
683 | | - | |
684 | | - | |
685 | | - | |
686 | | - | |
687 | | - | |
688 | | - | |
689 | | - | |
690 | | - | |
691 | | - | |
692 | | - | |
693 | | - | |
694 | 670 | | |
695 | 671 | | |
696 | 672 | | |
697 | 673 | | |
698 | 674 | | |
699 | 675 | | |
700 | 676 | | |
701 | | - | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
702 | 682 | | |
703 | 683 | | |
704 | 684 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
577 | 577 | | |
578 | 578 | | |
579 | 579 | | |
580 | | - | |
581 | 580 | | |
582 | | - | |
583 | | - | |
584 | | - | |
585 | | - | |
586 | | - | |
587 | | - | |
588 | | - | |
589 | | - | |
590 | | - | |
591 | | - | |
| 581 | + | |
| 582 | + | |
592 | 583 | | |
593 | 584 | | |
594 | 585 | | |
595 | 586 | | |
596 | 587 | | |
597 | | - | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
598 | 592 | | |
599 | 593 | | |
600 | 594 | | |
| |||
628 | 622 | | |
629 | 623 | | |
630 | 624 | | |
631 | | - | |
632 | | - | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
633 | 632 | | |
634 | | - | |
| 633 | + | |
635 | 634 | | |
636 | | - | |
| 635 | + | |
637 | 636 | | |
638 | 637 | | |
639 | 638 | | |
| |||
0 commit comments