Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Oct 2001 20:53:54 -0700
From:      Sean Chittenden <sean@chittenden.org>
To:        "Haapanen, Tom" <tomh@metrics.com>
Cc:        Marcel Prisi <marcel-lists@virtua.ch>, Scott Gerhardt <scott@gerhardt-it.com>, freebsd-isp@FreeBSD.ORG
Subject:   Re: PostgreSQL & shared memory
Message-ID:  <20011012205354.D99867@rand.tgd.net>
In-Reply-To: <6B3C6B6F7AA2D511A35E0080C8699343597B@syncro.metrics.com>; from "tomh@metrics.com" on Fri, Oct 12, 2001 at = 11:25:07PM
References:  <6B3C6B6F7AA2D511A35E0080C8699343597B@syncro.metrics.com>

next in thread | previous in thread | raw e-mail | index | archive | help
> > A) Apache + mod_perl + mod_php4 = ~12-25MB processes
> > B) Apache + mod_backhand = ~500KB (300KB shared!)
> > [...]
> > 	When you say this box is loaded, are we talking .5M hits?  
> > That's not too much for a box of this caliper if the architecture is
> > done right.  If you're pushing 5-6M over a single system.. then you're
> > getting a tad gutsy and I'd think about getting another box, but I doubt
> > that's the case and you'd probably be having disk IO issues before you
> > had CPU or RAM issues (logging and DB at the same time don't play
> > friendly).
> 
> Our Apache/Apache::ASP/DBI/MySQL web server handles about 7M hits in a
> typical month, and some fairly heavy database traffic.  We split onto two
> systems: a web server (everything but MySQL) and a database server (MySQL
> only)

Oooh!!!  Yeah, see... I meant hits per day.  Few orders of magnitude 
different, but, the reasoning is still the same.

> - Web server: Alpha 164SX/533, 320 MB, NetBSD 1.4
> - Database server: P3/700, 512 MB, FreeBSD 4.3

Few points (if you don't mind the criticism):

1)  Alpha on NetBSD?  Why not FreeBSD?  It should be faster, but you may
have some hardware needs that require it.

2) Splitting up the work between servers based on the application, while 
nice, doesn't really utilize your resources correctly.  If you can 
cluster your webservers together at all, then that'd be the best thing 
to do.  I use mod_backhand to do this and I stick my PPro 200 right next 
to a few dual K6's and PIII's and the cluster takes advantage of the 
hardware when appropriate.

http://www.modbackhand.org/

Example:
http://www.modbackhand.org/backhand/

> We haven't been clever about doing network buffering, but the web server
> does quite nicely, in spite of the 10 MB httpd processes.  Only if the
> database server is not reachable does it start running out of memory.

Just think, you could increase your throughput by at least 20X just by 
adding such a buffer... 

> On the database side, I think MySQL is lighter that PostgreSQL -- and it's
> threaded.  I have a hard time getting it to use all the memory on the
> server.  :-) 

That's a religious debate in the making. :)  It really depends on your
data and your application.  If you're working with less than 3 tables in
any application and with data sets less than 500K, then MySQL is
faster... anything beyond that, however and you're into PostgreSQL land
(which isn't that much slower actually than MySQL: we're about to port
everything off of MySQL to Postgres because the speed difference is less
than 5% now).

> Our CPU utilization is low -- as long as you design your database and your
> SQL queries right.  And this can really make a huge difference.  Our front
> page (the most complex page on the site) takes about 1.5s to process, due to
> more than a dozen SQL queries.  But before tuning it might have taken 10-20
> seconds ...

Good point.  If any of the data can be prejoined into a flat SQL table, 
then you could get those load times down even further (at the cost of a 
little disk space).

> Memory is cheap.  And servers aren't much more expensive ... but even the
> best hardware will bog down if your software sucks up all the power!

;)  -sc

-- 
Sean Chittenden

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?20011012205354.D99867>