From owner-freebsd-apache@FreeBSD.ORG Tue Dec 15 00:08:45 2009 Return-Path: Delivered-To: apache@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91E4E10656BD for ; Tue, 15 Dec 2009 00:08:45 +0000 (UTC) (envelope-from bkw@weisshuhn.de) Received: from smtp.weisshuhn.net (snat.weisshuhn.net [87.193.194.94]) by mx1.freebsd.org (Postfix) with ESMTP id 108FA8FC16 for ; Tue, 15 Dec 2009 00:08:44 +0000 (UTC) Received: from localhost (unknown [127.0.0.1]) by smtp.weisshuhn.net (Postfix) with ESMTP id 55360C0086; Mon, 14 Dec 2009 23:45:51 +0000 (UTC) X-Virus-Scanned: amavisd-new at weisshuhn.de X-Spam-Flag: NO X-Spam-Score: -4.375 X-Spam-Level: X-Spam-Status: No, score=-4.375 required=5 tests=[ALL_TRUSTED=-1.8, AWL=0.024, BAYES_00=-2.599] autolearn=ham Received: from smtp.weisshuhn.net ([127.0.0.1]) by localhost (smtp.weisshuhn.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0Qk5y1Ak2MuM; Tue, 15 Dec 2009 00:45:48 +0100 (CET) Received: from bkw.ivpn.weisshuhn.net (bkw.ivpn.weisshuhn.net [10.11.12.6]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by smtp.weisshuhn.net (Postfix) with ESMTP id 15ACBC007D; Tue, 15 Dec 2009 00:45:48 +0100 (CET) Message-Id: From: =?ISO-8859-1?Q?Bernhard_Wei=DFhuhn?= To: apache@FreeBSD.org Content-Type: multipart/mixed; boundary=Apple-Mail-2372--940695039 Mime-Version: 1.0 (Apple Message framework v936) Date: Tue, 15 Dec 2009 00:45:46 +0100 X-Mailer: Apple Mail (2.936) Cc: Subject: FreeBSD Port: www/apache20 X-BeenThere: freebsd-apache@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Support of apache-related ports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2009 00:08:45 -0000 --Apple-Mail-2372--940695039 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Hi, this my first submission to bsd ports, so please be gentle if I do not follow the right procedure, and don't hesitate to point me towards the proper way to do propose patches. Attached You'll find a packport from the apache trunk that removes the locking of the RewriteLog file. Original commit (including a link explaining the rationale behind this): http://svn.apache.org/viewvc?view=revision&revision=783734 This behaviour can be a problem under heavy load, as we just witnessed. Maybe you want to include this in your port. kind regards, bkw --Apple-Mail-2372--940695039 Content-Disposition: attachment; filename="patch-modules:rewrite:mod_rewrite.c" Content-Type: application/octet-stream; x-unix-mode=0644; name="patch-modules:rewrite:mod_rewrite.c" Content-Transfer-Encoding: 7bit --- modules/mappers/mod_rewrite.c.orig 2009-12-14 23:31:04.000000000 +0100 +++ modules/mappers/mod_rewrite.c 2009-12-14 23:49:59.000000000 +0100 @@ -142,7 +142,6 @@ static const char *lockname; static apr_global_mutex_t *rewrite_mapr_lock_acquire = NULL; -static apr_global_mutex_t *rewrite_log_lock = NULL; /* Optional functions imported from mod_ssl when loaded: */ static APR_OPTIONAL_FN_TYPE(ssl_var_lookup) *rewrite_ssl_lookup = NULL; @@ -990,24 +989,6 @@ /* check if proxy module is available */ proxy_available = (ap_find_linked_module("mod_proxy.c") != NULL); - /* create the rewriting lockfiles in the parent */ - if ((rv = apr_global_mutex_create(&rewrite_log_lock, NULL, - APR_LOCK_DEFAULT, p)) != APR_SUCCESS) { - ap_log_error(APLOG_MARK, APLOG_CRIT, rv, s, - "mod_rewrite: could not create rewrite_log_lock"); - return HTTP_INTERNAL_SERVER_ERROR; - } - -#ifdef MOD_REWRITE_SET_MUTEX_PERMS - rv = unixd_set_global_mutex_perms(rewrite_log_lock); - if (rv != APR_SUCCESS) { - ap_log_error(APLOG_MARK, APLOG_CRIT, rv, s, - "mod_rewrite: Could not set permissions on " - "rewrite_log_lock; check User and Group directives"); - return HTTP_INTERNAL_SERVER_ERROR; - } -#endif - rv = rewritelock_create(s, p); if (rv != APR_SUCCESS) { return HTTP_INTERNAL_SERVER_ERROR; @@ -1060,12 +1041,6 @@ } } - rv = apr_global_mutex_child_init(&rewrite_log_lock, NULL, p); - if (rv != APR_SUCCESS) { - ap_log_error(APLOG_MARK, APLOG_CRIT, rv, s, - "mod_rewrite: could not init rewrite log lock in child"); - } - /* create the lookup cache */ cachep = init_cache(p); } @@ -3499,7 +3474,6 @@ request_rec *req; char *ruser; const char *rhost; - apr_status_t rv; va_start(ap, text); conf = ap_get_module_config(r->server->module_config, &rewrite_module); @@ -3564,20 +3538,8 @@ (unsigned long)(r->server), (unsigned long)r, type, redir, level, str2); - rv = apr_global_mutex_lock(rewrite_log_lock); - if (rv != APR_SUCCESS) { - ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, - "apr_global_mutex_lock(rewrite_log_lock) failed"); - /* XXX: Maybe this should be fatal? */ - } nbytes = strlen(str3); apr_file_write(conf->rewritelogfp, str3, &nbytes); - rv = apr_global_mutex_unlock(rewrite_log_lock); - if (rv != APR_SUCCESS) { - ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, - "apr_global_mutex_unlock(rewrite_log_lock) failed"); - /* XXX: Maybe this should be fatal? */ - } va_end(ap); return; --Apple-Mail-2372--940695039 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit --Apple-Mail-2372--940695039--