Hi Krishnan!

I never tried using shared memory functions in PHP, but the problem is interesting in itself, and I do have a potential interest in the issue myself. So I went through the documentation on php.net and, since nobody else answered yet, I'll have a go at it.

Apparently the second option is better for not so complex stuff, based on user comments. Here, read this and the two subsequent replies: http://www.php.net/manual/en/ref.shmop.php##10524

Again, I never used these functions myself, so I may be speaking nonsense here - if anyone knows better, I'd also be glad to hear it! :)


Krishnan wrote:
Hi all,
       I am new to PHP and would like the expert opinion of this forum on
something that I am trying to do
I have about 500K entries (name,value pairs) for which I want ti implement a
very fast lookup. I have access to an Oracle database server but I am afraid
that it does not have any power to handle the volume.
      Instead I am thinking of loading these entries in shared memory on
each (Apache) web server and look it up from my PHP script. (I have enough
memory on the server to set aside enough shared memory area to hold these
         Going through the PHP Documentation, I find 2 sets of functions:
          1.shm_attach,shm_put_var,shm_get_var etc.
          2. shmop_open,shmop_write,shmop_read etc.
       Which set of functions is the correct one to use (I am running PHP
         Ideally, I'd like to implement a hash (to use a PERL term) in
shared memory that is accessible from PHP.
         Is this proposed approach too outrageous?
 Any thoughts on this would be greatly appreciated.


PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to