V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
xbdsky
V2EX  ›  Redis

Linux 1g 内存 redis 优化

  •  
  •   xbdsky ·
    xbdsky · 2017-03-09 14:16:27 +08:00 · 7225 次点击
    这是一个创建于 2576 天前的主题,其中的信息可能已经有所发展或是发生改变。

    QQ 截图 20170309140924.png
    网站主站用的 wordpress 跑的,加了 redis 内存跟 CPU 一路飙升,对 redis 这块不是很懂,希望大侠们指导下。
    redis.conf 就是默认的文件,没有配置 用的是这个插件, https://www.freehao123.com/redis-wordpress/

    26 条回复    2017-03-10 16:13:14 +08:00
    xbdsky
        1
    xbdsky  
    OP
       2017-03-09 14:25:40 +08:00
    已经 100%了,哎 ![QQ 截图 20170309140924.png]( https://ooo.0o0.ooo/2017/03/09/58c0f2069ec44.png)
    cevincheung
        2
    cevincheung  
       2017-03-09 14:28:49 +08:00
    允许公网访问还没密码就好玩了
    knightdf
        3
    knightdf  
       2017-03-09 14:29:52 +08:00
    1G 内存。。。把 redis 的内存上限限制一下把,然后 redis 中的 k-v 需要用 cache 清理策略
    sampeng
        4
    sampeng  
       2017-03-09 15:20:49 +08:00
    wordpress?直接静态化+CDN ,不理解 redis 用来干什么。
    ivmm
        5
    ivmm  
       2017-03-09 15:28:53 +08:00
    WP 的对象缓存不建议用 Redis ,还要走 tcp/tp

    推荐 APCu 搭配 Lcache , https://www.mf8.biz/wp-lcache/


    @sampeng 后台可以更流畅点
    numberwolf
        6
    numberwolf  
       2017-03-09 16:13:42 +08:00
    @cevincheung lz 可能是被挖矿机器人占满的
    numberwolf
        7
    numberwolf  
       2017-03-09 16:14:18 +08:00
    你 redis 允许公网访问吗? top 一下看看有没有奇怪的东西
    xbdsky
        8
    xbdsky  
    OP
       2017-03-09 16:44:50 +08:00
    @numberwolf <img src="https://ooo.0o0.ooo/2017/03/09/58c1156b1c2ed.png" /> 好像没什么奇怪的东西。
    xbdsky
        9
    xbdsky  
    OP
       2017-03-09 16:45:07 +08:00
    @ivmm 我试试
    feiyang21687
        10
    feiyang21687  
       2017-03-09 16:53:12 +08:00
    1 核?
    lslqtz
        11
    lslqtz  
       2017-03-09 17:08:03 +08:00
    @ivmm WP 我用静态缓存+OPCache+Memcache ,响应速度是非缓存 100ms ,缓存 20ms.
    numberwolf
        12
    numberwolf  
       2017-03-09 17:22:23 +08:00
    @xbdsky 你可以持续观察,不过应该没大的问题,建议 redis 取消外网访问加密码。
    小规模博客用 memcached 就可以了
    ivmm
        13
    ivmm  
       2017-03-09 17:40:36 +08:00   ❤️ 1
    @lslqtz Pantheon 的意思主要还是,当负载一高,访问量一高,走 TCP/IP 的话,就容易嗝屁,走 socket 肯定会好些
    xbdsky
        14
    xbdsky  
    OP
       2017-03-09 18:35:51 +08:00
    @numberwolf 安装好了,不能用,还在调试 ing...
    xbdsky
        15
    xbdsky  
    OP
       2017-03-09 18:36:40 +08:00
    @feiyang21687 是,自己的博客,为了省钱最低配置,以前内存 512M 的,后来升级到 1G 的,哈哈。
    RobertYang
        16
    RobertYang  
       2017-03-09 21:16:26 +08:00 via Android
    @ivmm 战略性 mark
    zts1993
        17
    zts1993  
       2017-03-09 21:20:21 +08:00
    内存啊。。。是不是没有设置 max memory 。。。。
    janxin
        18
    janxin  
       2017-03-09 21:27:11 +08:00
    没什么问题其实 redis 也没必要一定上
    PeterD
        19
    PeterD  
       2017-03-09 22:39:11 +08:00
    如果是 ssd 试试 ssdb.io
    CRVV
        20
    CRVV  
       2017-03-09 23:03:10 +08:00
    @ivmm 请教一下, socket 是什么?
    xbdsky
        21
    xbdsky  
    OP
       2017-03-09 23:53:23 +08:00
    @PeterD 好东西,谢谢分享。
    neoblackcap
        22
    neoblackcap  
       2017-03-10 02:18:57 +08:00
    @CRVV 大概是想说 unix domain socket 吧
    ivmm
        23
    ivmm  
       2017-03-10 10:01:18 +08:00
    @CRVV #22 楼的意思。
    CRVV
        24
    CRVV  
       2017-03-10 14:04:31 +08:00
    @ivmm

    Redis 支持 Unix domain socket
    ivmm
        25
    ivmm  
       2017-03-10 16:11:48 +08:00
    @CRVV 这样还得要支持 socket redis 的 WP 对象缓存软件支持。
    ivmm
        26
    ivmm  
       2017-03-10 16:13:14 +08:00
    @ivmm 唔,看了一下,插件是支持的。 看来我自己得再重新搞研究了
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3512 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 11:04 · PVG 19:04 · LAX 04:04 · JFK 07:04
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.