On Thu, 11 May 2000, Leslie Mikesell wrote:

[...]
> else that could be done on that hardware.  However I recently inherited
> another system that is falling on its face at a much lighter load.  It
> appears to be using tmp files to sort some ORDER BY clauses that
> I haven't had time to fix yet.   Is there any efficient way to pull
> the newest N items from a large/growing table as you do a join
> with another table?  As a quick fix I've gone to a static snapshot
> of some popular lists so I can control how often they are rebuilt. 

If at all possible avoid doing the database lookups per request in the
first place.

Very very often you can design whatever you do so the data can be in
static files exported every few [timeunit]s, you summarize the big
database in smaller tables, in Storable files or something like that.

If you can get your system to something like that it will scale a lot
better.

Likewise with sessions. Even if you load balance across multiple machines
you don't need to access a session database on every request. Most load
balancing systems have something so they'll send the seme "session"
(typically ip address) to the same backend server for N seconds as long as
the backend server is up of course.

You can then put a daemon on each backend server as a local buffer and
cache between the httpds and the session database. This daemon can even
load balance the session information over several databases if it's
needed.

viola, a lot less "real time" lookups in the database needed and a lot
less direct connections.


 - ask

-- 
ask bjoern hansen - <http://www.netcetera.dk/~ask/>
more than 70M impressions per day, <http://valueclick.com>

Reply via email to