Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 21 Mar 2002 15:56:25 -0800 (PST)
From:      emmanuel Duros <eduros@udcast.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   bin/36183: natd: cpu usage gets sky high 
Message-ID:  <200203212356.g2LNuPW26802@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         36183
>Category:       bin
>Synopsis:       natd: cpu usage gets sky high
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Mar 21 16:00:05 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     emmanuel Duros
>Release:        FreeBSD 4.4R
>Organization:
UDcast
>Environment:
FreeBSD box132 4.4-RELEASE FreeBSD 4.4-RELEASE
>Description:
     CPU usage may increase drasticaly especialy when public interface is a slow link.
>How-To-Repeat:
Use a dummynet pipe on a Ethernet interface with a limited bwdth on the outgoing packets (e.g. 50kbps). Start a tcp transfer from a server to the host which runs natd. 
Observe the natd cpu rate which increases...
>Fix:
I read the natd code and I am not sure the bug is due to natd...
During the transfer, the TCP ack packets fill up the pipe completely.
As soos as we are in this situation (pipe full) natd enters in a bad loop and the cpu uasge increases.

According to the comments in the source, the main loop will take care of the packets which could not be written. Unfortunately, the select does not behave as we would like it to behave:

Instead of waiting for the "write" to be available, the select indicates that socket is available for writing... Then the sendto fails for sending the packet, reenter in the main loop and so on...

Note that the socket is a sock_raw type, I wonder if this is a sufficient reason to inform that it is always possible to write on this socket. 
>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200203212356.g2LNuPW26802>