"Original", my memcache notes.

Source: Internet
Author: User
Tags failover memcached php download

These two days in learning memcache, manuals are in English, I translated a bit, the level is limited, I hope the Master to give treatise, thank you first.

Memcache functions Function Reference

============================================================

Brief introduction

The Memcache module provides a convenient interface for programs and objects for memory caching, especially when designing dynamic Web programs to reduce access to the database and efficiently a caching daemon.

The Memcache module also provides processing for communication dialogs (session handler).

More information about Memcache modules can be accessed from http://www.danga.com/memcached/.

------------------------------------------------------------

Demand

The functions used by this module include compression with zlib, so zlib must be installed.

PHP 4.3.3 or later can use the memcache extension.

------------------------------------------------------------

Installation

This PECL (PHP extended Common Library) extension is not bound to PHP. The information for installing this PECL extension library is available in the chapter titled PECL Extension Library installation in the manual. More information such as new versions, downloads, source files, maintainer information, and update logs can be found here:»http://pecl.php.net/package/memcache.

In order to use these functions you must compile PHP using the--enable-memcache[=dir] option to obtain memcache support.

You can use the option--disable-memcache-session to disable the processing (session handler) feature of the communication conversation.

Windows users can add Php_memcache.dll extensions to the php.ini to use these related functions. You can download the DLL file for this PECL extension from the»php download page or»http://snaps.php.net/.

------------------------------------------------------------

Run-time configuration

The behavior of these functions is affected by php.ini.

Memcache List of configuration items

Whether the name default value is variable change log

Memcache.allow_failover "1" php_ini_all Available since Memcache 2.0.2.

Memcache.max_failover_attempts "Php_ini_all" Available since Memcache 2.1.0.

Memcache.chunk_size "8192" Php_ini_all Available since memcache.

Memcache.default_port "11211" Php_ini_all Available since memcache.

Memcache.hash_strategy "Standard" Php_ini_all Available since memcache.

Memcache.hash_function "CRC32" Php_ini_all Available since memcache.

Session.save_handler "Files" Php_ini_all supported since Memcache 2.1.2

Session.save_path "" "Php_ini_all supported since Memcache 2.1.2

For further details and definitions of php_ini_* constants see PHP.ini configuration options.

The following is a brief explanation of the configuration options.

Memcache.allow_failover Boolean

Whether the obvious failover is handled on the other server when the error occurs.

Whether to transparently failover to the other servers on errors.

Memcache.max_failover_attempts integer

Define how many servers to try to set up and get the data. Used only in conjunction with Memcache.allow_failover.

Defines how many servers to try when setting and getting data. Used only in conjunction with Memcache.allow_failover.

Memcache.chunk_size integer

The data will be transferred into chunks of a specified size, and the more you set this value, the more network writes you are requesting. Set this value to 32768 if you are prompted for a deceleration that cannot be explained.

Data is transferred in chunks of this size and setting the value lower requires more network. Try increasing this value to 32768 if noticing otherwise inexplicable slowdowns.

Memcache.default_port string

Default TCP port number to use if no other port is specified when connecting to the memcached server

The default TCP port number to memcached server if no, connecting to the specified.

Memcache.hash_strategy string

Controls which policy is used when mapping key to the server. Set this value consistently so that a consistent hash algorithm is used to allow the server to accept the addition or deletion of variables in the pool will be unconditionally remap. Set this value to the standard result when the old policy is used.

The

Controls which strategy to is mapping keys to servers. Set this value to consistent to enable consistent hashing which allows servers to is added or removed from the pool Withou T causing keys to be remapped. Setting this value to standard results in the old strategy being used.

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.