Generic in-memory persistence

From: Date: Wed, 19 Jul 2000 21:03:20 +0000
Subject: Generic in-memory persistence
Groups: php.general 
Request: Send a blank email to php-general+get-7337@lists.php.net to get a copy of this message
I have made good use of the wonderful pconnect function to connect to a MySQL database. The utility of this function is that it creates a connection that remains open across requests to the web server. The pconnect functions are evidently using some mechanism that is not available in general. I would, for example, like to open up other kinds of socket connections and have them remain open across requests. This eliminates all kinds of overhead when the connections need to be accessed by every page, but may take a little while to open up. What I miss in PHP is the ability to do things in the same way that FastCGI lets me do them. Using FastCGI, I can do some pre-script processing that may bring files into memory, open connections, etc, and then go ahead and run the script over and over again using the persistent stuff I set up previously, saving all of that setup time each time the script is run. Obviously it is possible to do this with PHP since something like it is being done to keep sql connections persistent, but it is not a general kind of mechanism at this point that can be used for file cacheing and opening other types of connections. Specifically, I want to be able to create an array of values (huge array) in memory and then leave it there across requests to the server. The array comes from an XML file. Right now I have to read it in every time, which is pretty quick, but concerns me because it is an extra step that would be unnecessary were I using FastCGI. Additionally, I have a custom server process that listens on a particular port. I want to be able to open up a connection to that process, similar to pconnect, and keep it open across requests, since opening it incurs some overhead each time that I would like to avoid. Has anyone run into this? What are you doing to work around it? Am I missing something that is simply not documented, yet? Thanks, Chris

« previous php.general (#7337) next »