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

next in thread | previous in thread | raw e-mail | index | archive | help
On 5/3/07, Bert JW Regeer <xistence@0x58.com> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?d3ea75b30705031017t3d9ab540t73abb5fa49fd9d29>