Recommended Services
Amazon Web Services
LeanCloud
New Relic
ClearDB
xiaoyu9527
V2EX  ›  云计算

阿里云如何解决这个问题。

  •  
  •   xiaoyu9527 · Mar 28, 2018 · 3267 views
    This topic created in 2968 days ago, the information mentioned may be changed or developed.

    CPU 占用突然变高 带宽占用突然变高。

    然后网站打不开

    使用的是 CMSTOP

    我应该如何排查原因呢?

    14 replies    2018-03-29 11:07:47 +08:00
    xiaoyu9527
        1
    xiaoyu9527  
    OP
       Mar 28, 2018
    我目前使用的是 top 在实时观看。
    xiaoyu9527
        2
    xiaoyu9527  
    OP
       Mar 28, 2018
    突然 CPU 占用变高是 memcached 占用突然变高。。

    是 MEMCACHED 的漏洞么?
    xiaoyu9527
        3
    xiaoyu9527  
    OP
       Mar 28, 2018
    因为 memcached 只是本机使用

    所以用防火墙来处理

    方案三:(配置防火墙访问控制)

    如果 memcache 服务需要对外提供服务,则可以通过 iptables 进行访问控制,下面是只允许本机及外部 IP 1.1.1.1 访问:

    // accept
    iptables -A INPUT -p tcp -s 127.0.0.1 --dport 11211 -j ACCEPT
    iptables -A INPUT -p udp -s 127.0.0.1 --dport 11211 -j ACCEPT

    iptables -A INPUT -p tcp -s 1.1.1.1 --dport 11211 -j ACCEPT
    iptables -A INPUT -p udp -s 1.1.1.1 --dport 11211 -j ACCEPT

    // drop
    iptables -I INPUT -p tcp --dport 11211 -j DROP
    iptables -I INPUT -p udp --dport 11211 -j DROP

    // 保存规则并重启 iptables
    service iptables save
    service iptables restart
    utfqvfhpyygy
        4
    utfqvfhpyygy  
       Mar 28, 2018
    带宽变多,是内网的还会外网的
    看看请求有没有变多,
    如果请求没有变多,看看慢查询,什么语句卡主了
    xiaoyu9527
        5
    xiaoyu9527  
    OP
       Mar 28, 2018
    @utfqvfhpyygy 外网带宽 跑满。CPU 占用到 30% 然后我人工守着 TOP 看。 是 MEMECACHED 突然占用变成 60%。

    理论上我们这个站访问量(几千 IP )不至于。

    我已经把通过上边把 MEMCACHED 的外网访问屏蔽掉了。 看看会不会正常。

    估计是 MEMCACHED 攻击
    utfqvfhpyygy
        6
    utfqvfhpyygy  
       Mar 28, 2018
    是不是 memcache 里面有大数据,另外就是你的站点有大图片,只有大块数据才会造成你的带宽跑满
    tylerdurden
        7
    tylerdurden  
       Mar 28, 2018
    memcache 的反射攻击漏洞,楼主把 memcache 对全局 IP 可访问的功能关闭吧。
    zhusimaji
        8
    zhusimaji  
       Mar 28, 2018
    升级 memcache 或者设置安全组
    xiaoyu9527
        9
    xiaoyu9527  
    OP
       Mar 28, 2018
    @tylerdurden 已经通过 iptables 屏蔽掉了 memcache 里的访问了。 我明天看看阿里云的流量统计就知道了。
    jaxer
        10
    jaxer  
       Mar 28, 2018
    我们之前遇到了,登录上去基本不能操作。
    后来看到了新闻,恍然大雾。
    这个是 Git 官方的文章,当时国内也有新闻报道。
    https://githubengineering.com/ddos-incident-report/
    AntonChen
        11
    AntonChen  
       Mar 28, 2018
    @xiaoyu9527 如果是单机,用不着 iptables 屏蔽 memcache 访问这么复杂,直接让 memcache 监听在 127 上即可。另阿里云上使用安全组比 iptables 好
    robot777
        12
    robot777  
       Mar 28, 2018
    提工单问客服,他们会帮你查的
    xiaoyu9527
        13
    xiaoyu9527  
    OP
       Mar 28, 2018
    @robot777 他们会查个 JB。 阿里云的客户是我用过这些云主机里最会推诿责任 要不就是让你花钱的客服。 没有之一。

    要不是客户指定之类的原因 我根本不想用他们的东西。
    cq65617875
        14
    cq65617875  
       Mar 29, 2018
    成为 L4 会员 你就能享受家的温暖(#滑稽
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   4514 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 60ms · UTC 10:07 · PVG 18:07 · LAX 03:07 · JFK 06:07
    ♥ Do have faith in what you're doing.