Return-Path: X-Original-To: apmail-httpd-cvs-archive@www.apache.org Delivered-To: apmail-httpd-cvs-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 737F8DE04 for ; Thu, 15 Nov 2012 16:49:30 +0000 (UTC) Received: (qmail 87299 invoked by uid 500); 15 Nov 2012 16:49:30 -0000 Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 87231 invoked by uid 500); 15 Nov 2012 16:49:29 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 87211 invoked by uid 99); 15 Nov 2012 16:49:29 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Nov 2012 16:49:29 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Nov 2012 16:49:26 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 405AD23889FD; Thu, 15 Nov 2012 16:49:05 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1409878 - in /httpd/httpd/trunk/server/mpm: event/event.c eventopt/eventopt.c Date: Thu, 15 Nov 2012 16:49:04 -0000 To: cvs@httpd.apache.org From: jim@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20121115164905.405AD23889FD@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: jim Date: Thu Nov 15 16:49:04 2012 New Revision: 1409878 URL: http://svn.apache.org/viewvc?rev=1409878&view=rev Log: Prefer higher-mode polling, but allow for drop down to default Modified: httpd/httpd/trunk/server/mpm/event/event.c httpd/httpd/trunk/server/mpm/eventopt/eventopt.c Modified: httpd/httpd/trunk/server/mpm/event/event.c URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/event/event.c?rev=1409878&r1=1409877&r2=1409878&view=diff ============================================================================== --- httpd/httpd/trunk/server/mpm/event/event.c (original) +++ httpd/httpd/trunk/server/mpm/event/event.c Thu Nov 15 16:49:04 2012 @@ -1951,6 +1951,7 @@ static void *APR_THREAD_FUNC start_threa int loops; int prev_threads_created; int max_recycled_pools = -1; + int good_methods[] = {APR_POLLSET_KQUEUE, APR_POLLSET_PORT, APR_POLLSET_EPOLL}; /* We must create the fd queues before we start up the listener * and worker threads. */ @@ -1989,18 +1990,34 @@ static void *APR_THREAD_FUNC start_threa } /* Create the main pollset */ - rv = apr_pollset_create(&event_pollset, - threads_per_child, /* XXX don't we need more, to handle + for (i = 0; i < sizeof(good_methods) / sizeof(void*); i++) { + rv = apr_pollset_create_ex(&event_pollset, + threads_per_child*2, /* XXX don't we need more, to handle * connections in K-A or lingering * close? */ - pchild, APR_POLLSET_THREADSAFE | APR_POLLSET_NOCOPY); + pchild, APR_POLLSET_THREADSAFE | APR_POLLSET_NOCOPY | APR_POLLSET_NODEFAULT, + good_methods[i]); + if (rv == APR_SUCCESS) { + break; + } + } + if (rv != APR_SUCCESS) { + rv = apr_pollset_create(&event_pollset, + threads_per_child*2, /* XXX don't we need more, to handle + * connections in K-A or lingering + * close? + */ + pchild, APR_POLLSET_THREADSAFE | APR_POLLSET_NOCOPY); + } if (rv != APR_SUCCESS) { ap_log_error(APLOG_MARK, APLOG_ERR, rv, ap_server_conf, "apr_pollset_create with Thread Safety failed."); clean_child_exit(APEXIT_CHILDFATAL); } + ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ap_server_conf, APLOGNO() + "start_threads: Using %s", apr_pollset_method_name(event_pollset)); worker_sockets = apr_pcalloc(pchild, threads_per_child * sizeof(apr_socket_t *)); Modified: httpd/httpd/trunk/server/mpm/eventopt/eventopt.c URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/eventopt/eventopt.c?rev=1409878&r1=1409877&r2=1409878&view=diff ============================================================================== --- httpd/httpd/trunk/server/mpm/eventopt/eventopt.c (original) +++ httpd/httpd/trunk/server/mpm/eventopt/eventopt.c Thu Nov 15 16:49:04 2012 @@ -1940,6 +1940,7 @@ static void *APR_THREAD_FUNC start_threa int loops; int prev_threads_created; int max_recycled_pools = -1; + int good_methods[] = {APR_POLLSET_KQUEUE, APR_POLLSET_PORT, APR_POLLSET_EPOLL}; /* We must create the fd queues before we start up the listener * and worker threads. */ @@ -1967,18 +1968,35 @@ static void *APR_THREAD_FUNC start_threa } /* Create the main pollset */ - rv = apr_pollset_create(&event_pollset, - threads_per_child, /* XXX don't we need more, to handle + for (i = 0; i < sizeof(good_methods) / sizeof(void*); i++) { + rv = apr_pollset_create_ex(&event_pollset, + threads_per_child*2, /* XXX don't we need more, to handle + * connections in K-A or lingering + * close? + */ + pchild, APR_POLLSET_WAKEABLE|APR_POLLSET_NOCOPY|APR_POLLSET_NODEFAULT, + good_methods[i]); + if (rv == APR_SUCCESS) { + break; + } + } + if (rv != APR_SUCCESS) { + rv = apr_pollset_create(&event_pollset, + threads_per_child*2, /* XXX don't we need more, to handle * connections in K-A or lingering * close? */ pchild, APR_POLLSET_WAKEABLE|APR_POLLSET_NOCOPY); + } if (rv != APR_SUCCESS) { ap_log_error(APLOG_MARK, APLOG_ERR, rv, ap_server_conf, "apr_pollset_create failed; check system or user limits"); clean_child_exit(APEXIT_CHILDFATAL); } + ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ap_server_conf, APLOGNO() + "start_threads: Using %s", apr_pollset_method_name(event_pollset)); + worker_sockets = apr_pcalloc(pchild, threads_per_child * sizeof(apr_socket_t *));