Re: Shared Memory For Optimization
| From: | Dan Larsen | Date: | Wed, 04 Oct 2000 00:17:17 +0000 |
| Subject: | Re: Shared Memory For Optimization | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-18496@lists.php.net to get a copy of this message | ||
IMHO:
Shared memory should only be used, if you really have the amount of memory
that is required...
say loading a large db into mem would really slow down the server, if it
starts swapping... the reason for the 200+ and down to 18 is, that instead
of reading from the db constantly, it is stored in mem, and only accessed
from mem, unless somebody changes something in the db... the ups is, that a
hole lot of stuff only has to be read into memory once, and will then be
accesible for all, and a lot faster than from the db.... downs... the cost
of RAM :o)
A trick is to figure out what data from the db is used often and almost
never changed and then only take that information and put it in the shared
memory... and stuff that requires time-consuming queries too... :o)
I haven't used shared memory that much, so PLZ correct me if I'm way off...
:o)
> I have heard that one person was able to bring a script down from 200+
> queries to only 18 SQL queries using shared memory feature in PHP4. I
> was wondering what are the ups/downs of this? What are other ways to
> lessen the number of queries to a db other than restructuring the db?
> Is there some way trick such as loading the db into memory perhaps?
> Thanks.
/Dan Larsen