From owner-freebsd-questions@FreeBSD.ORG Thu May 3 17:17:44 2007 Return-Path: X-Original-To: questions@freebsd.org Delivered-To: freebsd-questions@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 965EE16A407 for ; Thu, 3 May 2007 17:17:44 +0000 (UTC) (envelope-from dudu.meyer@gmail.com) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.170]) by mx1.freebsd.org (Postfix) with ESMTP id 1D68213C487 for ; Thu, 3 May 2007 17:17:43 +0000 (UTC) (envelope-from dudu.meyer@gmail.com) Received: by ug-out-1314.google.com with SMTP id 71so412844ugh for ; Thu, 03 May 2007 10:17:42 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=XAacRyZxaL0urLw6rULUfLjxPTwLcLXrxB9wuUyiS4qaM7wGkAStD+KLS7+K/NixtcZD2xq9cjX/2NnrPj3IzdRbE5K2JTNkQKgWkioMRapJ18WkvEPCVVFTyTxK6FOYhTpJlgmXBKpPdPghdqlXBcQvVpD73kON5/9W2Ym6CRA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=WWsVebYGeo0v2O/RKp1RAjjV4mtpso7c2ATNe5mPg7192FbzGtZPPk1N0o8Yp3f9OJN2EOyG9iI6dAQdI4yVfl/FHsMfWAgdWgAO5FPgrb7bVFrl0IWrfEJRWWH8pcBY7pWNBqEuR+a2PRTaqWVdifqDQVzuCjyGhh6L8BNkwu0= Received: by 10.82.145.7 with SMTP id s7mr4374256bud.1178212662066; Thu, 03 May 2007 10:17:42 -0700 (PDT) Received: by 10.82.191.11 with HTTP; Thu, 3 May 2007 10:17:42 -0700 (PDT) Message-ID: Date: Thu, 3 May 2007 14:17:42 -0300 From: "Eduardo Meyer" To: "Bert JW Regeer" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <4639294F.7020409@ibctech.ca> Cc: hackers@freebsd.org, questions@freebsd.org Subject: Re: Apache2 Virtual Hosts and FreeBSD fd limits. X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 May 2007 17:17:44 -0000 On 5/3/07, Bert JW Regeer wrote: > > On May 3, 2007, at 9:30 AM, Eduardo Meyer wrote: > > >> # uname -a > > > > 5.5-STABLE FreeBSD 5.5-STABLE #6: Wed May 2 20:19:43 BRT 2007 > > > >> # apachectl -v > > > > Server version: Apache/2.0.59 > > Server built: May 2 2007 18:38:18 > > > >> > >> > I have raised maxfiles, but my openfiles do increase and the > >> problem > >> > with Apache persists. > >> > >> Does it only affect Apache? > > > > Certainly not. But my concert is Apache, and this is the only > > application this server runs. > > > > I have also compiled EXTRA_FLAGS=-DFD_SETSIZE=8192 (currently, it was > > 2048) and the results were just the same. > > > >> > >> Steve > >> > > > > > > > Since this is my first post to the mailling list, top post or bottom > post which one is preferred? > > If you have a problems with open file descriptors beccause of > VirtualHosts it is my guess that you are logging separately for each > vhost (both access, and error). The way I found to solve this was to > put it all in one file that is then split up into the separate files > using a perl script. It is called split-logfile and can be found > online, I believe it was in the Apache source tree. All you need to > change is instead of having seperate log files for each of them, you > have one log file (which outputs the information using the vhost name > as the first item on the line so that the perl script can sort it > through that), thus only one FD is used to log. > > LogFormat "%v %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User- > Agent}i\"" cvh > CustomLog /usr/local/logs/everything.log cvh > > So you can scale out to 5000 vhosts and not run into any limit > problems. For errors the splitting up is a bit more tricky, but you > should be able to get it done as well. Bert, This is an interesting approach. I will consider it. However I believe one day I will reach this limit again. So I think this is a matter that will demand some tuning in the future. Thanks for pointing this approach to avoid using too many FDs :) > > Good luck, > Bert JW Regeer -- =========== Eduardo Meyer pessoal: dudu.meyer@gmail.com profissional: ddm.farmaciap@saude.gov.br