Memcache Stats Description

Source: Internet
Author: User
Tags cas md5 memcached serialization
Memcache Common methods
Memcache::add &MD Ash; Adds a value that returns false if it already exists
Memcache::add server-Add a server address to use
Memcache::close-closes a Memcache object
memcache::connect-Create a Memcache object
Memcache::d ebug-control Debugging function
Memcache::d ecrement-to subtract values from a key that is saved
Memcache: Delete a key value:d elete-
memcache::flush-clears all cached data
Memcache:: get-get a key value
memcache::getextendedstats-get run System statistics for all processes in the process pool
memcache::getserverstatus-get the parameters to run the server
memcache::getstats-returns some running statistics for the server
memcache::getversion-returns the version information of the running Memcache
memcache::increment-an addition to the value in a key that is saved
Memcache: Create a Memcache Persistent connection object:p connect-
Memcache::replace-r Overwrite an existing key
memcache::set-Add a value, if it already exists, overwrite
memcache::setcompressthreshold-compression of data larger than a certain size
memcache::setserverparams-Modify server parameters at run time
Memcache method uses


Memcached Introduction:

Memcached is a high-performance, distributed memory object caching system. is often used to reduce database load pressures to increase the response speed of dynamic Web applications.

This extension uses the APIs provided by the Libmemcached library to interact with the memcached server. It also provides a session processor (memcached). It also provides a session processor


More information about libmemcached can be viewed in http://libmemcached.org/libMemcached.html.

Memcache Requirements:

This extension requires a libmemcached client library.

Memcache Installation:

Information about installing this PECL extension can be found in the manual in the installation section titled PECL Extensions. Additional information, such as new releases, downloads, source files, Additional information such as new releases, maintenance personnel information and change logs, are here: http://pecl.php.net/package/memcached.

If libmemcached is installed on a non-standard path, using--with-libmemcached-dir=dir to specify the path, dir is the prefix parameter for libmemcached installation. This path needs to contain file include/libmemcached/memcached.h.

Zlib is required if you want to support compression. For zlib libraries with non-standard installations, use--with-zlib-dir=dir to specify the zlib installation path, and dir is the prefix parameter for ZIB installation.

The session processor's support is turned on by default. If you want to close it, use the option--disable-memcached-session.

Predefined constants:

The following constants are defined by this extension and are available only if this extension is compiled into PHP or dynamically loaded at run time.

Memcached::opt_compression
Turn on or off the compression feature. When the value of the item exceeds a threshold (currently 100bytes), the value is compressed and then stored and decompressed and then returned when the value is obtained, making the compression transparent to the application layer.

Type: Boolean, default: TRUE.

Memcached::opt_serializer
Specifies the serialization tool that is serialized for a non-scalar value. The available values are memcached::serializer_php and memcached::serializer_igbinary. The latter only works when the--enable-memcached-igbinary option is turned on when the memcached is configured and igbinary extension is loaded.

Type: Integer, default: memcached::serializer_php.

memcached::serializer_php
The default PHP serialization tool (that is, the Serialize method).

Memcached::serializer_igbinary
»igbinary serialization tool. It stores PHP's data structure in a tightly binary form, improving both in time and space.

Memcached::serializer_json
JSON serialization requires PHP 5.2.10 or more.

Memcached::opt_prefix_key
Can be used to create a "domain" for the key. This value will be prefixed to each key, it cannot be longer than 128 characters, and will shorten the maximum allowable key length. This prefix is used only for the key of the element being stored, not for the server key.

Type: string, Default: "".

Memcached::opt_hash
Specifies the hash algorithm used by the storage element key. The available values are constants for the Memcached::hash_* series. Each hash algorithm has its advantages and disadvantages, using default values when you do not know or are unsure which algorithm is more advantageous to you.

Type: Integer, default: Memcached::hash_default

Memcached::hash_default
Default (Jenkins one-at-a-time) element key hash algorithm

Memcached::hash_md5
MD5 element key hash algorithm.

Memcached::hash_crc
CRC element Key hash algorithm.

Memcached::hash_fnv1_64
fnv1_64 element key hash algorithm.

Memcached::hash_fnv1a_64
fnv1_64a element key hash algorithm.

Memcached::hash_fnv1_32
FNV1_32 element key hash algorithm.

Memcached::hash_fnv1a_32
FNV1_32A element key hash algorithm.

Memcached::hash_hsieh
Hsieh element key hash algorithm.

Memcached::hash_murmur
Murmur element key hash algorithm.

Memcached::opt_distribution
Specifies how the element key is distributed to individual servers. At present, the method is supported by two kinds of consistent hash algorithms. The consistent hash algorithm provides better allocation policies and minimizes cache loss when adding servers to the cluster.

Type: Integer, default: Memcached::D istribution_modula.

Memcached::D Istribution_modula
The remainder distribution algorithm.

Memcached::D istribution_consistent
Consistent distribution algorithm (based on Libketama).

Memcached::opt_libketama_compatible
Turn on or off a compatible Libketama class behavior. When this option is turned on, the hash algorithm for element key will be set to MD5 and the distribution algorithm will use a consistent hash distribution with weight. This is useful because other Libketama-based clients, such as Python,urby, can access keys transparently on the same server-side configuration.

Note:

This option is strongly recommended if you want to use a consistent hash algorithm, and this option may be set to open in future releases.

