Skip to content

Commit

Permalink
Do not set recbuf by default on listening sockets
Browse files Browse the repository at this point in the history
This patch removes a bug I experienced on FreeBSD during tests on the loopback
interface because of its MTU. So, I don't really know why that happens on
FreeBSD and not on Linux, but because loopback MTU is greater than the recbuf
value (16K on loopback vs 8k in Yaws), if a client sends data, Yaws will read
them very slowly.

Furthermore, there is no good reason to tweak this value by default. And, if
required, it is always possible to configure it.
  • Loading branch information
Christopher Faulet committed Jul 7, 2014
1 parent 8ff00fe commit 6e2a971
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion doc/yaws.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2519,7 +2519,7 @@ \section{Server Part}
\item \verb+nodelay = true | false+ (default: same as \verb+inet:setopts/2+)
\item \verb+priority = Integer+ (default: same as \verb+inet:setopts/2+)
\item \verb+sndbuf = Integer+ (default: same as \verb+inet:setopts/2+)
\item \verb+recbuf = Integer+ (default: 8196)
\item \verb+recbuf = Integer+ (default: same as \verb+inet:setopts/2+)
\item \verb+send_timeout = Integer | infinity+ (default: same as \verb+inet:setopts/2+)
\item \verb+send_timeout_close = true | false+ (default: same as \verb+inet:setopts/2+)
\end{itemize}
Expand Down
2 changes: 1 addition & 1 deletion include/yaws.hrl
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@
tilde_allowed_scripts = [],
index_files = ["index.yaws", "index.html", "index.php"],
revproxy = [],
soptions = [{listen_opts, [{backlog, 1024}, {recbuf, 8192}]}],
soptions = [{listen_opts, [{backlog, 1024}]}],
extra_cgi_vars = [],
stats, % raw traffic statistics
fcgi_app_server, % FastCGI application server {host,port}
Expand Down
2 changes: 1 addition & 1 deletion man/yaws.conf.5
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ accepted sockets. See \fIinet:setopts/2\fR for details. Supported options are:

\fBsndbuf = Integer\fR (default: same as \fIinet:setopts/2\fR)

\fBrecbuf = Integer\fR (default: 8196)
\fBrecbuf = Integer\fR (default: same as \fIinet:setopts/2\fR)

\fBsend_timeout = Integer | infinity\fR (default: same as \fIinet:setopts/2\fR)

Expand Down
1 change: 0 additions & 1 deletion src/yaws_revproxy.erl
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,6 @@ do_connect(URL) ->
binary,
{packet, raw},
{active, false},
{recbuf, 8192},
{reuseaddr, true}
],
case URL#url.scheme of
Expand Down

0 comments on commit 6e2a971

Please sign in to comment.