• memcached在windows安装


    下载地址:

    http://s3.amazonaws.com/downloads.northscale.com/memcached-win64-1.4.4-14.zip
    http://s3.amazonaws.com/downloads.northscale.com/memcached-win32-1.4.4-14.zip

    1. 在终端(也即cmd命令界面)下输入 ‘c:memcachedmemcached.exe -d install’ 安装
    2. 再输入: ‘c:memcachedmemcached.exe -d start’ 启动。

    NOTE: 以后memcached将作为windows的一个服务每次开机时自动启动。这样服务器端已经安装完毕了。

    That is it, now your memcached server is installed and is listening to port 11211.

    There is one more thing left to do. By default, server is set to 64Mb memory limit, which is too small. To correct, go to Registry Editor and find key

    HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/memcached  Server .

    Change the ImagePath entry to:

    “C:/memcached/memcached.exe” -d runservice -m 512

    This way you will use 512 Mb memory limit for your server.

    停止memcached:

    D:wamp_win7inmemcached-win32-1.4.4-14> memcached.exe -d stop

    卸载memcached:

    D:wamp_win7inmemcached-win32-1.4.4-14> memcached.exe -d uninstall

    相关问题:
    1、设置最大占用内存后好像没起作用。
    -m tells memcached how much RAM to use for item storage (in megabytes). Note carefully that this isn't a global memory limit, so memcached will use a few % more memory than you tell it to. Set this to safe values. Setting it to less than 48 megabytes does not work properly in 1.4.x and earlier. It will still use the memory.

    2、在同一个程序集里将一个值放入到memcache里,马上去时可以取到,但是在另一个程序集里取的时候取不到,或者telnet也拿不到值。
    可能问题及解决办法:
    a. 存储的值序列化后不同类型,则需要将其更新为同一类型,建议使用同一的常见类型,如string,int等,放入string可以拼成一个xml字符串,然后到使用的时候在做解析
    b. 很有可能是memcache池已经满了,可以设置<socketPool minPoolSize="100" maxPoolSize="1000" connectionTimeout="00:10:00" deadTimeout="00:02:00"/>

    memcached基本参数设置:
    -p 监听的端口
    -l 连接的IP地址, 默认是本机
    -d start 启动memcached服务
    -d restart 重起memcached服务
    -d stop|shutdown 关闭正在运行的memcached服务
    -d install 安装memcached服务
    -d uninstall 卸载memcached服务
    -u 以的身份运行 (仅在以root运行的时候有效)
    -m 最大内存使用,单位MB。默认64MB
    -M 内存耗尽时返回错误,而不是删除项
    -c 最大同时连接数,默认是1024
    -f 块大小增长因子,默认是1.25
    -n 最小分配空间,key+value+flags默认是48
    -h 显示帮助

  • 相关阅读:
    golang学习笔记(7)--函数式编程
    golang学习笔记(6)--面向接口编程
    go语言学习笔记(5)--面向对象
    go语言学习笔记(4)--容器与字符串的基本概念
    go语言学习笔记(3)--简单的程序设计
    go语言学习笔记(2)--go语言语法细节与基本数据类型
    go语言学习笔记(1)--第一个go语言程序
    Linux学习笔记系列(1)
    Scrapy爬虫小demo总结
    python基础总结(6)
  • 原文地址:https://www.cnblogs.com/heric/p/5794322.html
Copyright © 2020-2023  润新知