Date: Sat, 29 Jul 2000 20:06:03 -0700 From: Paul Saab <paul@mu.org> To: new-httpd@apache.org, freebsd-stable@FreeBSD.ORG Cc: Alfred Perlstein <bright@wintelcom.net>, ym g <ymg@graffiti.net> Subject: Re: Zen regarding accept filters Message-ID: <20000729200603.A15316@elvis.mu.org> In-Reply-To: <20000730023025.B1386@hand.dotat.at>; from dot@dotat.at on Sun, Jul 30, 2000 at 02:30:25AM %2B0000 References: <20000729130953.10802.qmail@graffiti.net> <20000729104309.D21967@fw.wintelcom.net> <20000730023025.B1386@hand.dotat.at>
next in thread | previous in thread | raw e-mail | index | archive | help
This should also incorporate a check for __FreeBSD_version >= 410001.
Also, the fact that it breaks HTTP/0.9 isn't really a big deal if you
are going to enable this feature. Also, the code path for this is meant
to be quick and trying to make it support HTTP/0.9 will probably not be
worth the effort since this is done for performance and it really does
make a large difference on heavy hit sites.
If a browser only support HTTP/0.9, then I doubt they will be able to
even view most modern website.
--
Paul Saab
Technical Yahoo
paul@mu.org - ps@yahoo-inc.com - ps@freebsd.org
Do You .. uhh .. Yahoo!?
Tony Finch (dot@dotat.at) wrote:
> [I've crossposted this to new-httpd@apache.org and freebsd-stable@freebsd.org]
>
> The patch to enable accept filters in Apache is quite simple (see
> below) but unfortunately the httpready filter breaks support for
> HTTP/0.9. I'm going to try to fix it but until that is done I don't
> think the patch should go into Apache without alerting people to this
> fact and making them define BREAK_OLD_HTTP at compile time...
>
> Tony.
> --
> en oeccget g mtcaa f.a.n.finch
> v spdlkishrhtewe y dot@dotat.at
> eatp o v eiti i d. fanf@covalent.net
>
>
> --- apache-1.3/src/main/http_main.c 2000/07/29 23:56:19 1.507
> +++ apache-1.3/src/main/http_main.c 2000/07/30 02:26:25
> @@ -3398,6 +3398,34 @@
> exit(1);
> }
>
> +#if defined(SO_ACCEPTFILTER) && defined(BREAK_OLD_HTTP)
> + {
> + /*
> + * FreeBSD has a feature called "accept filters" which delay the
> + * return from accept() until a condition has been met, e.g. an
> + * HTTP request has arrived. This postpones the requirement for a
> + * child process to handle the new connection which therefore
> + * increases the number of connections that a given number of
> + * child processes can handle. It also allows a child process to
> + * accomplish more immediately after accept() returns (because the
> + * request is already available to be read) so there is less
> + * context switching. This feature was added to FreeBSD-4.1-STABLE
> + * on the 28th of July 2000.
> + */
> + struct accept_filter_arg af = {
> + "httpready", ""
> + };
> + if (setsockopt(s, SOL_SOCKET, SO_ACCEPTFILTER, &af, sizeof(af)) < 0) {
> + ap_log_error(APLOG_MARK, APLOG_CRIT, server_conf,
> + "make_sock: for %s, setsockopt: (SO_ACCEPTFILTER)",
> + addr);
> + close(s);
> + ap_unblock_alarms();
> + exit(1);
> + }
> + }
> +#endif
> +
> #ifdef WORKAROUND_SOLARIS_BUG
> s = ap_slack(s, AP_SLACK_HIGH);
>
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000729200603.A15316>
