Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 May 2007 12:02:36 -0400
From:      Bert JW Regeer <xistence@0x58.com>
To:        hackers@freebsd.org, questions@freebsd.org
Subject:   Re: Apache2 Virtual Hosts and FreeBSD fd limits.
Message-ID:  <CD0860EB-2993-4964-9EC6-F025B00A9EA6@0x58.com>
In-Reply-To: <d3ea75b30705030630w714b227av505d4f0ab7b8de6a@mail.gmail.com>
References:  <d3ea75b30705021531h2740fa27g4f194544ba49219@mail.gmail.com> <4639294F.7020409@ibctech.ca> <d3ea75b30705030630w714b227av505d4f0ab7b8de6a@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--Apple-Mail-1-184977756
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset=US-ASCII;
	delsp=yes;
	format=flowed


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
>>
>
>
> -- 
> ===========
> Eduardo Meyer
> pessoal: dudu.meyer@gmail.com
> profissional: ddm.farmaciap@saude.gov.br


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.

Good luck,
Bert JW Regeer
--Apple-Mail-1-184977756--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CD0860EB-2993-4964-9EC6-F025B00A9EA6>