数据存储(假设key为test,value为12345)

  1. printf "set test 0 0 5\r\n12345\r\n" | nc 127.0.0.1 12000

STORED

数据取回(假设key为test)

  1. printf "get test\r\n" | nc 127.0.0.1 12000

VALUE test 0 5

12345

END

数值增加1(假设key为test,并且value为正整数)

  1. printf "incr test 1\r\n" | nc 127.0.0.1 12000

12346

数值减少3(假设key为test,并且value为正整数)

  1. printf "decr test 3\r\n" | nc 127.0.0.1 12000

12343

数据删除(假设key为test)

  1. printf "delete test\r\n" | nc 127.0.0.1 12000

DELETED

查看Memcached状态

  1. printf "stats\r\n" | nc 127.0.0.1 12000

STAT pid 3025

STAT uptime 4120500

STAT time 1228021767

STAT version 1.2.6

STAT pointer_size 32

STAT rusage_user 433.463103

STAT rusage_system 1224.515845

STAT curr_items 1132460

STAT total_items 8980260

STAT bytes 1895325386

STAT curr_connections 252

STAT total_connections 547850

STAT connection_structures 1189

STAT cmd_get 13619685

STAT cmd_set 8980260

STAT get_hits 6851607

STAT get_misses 6768078

STAT evictions 0

STAT bytes_read 160396238246

STAT bytes_written 260080686529

STAT limit_maxbytes 2147483648

STAT threads 1

END

模拟top命令,查看Memcached状态:

  1. watch "printf 'stats\r\n' | nc 127.0.0.1 12000"

或者

  1. watch "echo stats | nc 127.0.0.1 12000"

Memcached常用命令及使用说明——netcat的更多相关文章

  1. memcached 常用命令及使用说明

    1.启动Memcache 常用参数 -p <num> 设置TCP端口号(默认设置为: ) -U <num> UDP监听端口(默认: , 时关闭) -l <ip_addr& ...

  2. Memcached常用命令及使用说明(转)

    一.存储命令 存储命令的格式: 1 2 <command name> <key> <flags> <exptime> <bytes> < ...

  3. Memcached常用命令及使用说明

    一.存储命令 存储命令的格式: 1 2 <command name> <key> <flags> <exptime> <bytes> < ...

  4. Memcached总结三:Memcached常用命令及使用说明

    一.存储命令 存储命令的格式: 1 2 <command name> <key> <flags> <exptime> <bytes> < ...

  5. 转:Memcached常用命令及使用说明

    一.存储命令 存储命令的格式: 1 2 <command name> <key> <flags> <exptime> <bytes> < ...

  6. memcached常用命令

    详见:http://blog.yemou.net/article/query/info/tytfjhfascvhzxcyt104 一.Memcache面向对象的常用接口包括:Memcache::con ...

  7. memcached的常用命令

    memcached 常用命令及使用说明   1.启动Memcache 常用参数 -p <num> 设置TCP端口号(默认设置为: 11211) -U <num> UDP监听端口 ...

  8. memecached常用命令

    memcached 常用命令及使用说明 1.启动Memcache 常用参数 -p <num> 设置TCP端口号(默认设置为: 11211) -U <num> UDP监听端口(默 ...

  9. memcached的安装、常用命令以及在实际开发中的案例

    Memcached注意缺乏安全认证以及安全管制需要将Memcached服务器放置在防火墙(iptables)之后 Linux平台 (CentOS)安装Memcached 安装依赖yum -y inst ...

随机推荐

  1. python测试开发django-13.操作数据库(增删改查)

    前言 django的models模块里面可以新增一张表和字段,通常页面上的数据操作都来源于数据库的增删改查,django如何对msyql数据库增删改查操作呢? 本篇详细讲解django操作mysql数 ...

  2. OCP-1Z0-051-题目解析-第22题

    22. You need to create a table for a banking application. One of the columns in the table has the fo ...

  3. svn各种箭头的含义

    黄色感叹号(有冲突):      有冲突了,冲突就是你对某个文件进行了修改,别人也对这个文件进行了修改,别人抢在你提交之前先提交了,这时你再提交就会被提示发生冲突,而不允许 你提交,防止你的提交覆盖了 ...

  4. Android使用代码模拟HOME键的功能

    Intent intent= new Intent(Intent.ACTION_MAIN); intent.addCategory(Intent.CATEGORY_HOME); intent.addF ...

  5. Java生成8位随机邀请码,不重复

    public static String[] chars = new String[] { "a", "b", "c", "d&q ...

  6. Asp.Net Core WebAPI入门整理(四)参数获取

    一.总结整理,本实例对应.Net Core 2.0版本 1.在.Net Core WebAPI 中对于参数的获取及自动赋值,沿用了Asp.Net  MVC的有点,既可以单个指定多个参数,右可以指定Mo ...

  7. 第一章 AOP

    关于AOP,通常我们会使用AspectJ注解来做,共有6中切面 前置:@Before 后置:@After 返回值:@AfterReturing 异常:@AfterThrowing 环绕:@Around ...

  8. 单因素方差分析(One Way ANOVA)

    Analysis of variance (ANOVA) is a collection of statistical models and their associated estimation p ...

  9. [转]Windows 下 Apache Virtual hosts 简单配置

    From : http://blog.csdn.net/wuerping/article/details/4164362 /* Author : Andrew.Wu [ Created on : 20 ...

  10. Host-Only模式

    Host-Only模式 在Host-Only模式下,虚拟网络是一个全封闭的网络,它唯一能够访问的就是主机.其实Host-Only网络和NAT网络很相似,不同的地方就是Host-Only网络没有NAT服 ...