Re: Shared Memory in PHP
| From: | Bogdan Stancescu | Date: | Sat, 14 Dec 2002 02:08:11 +0000 |
| Subject: | Re: Shared Memory in PHP | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-128234@lists.php.net to get a copy of this message | ||
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! :)
Regards,
Bogdan
Krishnan wrote:
Hi all,I am new to PHP and would like the expert opinion of this forum onsomething 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 oneach (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 entries).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 PHP4.1.x)Ideally, I'd like to implement a hash (to use a PERL term) inshared memory that is accessible from PHP.Is this proposed approach too outrageous?Any thoughts on this would be greatly appreciated. TIA Krishnan