[nycphp-talk] Using shared data at the server level
CHUN-YIU LAM
chun_lam at hotmail.com
Sun Mar 16 13:10:11 EST 2003
maybe you can used shared memory?
lookup and shm_attach and related functions.
----Original Message Follows----
From: "Ophir Prusak" <ophir at prusak.com>
Reply-To: talk at nyphp.org
To: NYPHP Talk <talk at nyphp.org>
Subject: [nycphp-talk] Using shared data at the server level
Date: Fri, 14 Mar 2003 11:05:12 -0500
Received: from parsec.nyphp.org ([66.250.131.26]) by
mc6-f31.law1.hotmail.com with Microsoft SMTPSVC(5.0.2195.5600); Fri, 14 Mar
2003 08:05:49 -0800
Received: from nyphp.org (parsec.nyphp.org [66.250.131.26])by
parsec.nyphp.org (8.12.6/8.12.6) with ESMTP id h2EG5CJH042462for
<chun_lam at hotmail.com>; Fri, 14 Mar 2003 11:05:49 -0500 (EST)(envelope-from
null at nyphp.org)
X-Message-Info: JGTYoYF78jEHjJx36Oi8+Q1OJDRSDidP
Message-Id: <200303141605.h2EG5CJH042462 at parsec.nyphp.org>
X-Paralist-Archived: <http://nyphp.org/list/paralist_archive.php?L_mid=3458>
X-List-Software: Paralist 0.6
List-ID: <nyphptalk.nyphp.org>
List-Owner: <mailto:listmaster at nyphp.org>
List-Archive: <http://nyphp.org/list/paralist_archive.php?L_lid=2>
List-Subscribe: <http://nyphp.org/list/>
List-Unsubscribe: <http://nyphp.org/list/>
Organization: New York PHP
X-Mailer: Paramail 0.5
Return-Path: null at nyphp.org
X-OriginalArrivalTime: 14 Mar 2003 16:05:50.0172 (UTC)
FILETIME=[94E7C1C0:01C2EA43]
Hi All,
I'm looking for the best way to store non-critical frequently updated data
that needs to be shared across all php processes (on a single server).
Please notice I say frequently updated. If I'm just storing something that
only changes once every N requests (where N is a large number) then I'd just
use the file system since the OS caches that anyways.
For example, lets say I wanted to have a page counter on every page.
Ideally, I'd just have a variable which is read/write by any php process on
the server. Something like this:
$my_super_global ++;
print "this is page view $my_super_global";
One way is to use the file system.
This or course is pretty simple, but since the file needs to be updated
every single request, I'm thinking it would be faster to use memory.
Has anyone done anything like this ?
Does anyone know of any existing or built in packages can I use ?
thanx
ophir
--- Unsubscribe at http://nyphp.org/list/ ---
_________________________________________________________________
STOP MORE SPAM with the new MSN 8 and get 2 months FREE*
http://join.msn.com/?page=features/junkmail
More information about the talk
mailing list