On 22 Oct 2008, at 22:19, Martin Zvarík wrote:
I became confused after an hour trying to understand the PHP cache
solutions.
XCache, APC, eAccelerator and others are opcode cache systems... is
memcache in the same category? or is it completely different?
Memcache is completely different in that it's not an opcode cache,
it's an in-memory volatile cache for arbitrary key => value data with
a client-server API.
If I install for example XCache, set it for certain directory... it
will automatically cache the website into the memory. What happens
if the memory will get full?
First of all you need to get it clear in your head what an opcode
cache is actually doing. It does not "cache the website", it caches
the compiled version of the PHP scripts such that PHP doesn't need to
recompile each file every time it's included which is the default way
PHP works.
Secondly, if you run out of memory you buy more!! But seriously, you'd
need a very very very big site to have this problem. An opcode cache
of a PHP script will generally take less space than the script itself.
So if you're worried about it simply get the total size of all the PHP
scripts in your site and you'll see that even on modest hardware
you'll have a lot of headroom. Obviously you need to take other users
of the server into account, especially if you're on a shared hosting
account, but in most cases you won't have a problem.
-Stut
--
http://stut.net/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php