


1、启动Memcache 常用参数
-p
-U
-d 以守护进程方式运行
-u
-m
-c
-v 输出警告和错误信息
-vv 打印客户端的请求和返回信息
-h 打印帮助信息
-i 打印memcached和libevent的版权信息
-l
-P
2、Memcache telnet 常用命令
COMMAND | DESCRIPTION | EXAMPLE |
---|---|---|
get | Reads a value | get mykey |
set | Set a key unconditionally | set mykey 0 60 5 |
add | Add a new key | add newkey 0 60 5 |
replace | Overwrite existing key | replace key 0 60 5 |
append | Append data to existing key | append key 0 60 15 |
prepend | Prepend data to existing key | prepend key 0 60 15 |
incr | Increments numerical key value by given number | incr mykey 2 |
decr | Decrements numerical key value by given number | decr mykey 5 |
delete | Deletes an existing key | delete mykey |
flush_all | Invalidate specific items immediately | flush_all |
Invalidate all items in n seconds | flush_all 900 | |
stats | Prints general statistics | stats |
Prints memory statistics | stats slabs | |
Prints memory statistics | stats malloc | |
Print higher level allocation statistics | stats items | |
stats detail | ||
stats sizes | ||
Resets statistics | stats reset | |
version | Prints server version. | version |
verbosity | Increases log level | verbosity |
quit | Terminate telnet session | quit |
3、stats命令详解
pid | memcache服务器的进程ID |
uptime | 服务器已经运行的秒数 |
time | 服务器当前的unix时间戳 |
version | memcache版本 |
pointer_size | 当前操作系统的指针大小(32位系统一般是32bit) |
rusage_user | 进程的累计用户时间 |
rusage_system | 进程的累计系统时间 |
curr_items | 服务器当前存储的items数量 |
total_items | 从服务器启动以后存储的items总数量 |
bytes | 当前服务器存储items占用的字节数 |
curr_connections | 当前打开着的连接数 |
total_connections | 从服务器启动以后曾经打开过的连接数 |
connection_structures | 服务器分配的连接构造数 |
cmd_get | get命令(获取)总请求次数 |
cmd_set | set命令(保存)总请求次数 |
get_hits | 总命中次数 |
get_misses | 总未命中次数 |
evictions | 为获取空闲内存而删除的items数(分配给memcache的空间用满后需要删除旧的items来得到空间分配给新的items) |
bytes_read | 总读取字节数(请求字节数) |
bytes_written | 总发送字节数(结果字节数) |
limit_maxbytes | 分配给memcache的内存大小(字节) |
threads | 当前线程数 |
4. Memcache startup tips
a: Monitor the intranet address
b: Modify the default port number
c: Set the maximum number of connections and maximum memory usage

在Web应用中,缓存是一个非常重要的技术。缓存可以大大减少数据库和服务器的负载,提高Web应用的性能。Memcache是一种高性能的分布式内存缓存系统,常用于Web应用中。在PHP中使用Memcache缓存,有时会出现一些问题,本文将介绍这些问题及其解决办法。问题一:无法连接到Memcache服务器在使用Memcache缓存时,第一个遇到的问题可能是无法连接

随着互联网的飞速发展,越来越多的应用程序需要面对大量的并发请求,如何提高应用的并发处理能力成为开发者们需要解决的问题。其中,利用Memcache缓存技术进行并发优化成为了相对较为流行的一种方案。Memcache是一种高效的缓存技术,适用于大型Web应用程序、数据库和分布式系统。其特点是将数据存储于内存中,以实现高速读写操作。在Web应用程序的数据访问过程中,

Memcache是一种在Web应用中常用的缓存技术,对于高并发的应用,它能够减轻数据库的压力,提高数据读取速度,降低系统响应时间。但是,在实际运用中,由于某些原因,会出现缓存数据被破坏的情况。本文主要从以下几个方面来讲述如何避免PHP应用中Memcache缓存技术出现数据损坏的情况。一、数据序列化通常情况下,我们将需要缓存的数据直接以对象形式存储到Memca

Memcache是一种开源的、分布式的缓存技术。它通过将数据存储在内存中,极大地提高了数据的访问速度,从而提升了网站的性能和响应速度。在PHP项目中,Memcache缓存技术也被广泛应用,并且取得了很好的效果。本篇文章将深入探讨Memcache缓存技术在PHP项目中的应用和实践。一、Memcache的原理和优势Memcache是一种内存缓存技术,它可以将数据

随着网络技术越来越发达,网站的访问量逐渐增多,为了提升用户体验,我们需要尽可能地减少网页的加载时间和传输数据的大小。其中,Gzip压缩算法是一种经典的数据压缩算法,可以在传输数据时将数据压缩,减少传输数据的大小,从而提升网页的加载速度和用户体验。在使用Gzip压缩算法来优化网站时,我们还可以结合PHP中的Memcache缓存技术来进一步提升网站的性能。一、G

随着互联网技术的不断发展,网站的用户访问量越来越大,带来的并发访问量也越来越高。为了应对这种高并发访问,常用的手段是使用缓存技术。而在PHP语言中,Memcache缓存技术是一种非常有效的解决方案。Memcache是一种分布式缓存系统,能够将大量的数据缓存在内存中,并能够从内存中快速读取,从而提高网站的响应速度和并发能力。在本文中,我们将介绍如何使用PHP中

随着互联网时代的到来,Web应用程序的访问量越来越大,同时性能也愈发成为用户优先考量因素之一。缓存技术因此应运而生。Memcache作为一种高性能、分布式的内存对象缓存系统,被广泛应用于Web开发中。在PHP中构建Memcache缓存架构,可大幅提升Web应用程序的性能和响应速度。下面我们将分为以下几个方面,阐述Memcache缓存技术在PHP中的构建方式。

随着互联网的普及和Web应用的广泛使用,面对高并发的访问压力,提高Web应用的负载均衡效率是必不可少的。在这样的背景下,缓存技术成为了提高Web应用效率的重要手段之一。而其中的Memcache缓存技术,以其高效、快速、易于使用等优点,逐渐成为了Web应用开发者们广泛采用的工具。那么,什么是Memcache缓存技术?它怎么使用?今天,我们就来探讨一下,如何使用


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SublimeText3 Linux new version
SublimeText3 Linux latest version

Notepad++7.3.1
Easy-to-use and free code editor

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

Dreamweaver CS6
Visual web development tools
