Date: Mon, 10 Mar 2003 11:50:07 +0300 (MSK) From: Igor Sysoev <is@rambler-co.ru> To: Peter Jeremy <peterjeremy@optushome.com.au> Cc: arch@FreeBSD.ORG Subject: Re: Should sendfile() to return EAGAIN? [patch] Message-ID: <Pine.BSF.4.21.0303101149001.86151-100000@is> In-Reply-To: <20030310072318.GA3343@cirb503493.alcatel.com.au>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 10 Mar 2003, Peter Jeremy wrote: > Looking at FreeBSD, the only standard application that uses sendfile(2) > is ftpd(8) - and it doesn't care what the actual errno is. The libc_r > wrapper would need to be modified though and there may be ports that > use sendfile(2). ftpd(8) will not get ENOBUFS because it uses the blocking sockets. libc_r wrapper and sendfile() patch in the thttpd port are under the control so it can be modified to use SF_ENOBUFS flag and to understand ENOBUFS condition. But I think there are many in-house high perfomance solutions that use kqueue() and sendfile(). If they handle too many simultaneous slow connections with sendfile() then after FreeBSD upgrade they start to eat CPU without any visible reasons (in EAGAIN case) or will broke (in ENOBUFS case). > > By the same token, it seems more correct to me > >to signify to the app that the OS is maxed (ENOBUFS) as opposed to the > >client being maxed (EAGAIN). ::shrug:: > > The descriptions of the errors (from intro(2)) are: > 35 EAGAIN Resource temporarily unavailable. This is a temporary condi- > tion and later calls to the same routine may complete normally. > 55 ENOBUFS No buffer space available. An operation on a socket or pipe > was not performed because the system lacked sufficient buffer > space or because a queue was full. > > Whilst both errors cover the situation, "ENOBUFS" provides more > information to the caller and I would therefore consider it as the > preferred error. Yes, ENOBUFS is the good candidate but it should be enabled via flag. Igor Sysoev http://sysoev.ru/en/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0303101149001.86151-100000>