Wednesday, 29 February 2012

PHP APC LOCKING


The full name of this Representational state transfer (REST). it's state less .we can do memory based caching through APC.The APC extension not only does opcode cache (speeds up your php scripts by caching the parsed php script), but it also provides a simple mechanism to store data in shared memory.

Alot of Type of REST Memcached is one of them:-
Memcached is a cache server originally developed by the LiveJournal people and now being used by sites like Digg, Facebook, Slashdot and Wikipedia.


It's working given below :-
Memcached consists of a server and a client part.. The server is a standalone program that runs on your servers and the client is in this case a PHP extension.

If you have 3 webservers which all run Memcached, all webservers connect to all 3 memcached servers. The 3 memcache servers are all in the same 'pool'.

The cache servers all only contain part of the cache. Meaning, the cache is not replicated between the memcached servers.

To find the server where the cache is stored (or should be stored) a so-called hashing algorithm is used. This way the 'right' server is always picked.

Every memcached server has a memory limit. It will never consume more memory than the limit. If the limit is exceeded, older cache is automatically thrown out (if the TTL is exceed or not).

This means it cannot be used as a place to simply store data.. The database does that part. Don't confuse the purpose of the two!

Memcached runs the fastest (like many other applications) on a Linux 2.6 kernel.
By default, memcached is completely open.. Be sure to have a firewall in place to lock out outside ip's, because this can be a huge security risk.


No comments:

Post a Comment