Re: How should I cache database data for php?

From: Date: Mon, 21 Jan 2002 16:18:19 +0000
Subject: Re: How should I cache database data for php?
References: 1 2 3 4 5  Groups: php.general 
Request: Send a blank email to php-general+get-81382@lists.php.net to get a copy of this message
> But at 300,000 page views a day, even if the caches only have a ttl of 1 > hour I'm still saving over %90 of the traffic from having to query the > database. > > During our busy times I have a bottle neck with the database maxing out > the CPU's, so If I can cut the queries the server won't be working as > hard, plus file I/O is faster than Database I/O so the site will be > faster even when it's not busy. As form the discussion i understand that you have several pages with huge views during a day. Also it seemes to me thÕ queries they produce are the same. There is a way to avoid big traffic between php <-> mysql. The way of doing this is to store page generated dynamically with a db query and replace php-script with saved page. You generate content dynamically, but for yourself only. Users get this page, but as a "static" one. The easiest way is to do it manually - copy current script to another location, execute it and save result html to former location. Nothing changes for user. The greatest way of doing this is 1. develope php-script for generating updated html from moved php-script and updating index.html (e.g. ;) 2. develope another script or program which will call the first one periodically (once an hour, e.g.) Valentin Petruchek (aki Zliy Pes) http://zliypes.com.ua mailto:val@zliypes.com.ua

« previous php.general (#81382) next »