Memcached Experimental Paper

Source: Internet
Author: User

While talking at this age memcached it may be a little late, the most cached in the app Redis above, here will talk about some of your own views,

This file is not memcached theoretical description, only the experimental data and results are written.


Basic parameters: Able to take the test (with # # for the number of participants to be mastered)

-U # #<num> monitor udpport (default: 11211, 0 for non-listening)-S #<file> UNIX socket path for listening (disable network support)-a #<mask> UNIX socket access Mask, octal number (default: 0700)-L # #<ip_addr> The IP address of the listener. (Default: Inaddr_any. All addresses)-D # #作为守护进程来执行. -R # #最大核心文件限制. -U # #<username> sets the user to which the process belongs. (Only the root user can use this parameter)-M # #<num> the maximum available memory for a single data item, in megabytes.

(Default: 64MB)-M #内存用光时报错. (no data is deleted)-C # #<num> Maximum number of concurrent connections.

(Default: 1024x768)-K #锁定全部内存页.

Note the upper limit of memory that you can lock. # #试图分配很多其它内存会失败的, so be aware of the user-assignable memory limit that is used when the daemon is started.

# # (not the previous-u <username> parameters.) Under SH, use the command "ulimit-s-L num_kb" to set. )-V #提示信息 (prints the error/warning message in the event loop.) -VV #具体信息 (also print client command/response)-VVV #超具体信息 (also prints changes in the internal state)-H #打印这个帮助信息并退出.

-I. #打印memcached和libevent的许可. -P # #<file> Save the process ID to the specified file. It only makes sense when you use the-D option. -F #<factor> block size growth factor. (Default: 1.25)-n #<bytes> the minimum space assigned to Key+value+flags (default:-)-L #尝试使用大内存页 (if available).

Increasing the memory page size can reduce the number of page table buffer (TLB) misses and improve execution efficiency. #为了从操作系统获得大内存页, memcached will assign all data items to a large chunk. -D #<char> uses <char> as a delimiter for prefixes and IDs. #这个用于按前缀获得状态报告. The default is ":" (colon).

#假设指定了这个參数, the State collection is initiated on its own, assuming it is not specified. You need to use the command "stats detail on" to open.

-T # #<num> the number of threads used (default: 4)-R # #每一个连接可处理的最大请求数.

  -X #  #repcached used to specify the configuration of the master IP:-X <IP>
  -X #  #repcached used to specify the configuration of the master PORT:-X <PORT>

Implementation results:

The realization adopts two machines-master, master-Slave, three-machine, packet-capture analysis to obtain:

##### #配置 # master 1 memcached-d-v-m 100-u root-l 192.168.1.253-p 12000-c 1024-x 192.168.1.254-x 11212-p/tmp/memcached. pid# from 2 memcached-d-v-m 100-u root-l 192.168.1.254-p 12001-c 1024-p/tmp/memcached.pid-x 192.168.1.253-x 11212## Conclusion when the two main steps are taken from the repcache-memcached, both can get, set, and so on at the same time # #结论2 # when a master accidentally stops memcached (in the experiment with kill), when you start memcached again there will be a memory in the CO PY a real-time data into self-memory--Important # #结论3 # Assuming that the memcached that do not specify the-x-x parameter is stopped, [will not] replicate data in the other memcached in memory # #结论4 # 192.168.1                      .253 (12000) [-X 192.168.1.254-x 11212] <--------> 192.168.1.254 (12001) [-X 192.168.1.253-x 11212]#|                                                               |#                       |                                                               |#                       | |# 192.168.1.243 (12002) [-X 192.168.1.253-x 11212 or-x 192.168.1.254-x 11212] None Chengdu # # Experiment Conclusion: Repcache D can only do two copies can only master-Master mode or master-slave mode # repcached cannot single-master-dual-mode, cannot double-master multi-mode # #结论5 # Repcached-memcached data Synchronization Low-level use TCP long link to send data, the data is in clear State # #结论6 # repcached-memcached from at startup, from the first to take advantage of the configuration of-x-x specified ip,port with the host to establish a TCP persistent connection, # The link is established to send the memory data to send from, a piece of memory data sent, # The last message sent from the main, tell from the data has been sent, from the initialization of memory data and start to provide services. # #结论7 # using Iptables to simulate the disconnection process # when disconnected from the network to the recovery state, Dual-master environment can synchronize memory data again # when disconnected from the network to the recovery state, the dual slave environment, only from the synchronization of the primary memory data and the master does not synchronize from the memory data (completely by the-x-x to specify a new TCP connection to synchronize) # Synchronous recovery of the normal use of miscellaneous



Copyright notice: This article Bo Master original articles, blogs, without consent may not be reproduced.

Memcached Experimental Paper

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.