PHP Operation memcache Usage Test summary

Source: Internet
Author: User
Tags crc32 failover ini integer
1. Brief introduction

The Memcache module is an efficient daemon that provides procedural and object-oriented interfaces for memory caching, especially for reducing access to the database when designing Dynamic Web programs.

Memcache also provides processing for communication dialogs (Session_handler).

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

1.1.memcache List of configuration items in php.ini

memcache The list of configuration items in php.ini
Name Default value is variable Change Log
Memcache.allow_failover "1" Php_ini_all Available since Memcache 2.0.2.
Memcache.max_failover_attempts "20" Php_ini_all Available since Memcache 2.1.0.
Memcache.chunk_size "8192" Php_ini_all Available since Memcache 2.0.2.
Memcache.default_port "11211" Php_ini_all Available since Memcache 2.0.2.
Memcache.hash_strategy "Standard" Php_ini_all Available since Memcache 2.2.0.
Memcache.hash_function "CRC32" Php_ini_all Available since Memcache 2.2.0.
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 the PHP Manual php.ini configuration options.

1.2. The following is a brief explanation of the configuration items

Memcache.allow_failover Boolean

Whether a transparent failover to a different server is handled on an error (note: failover is a verb).

Memcache.max_failover_attempts integer

Define the number class settings and fetch data for the server, and only use it together with Memcache.allow_failover.

Memcache.chunk_size integer

The data will be transferred into chunks of the specified size (chunk_size), the smaller the value (chunk_size), the more requests for write operations, and if other unexplained slowdowns are found, try increasing this value to 32768.

Memcache.default_port string

When connecting to the Memcache server, the default TCP port is used if no port is specified.

Memcache.hash_strategy string

Controls which policy is used when mapping key to the server. Setting this value consistently allows the hash algorithm to consistently be used when the server accepts adding or removing variables from the pool without being remap. Set this value to the standard result when the old policy is used.

Memcache.hash_function string

Control which Hsah function is applied to the key map to the server process, the default value "CRC32" uses the CRC32 algorithm, while "FNV" indicates the use of the FNV-1A algorithm.

Session.save_handler string

Set this value to Memcache to determine the processing (session handler) used to use Memcache for communication dialogs.

Session.save_path string

Defines the separator symbol for each server link used for call storage, for example: "tcp://host1:11211, tcp://host2:11211".

Each server link can contain parameters that are accepted to the server, compared to servers that are added using Memcache::addserver (), such as: "tcp://host1:11211?persistent=1&weight=1& timeout=1& amp; Amp;retry_interval=15 ".

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.