Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 04-23-2009, 01:32 PM   #1
LQ Newbie
Registered: Apr 2009
Posts: 1

Rep: Reputation: 0
Question TCP tuning in Linux for non-blocking socket connection over long-path WAN

I have a Linux C-program with non-blocking TCP socket which
working well in local LAN network. But when used on long-path WAN
it has problem. The issue is NOT the increased latency by itself
(this was expected!) but that it start spending huge time inside OS
calls doing actual writing to non-blocked socket:
'strace' command's showing that actual write to non-blocking socket
with 5MB data is not returning back for ~20 sec!
[pid 28521] 03:29:57.153841 <... writev resumed> ) = 5120162 <22.158727>
[pid 28521] 03:30:19.697228 <... writev resumed> ) = 5120162 <21.291031>
[pid 28521] 03:30:38.645879 <... writev resumed> ) = 5120162 <18.348090>

What I was expecting that because of the WAN network latency the writing
will have congestion and returns with partial send within milliseconds,
then the same thread can handle multiple connections, but that's
not the case here and the thread is actually block with each write.

So the question here is why non-blocking connection socket's getting
block in write() call for so long to write WHOLE message rather than
only part of it? How can we change code or do tuning to obtain the
normal non-blocking behavior.
OS Info: Linux RHEL 4 with default configuration and default socket
options settings.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to kill tcp connection that nothing is going on the socket yuvalbm Linux - Networking 3 11-07-2006 07:32 AM
Linux webproxy/firewall and WAN connection RedPlanet Linux - Networking 1 01-28-2006 07:49 PM
plz help regarding TCP/IP socket progamming in LINUX kernel omkarlagu Programming 0 01-20-2006 08:03 AM
Linux TCP Socket swa_dur Linux - Networking 3 09-23-2005 11:03 AM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:58 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration