Memcache and memcached

Source: Internet
Author: User
Tags cas memcached

  • Service side
    Server is memcached, is written in C language, directly installed.
  • Client
    If you want to connect to the memcached server, you need to install the dependent Operations Library Libmemcache and libmemcached before the client installs.
    Here say the difference between Libmemcache and libmemcached
    1) First Libmemcache, after the libmemcached
    2) The former development utilization is relatively high
    3) libmemcached use more secure , and the memory consumption is small, theoretically better than Libmemcache
    Client:
    Here is an example of PHP connecting to memcached Server client: Memcache and memcached
    are both extensions of PHP, are maintained by the official PHP, but there are differences:
    1) based on the operation of the library, Memcache is based on Ibmemcache development (native), memcached extension is based on the Libmemcached Library development, support CAS operations, CAS operations can be processed when multiple threads concurrently modify the same key value.
    2) MC supports object-oriented and process-oriented two sets of interface operation service side. While the MCD extension supports only object-oriented operations
    3) memcached supports binary Protocol, and Memcache does not support it. or a different library. Theoretically, this means that the memcached will have higher performance. The
    sets the binary protocol through $m->setoption (Memcached::opt_binary_protocol,true).
    Most users still use text protocols, which is relatively simple and stable. The use of binary in practice is still relatively small.
    Common denominator: MCD extension provides session Processing module: Provides a session handler
    uses options when statically compiling to PHP--disable-memcache-session You can turn off session support for Memcache (enabled by default)
  • Installation
    This does not mention how to install the contents of the extension, only to mention the installation process considerations:
    When compiling both the memcache and memcached extensions, you need to specify the installation path of the Libmemcached library or the Libmemcache library. So pre-installed libmemcached (the memcache extension relies on the Libmemcache library) is a prerequisite for compiling this extension. Remember to compile and install it first. Specify the installation directory with--with-libmemcached-dir=dir to specify the path as follows. This path is the value of the prefix specified when installing libmemcached (prefix is the specified installation directory)
    If you do not specify this path entry, you will go to the default standard installation directory of these libraries (I do not know to XXX), so it is best to specify the location of the library to install (strong controllability, later encountered problems to facilitate troubleshooting reasons, such as previously compiled PHP using pcre extension, preferably using the PHP engine built-in Pcre library, Using the Linux system above, the coding support problem is easy to appear.
  • Memcache and memcached

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.