This is a discussion on Why we need Memcache? within the PHP Programming forums, part of the Web Development category; Hi, I want to know Why we need Memcache? can any one help me....
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| Hi, Actually memcached is a high-performance, distributed memory object caching system, generic in nature, but intended for use in speeding up dynamic web applications by alleviating database load. The threaded system allows memcached to utilize more than a single CPU and share the cache between all of them. It does this by having a very simple locking mechanism when certain values, items, etc need to be updated. This helps make multi gets more efficient, versus running multiple nodes on the same physical server to achieve performance.
__________________ With, J. Jeyaseelan Everything Possible |
| |||
| Memcached is a high-performance, distributed caching system. Although application-neutral, it's most commonly used to speed up dynamic Web applications by alleviating database load. Memcached is used on LiveJournal, Slashdot, Wikipedia and other high-traffic sites.
__________________ With, J. Jeyaseelan Everything Possible |
| |||
| Hi Falcon, If your Question Mr.jeyaseelansarc already replied.so please you refer to above Mr.jeyaseelansarc post.
__________________ Regards, Senraj.A Last edited by senraj : 04-24-2008 at 12:44 AM. |
| |||
| Actually Memcached is a high-performance, distributed caching system and used to speed up dynamic Web applications by alleviating database load.
__________________ With, J. Jeyaseelan Everything Possible |
| |||
| Hi, Actually memcached can be downloaded from its official page: memcached: download.
__________________ With, J. Jeyaseelan Everything Possible |
| |||
| Clients of memcached communicate with server through TCP connections. (A UDP interface is also available; details are below under "UDP protocol.") A given running memcached server listens on some (configurable) port; clients connect to that port, send commands to the server, read responses, and eventually close the connection.
__________________ With, J. Jeyaseelan Everything Possible |
| |||
| There is no need to send any command to end the session. A client may just close the connection at any moment it no longer needs it. Note, however, that clients are encouraged to cache their connections rather than reopen them every time they need to store or retrieve data. This is because memcached is especially designed to work very efficiently with a very large number (many hundreds, more than a thousand if necessary) of open connections. Caching connections will eliminate the overhead associated with establishing a TCP connection (the overhead of preparing for a new connection on the server side is insignificant compared to this).
__________________ With, J. Jeyaseelan Everything Possible Last edited by Jeyaseelansarc : 04-25-2008 at 01:46 AM. |
| |||
| There are two kinds of data sent in the memcache protocol: text lines and unstructured data. Text lines are used for commands from clients and responses from servers. Unstructured data is sent when a client wants to store or retrieve data. The server will transmit back unstructured data in exactly the same way it received it, as a byte stream. The server doesn't care about byte order issues in unstructured data and isn't aware of them. There are no limitations on characters that may appear in unstructured data; however, the reader of such data (either a client or a server) will always know, from a preceding text line, the exact length of the data block being transmitted.
__________________ With, J. Jeyaseelan Everything Possible |
| |||
| Text lines are always terminated by \r\n. Unstructured data is _also_ terminated by \r\n, even though \r, \n or any other 8-bit characters may also appear inside the data. Therefore, when a client retrieves data from a server, it must use the length of the data block (which it will be provided with) to determine where the data block ends, and not the fact that \r\n follows the end of the data block, even though it does.
__________________ With, J. Jeyaseelan Everything Possible |
| |||
| Hi, memcached memcached is used by very large, high profile websites such as Livejournal, Wikipedia and Facebook General purpose, scalable caching solution Extremely fast Extremely easy to use
__________________ Regards, Senraj.A |
| |||
| Hi, Universal memcached can be used with just about any programming language Runs on almost any box Multiple boxes can be deployed Can be used with PHP, Python, Perl, Java,c#,Ruby
__________________ Regards, Senraj.A |
| |||
| Hi, Usage pattern Store items with key and expire time Request item : found? return it! not found? produce item and store in cache If needed, create own expiration mechanism
__________________ Regards, Senraj.A |
| |||
| Hi, Limitations Cant dump contents of the cache Cache is not persistent Not redundant No security Max 1MB - 42 bytes cached object size (can be increased at compile time)
__________________ Regards, Senraj.A |
| |||
| Keys Data stored by memcached is identified with the help of a key. A key is a text string which should uniquely identify the data for clients that are interested in storing and retrieving it. Currently the length limit of a key is set at 250 characters (of course, normally clients wouldn't need to use such long keys); the key must not include control characters or whitespace.
__________________ With, J. Jeyaseelan Everything Possible |
| |||
| Actually storage commands (there are six: "set", "add", "replace", "append" "prepend" and "cas") ask the server to store some data identified by a key. The client sends a command line, and then a data block; after that the client expects one line of response, which will indicate success or faulure.
__________________ With, J. Jeyaseelan Everything Possible |
| |||
| Retrieval commands (there are two: "get" and "gets") ask the server to retrieve data corresponding to a set of keys (one or more keys in one request). The client sends a command line, which includes all the requested keys; after that for each item the server finds it sends to the client one response line with information about the item, and one data block with the item's data; this continues until the server finished with the "END" response line.
__________________ With, J. Jeyaseelan Everything Possible |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to delete memcache? | Kamalakannan | PHP Programming | 11 | 10-25-2007 11:30 PM |
| memcache commands and behavior | prasath | Database Support | 4 | 09-27-2007 12:04 AM |
| Phpaccelerator & Memcache | sivaramakrishnan | PHP Programming | 0 | 08-31-2007 07:59 AM |
| Memcache with Mysql | write2ashokkumar | Database Support | 0 | 08-02-2007 02:41 AM |
| memcache in PHP | DuraiBabu | PHP Programming | 6 | 07-18-2007 12:43 AM |