Results 1 to 8 of 8
-
08-04-2006, 06:54 AM #1Web Hosting Master
- Join Date
- Dec 2005
- Posts
- 550
how smart is it to store sessions in APC [php]?
i'm not really sure if it is the right thing to do. love to hear from you guys.
-
08-04-2006, 06:56 AM #2Web Hosting Master
- Join Date
- Dec 2005
- Posts
- 550
by the way, i'm still storing the sessions in database.
If apc fails, it will fall over to the database.
I'm just caching the value in apc so php can get the session data from apc instead of hitting the database.
-
08-04-2006, 10:08 PM #3Web Hosting Master
- Join Date
- Mar 2005
- Location
- Athens, Greece
- Posts
- 1,763
I have not experience with APC, but (I think) it is safer to keep your sessions in the database. So, it depends on the app and the security level you wish to have.
▌ Managed.gr cloud hosting, paas, vps, dedicated, domain registration on global datacenters.
-
08-06-2006, 08:05 PM #4Web Hosting Master
- Join Date
- Nov 2004
- Location
- Australia
- Posts
- 1,737
What's "APC"? Is that different from the default PHP behaviour of keeping the sessions in flat files in /tmp?
-
08-06-2006, 08:25 PM #5Web Hosting Master
- Join Date
- Mar 2005
- Location
- Athens, Greece
- Posts
- 1,763
APC stands for Alternative PHP Cache - it is cache framework.
Find more at www.php.net/apc▌ Managed.gr cloud hosting, paas, vps, dedicated, domain registration on global datacenters.
-
08-07-2006, 02:37 PM #6Web Hosting Master
- Join Date
- Dec 2004
- Location
- New York City, NY, USA
- Posts
- 735
My understanding is that APC is a bytecode compiler and cache--which has absolutely NOTHING to do with sessions. APC effectively caches source code, not values, so unless you have self-modifying code I don't see what APC and session storage have to do with each other.
Samat Jain | Rhombic Networks, LLC - Partner, CTO
-
08-07-2006, 03:16 PM #7Web Hosting Master
- Join Date
- Dec 2005
- Posts
- 550
It can be used as a general cache like memcache.
see apc_fetch and apc_store.
-
08-07-2006, 03:56 PM #8Web Hosting Master
- Join Date
- Dec 2004
- Location
- New York City, NY, USA
- Posts
- 735
Originally Posted by grabmail
AFAIK it still works differently than memcached... APC relies on POSIX shared memory, while memcached does not, which generally means APC will be slower than memcached.
But none of this has to do with your original question--if you're saving to both the database and APC, it's probably no harm to get a performance boost of querying APC for reads. I'd say go for it.Samat Jain | Rhombic Networks, LLC - Partner, CTO