Type: Boolean, default: FALSE.

Memcached::opt_buffer_writes
Turn the I/O cache on or off. Opening the I/O cache causes the store command to be stored in a buffer instead of actually sending it. Any retrieval data operation will cause the data in the cache to be sent to the remote server. Exiting the connection or shutting down the connection can also cause the cached data to be sent to the remote server.

Type: Boolean, default: FALSE.

Memcached::opt_binary_protocol
Open using binary protocol. Please note that this option cannot be toggled on an open connection.

Type: Boolean, default: FALSE.

Memcached::opt_no_block
Turn asynchronous I/O on or off. This will maximize the transfer speed of the storage function.

Type: Boolean, default: FALSE.

Memcached::opt_tcp_nodelay
Turn on or off the delay-free characteristics of connected sockets (in some illusions it can lead to speed increases).

Type: Boolean, default: FALSE.

Memcached::opt_socket_send_size
The maximum value that the socket sends a buffer.

Type: Integer, Default: Depending on the different platform/kernel configuration

Memcached::opt_socket_recv_size
The socket receives the maximum buffer value.

Type: Integer, Default: Depending on the different platform/kernel configuration

Memcached::opt_connect_timeout
The value set here in non-blocking mode is the timeout period for the socket connection, in milliseconds.

Type: Integer, default: 1000.

Memcached::opt_retry_timeout
The time, in seconds, to wait for the failed connection retry.

Type: integer, default: 0.

Memcached::opt_send_timeout
Socket send timeout, in milliseconds. In this case, you cannot use non-blocking I/O, which will allow you to still have data to send out timeouts.

Type: integer, default: 0.

Memcached::opt_recv_timeout
The socket read timeout, in milliseconds. In this case, you cannot use non-blocking I/O, which will allow you to still have the data read out of time.

Type: integer, default: 0.

Memcached::opt_poll_timeout
Poll connection timeout, in milliseconds.

Type: Integer, default: 1000.

Memcached::opt_cache_lookups
Turns on or disables the DNS lookup cache.

Type: Boolean, default: FALSE.

Memcached::opt_server_failure_limit
Specifies the limit of the number of failed retries for a server connection. This server will be removed from the server pool after the failure of this number has been reached.

Type: integer, default: 0.

Memcached::have_igbinary
Indicates whether the serialization of Igbinary is supported.

Type: Boolean.

Memcached::have_json
Indicates whether the serialization of JSON is supported.

Type: Boolean.

Memcached::get_preserve_order
A tag for Memcached::getmulti () and Memcached::getmultibykey () is used to ensure that the key returned is consistent with the key order of the request. A key that does not exist will get a null value.

Memcached::res_success
The operation was successful.

Memcached::res_failure
Some way the operation failed.

Memcached::res_host_lookup_failure
DNS lookup failed.

Memcached::res_unknown_read_failure
Failed to read network data.

Memcached::res_protocol_error
The wrong memcached protocol command.

Memcached::res_client_error
Client error.

Memcached::res_server_error
Service-side error.

Memcached::res_write_failure
Failed to write data to the network.

Memcached::res_data_exists
Compare and exchange value operation failure (CAS method): Attempting to store data to the server failed because it was changed since the last time the key was taken from this connection.

Memcached::res_notstored
The element is not stored, but not because of an error. This usually indicates that the add (element already exists) or replace (element does not exist) stores data failure or that the element is already in a deletion sequence (deferred deletion).

Memcached::res_notfound
Element was not found (when through get or CAS operations).

Memcached::res_partial_read
Local network data read error.

Memcached::res_some_errors
An error occurred while the multiple key was being fetched.

Memcached::res_no_servers
The server pool is empty.

Memcached::res_end
The result set is at the end.

Memcached::res_errno
System error.

Memcached::res_buffered
The operation is cached.

Memcached::res_timeout
The operation timed out.

memcached::res_bad_key_provided
An invalid key was supplied.

Memcached::res_connection_socket_create_failure
Failed to create network socket.

Memcached::res_payload_failure
Cannot compress/decompress or serialize/deserialize a value.



The running state of the memcache can be easily displayed with the stats command.
First connect memcache with a command such as Telnet 127.0.0.1 11211, and then enter stats directly to get the status of the current memcache.
These states are described as follows:

Pid Memcache The process ID of the server
Uptime Number of seconds the server has been running
Time Server's current UNIX timestamp
Version Memcache version
Pointer_size The current operating system pointer size (32-bit system is typically 32bit)
Rusage_user Cumulative user time for the process
Rusage_system Cumulative system time of the process
Curr_items The number of items currently stored by the server
Total_items Total number of items stored since server startup
bytes The number of bytes consumed by the current server storage items
Curr_connections The number of connections currently open
Total_connections Number of connections that have been opened since the server was started
Connection_structures Number of connection constructs that the server assigns
Cmd_get Get command (gets) the total number of requests
Cmd_set Set command (save) number of total requests
Get_hits Total Hit Count
Get_misses Total missed Hits
Evictions Number of items deleted to get free memory (the space allocated to memcache needs to be removed from the old items to get space allocated to new items)
Bytes_read Total Read bytes (number of bytes requested)
Bytes_written Total Bytes sent (result bytes)
Limit_maxbytes Size of memory allocated to Memcache (bytes)
Threads Current number of threads

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.