|
Posted by Marcin Dobrucki on 09/16/05 11:12
nospammmer@gmail.com wrote:
> I'm looking for a way to improve dramatically the performance of my PHP
> application. The application is getting slow as it is taking more load.
> It is performing a very high number of queries to a database, and I
> believe that this is taking up most of the ressources.
Faith should not be an issue here. You need to get your load display
tools out, and see where the bottleneck is. This will vary on your OS.
Look out for disk transactions, and also for raw data transfers.
> I'm trying to figure out how I could cache the content of the database
> and prevent that many queries to be performed.
With MySQL, you could try to edit my.cnf and radically increase the
cache sizes. Storing entire DB in cache will help, but only if you
really had disk bottlenecks somewhere.
> Or would I be better to place a copy of the database on a ramdrive?
Most likely: NO.
You would have to be absolutely pedanitc about making sure your
server doesn't crash (loads of UPS behind it, make sure OS is stable
enough, etc).
Since you are doing very much selects, and your hardware can't copy,
you could also try to build DB replication, and split the SELECT queries
between multiple servers. But that's a bit of work, so I'd suggest
trying something else first.
/Marcin
[Back to original message]
|