LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 04-23-2009, 01:32 PM   #1
mmmike123
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.
 
  


Reply



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:05 PM.

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