Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Apr 2001 17:55:45 +1000 (EST)
From:      Rowan Crowe <rowan@sensation.net.au>
To:        Sean Chittenden <sean-freebsd-isp@chittenden.org>
Cc:        freebsd-isp@freebsd.org
Subject:   Re: boa small/fast web server
Message-ID:  <Pine.BSF.4.21.0104161730180.84938-100000@velvet.sensation.net.au>
In-Reply-To: <20010415192728.B11573@rand.tgd.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 15 Apr 2001, Sean Chittenden wrote:

Hello Sean,

> 	Boa's an excellent static content web server, I've been very
> impressed with its performance and hackability (just make sure that
> you know it can get any file that's world readable).  How many file
> descriptors do you have?  -sc

How do I check this? I presume you mean free descriptors, no extra options
in my kernel.

> > Is anyone else using Boa having this problem? Any tips in general on how
> > to optimise FreeBSD 4.2R for Apache and/or Boa? It's basically a stock
> > GENERIC kernel with non relevant devices removed. Boa was compiled from
> > original archive rather than via the ports collection, so that may be an
> > issue too.
> 
> 	Do you have different IPs for boa and apache?  You should be
> able to compile boa from src or ports.  I personally would recommend
> using ports, but that's up to you.

They're on separate IPs, both on port 80. The ports and source version of
Boa is identical, and the only patches appear to be some minor path
changes, and the following in Makefile:

  -LDFLAGS = @LIBS@ -g
  -CFLAGS = -O -Wall -g
  +LDFLAGS = @LIBS@
  +CFLAGS = @CFLAGS@

It doesn't compile 100% cleanly out of the box:

y.tab.c: In function `yyparse':
y.tab.c:314: warning: implicit declaration of function `yylex'

boa_lexer.l: In function `yylex':
boa_lexer.l:82: warning: implicit declaration of function `yyerror'
boa_lexer.l: At top level:
lex.yy.c:1175: warning: `yyunput' defined but not used

get.c: In function `get_cachedir_file':
get.c:335: warning: long int format, int arg (arg 5)

request.c: In function `get_request':
request.c:79: warning: large integer implicitly truncated to unsigned type

util.c: In function `get_commonlog_time':
util.c:141: warning: assignment makes integer from pointer without a cast

request.o: In function `process_header_end':
/usr/src/boa-0.94.8.3/src/request.c(.text+0x9fc): warning: tmpnam() possibly used unsafely; consider using mkstemp()

index_dir.c: In function `index_directory':
index_dir.c:141: warning: passing arg 3 of `scandir' from incompatible pointer type


> > This is the same machine that was crashing a while back, it's now running
> > on all DIMM instead of SIMM+DIMM and it's been running well, just rarely
> > above 0% idle. Boa has changed that, but at what cost...
> 
> 	boa shouldn't be a problem, I've had a hacked boa server
> pushing 2000 connections a second on a P200 IDE box.  It's probably
> kernel tweaking that needs to happen.  -sc

This is a Cyrix 233 underclocked to 150MHz, 128Mb RAM, 10Gb IDE HD, 10Mbit
generic NE2000 compatible card. The site is sending out approximately
12-14Gb of data daily, the bulk of that being 10-20k images. The
underclocking was an attempt to fix the crashing problems, which have not
reoccurred since I removed all SIMM memory; I haven't yet changed the
clock speed back.

The machine is not just serving static content, it's also generating HTML
on the fly (via PHP) and running 111 background processes to fetch webcam
images and process them, so the load can momentarily spike or dip even
when there is a relatively constant stream of HTTP fetching.

last pid: 36124;  load averages: 16.60, 27.51, 30.73    up 0+19:02:47 17:51:51
280 processes: 22 running, 257 sleeping, 1 zombie
CPU states: 36.2% user,  0.0% nice, 47.0% system, 16.4% interrupt,  0.4% idle
Mem: 75M Active, 9052K Inact, 29M Wired, 5508K Cache, 22M Buf, 4528K Free
Swap: 256M Total, 5176K Used, 251M Free, 1% Inuse

Note the idle state and the small amount of swap used. The number of
processes may also be an issue.

Any pointers on where to start with tweaking? Thanks for your help...

The site is http://www.camrecord.com/ if you want to see an example of
images being missed. ;\

Cheers.


--
Rowan Crowe                              http://www.rowan.sensation.net.au/
Sensation Internet Services                   http://info.sensation.net.au/
Melbourne, Australia                                 Phone: +61-3-9388-9260


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-isp" in the body of the message




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