AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-75233

Raffael's questions

Martin Hope
Raffael
Asked: 2018-01-10 07:16:22 +0800 CST

16 个内核中的 2 个不断使 CPU 容量达到极限 - 为什么?

  • 0

我在 16 核 Ubuntu 16.04 实例上运行带有 php-fpm 的 nginx。服务器每小时处理超过 1000 万个请求。

正如您在 htop 屏幕截图中看到的那样,核心 6 和 7 已被最大化,并且这种情况一直存在 - 即使在重新启动 nginx 之后,这两个核心仍保持在该级别。

我想知道为什么会这样以及如何更均匀地平衡负载?

在此处输入图像描述


> cat /etc/nginx/nginx.conf | grep -v '^\s*#'

user www-data;
worker_processes auto;
pid /run/nginx.pid;
events {
        worker_connections 768;
}
http {
        sendfile on;
        tcp_nopush on;
        tcp_nodelay on;
        keepalive_timeout 65;
        types_hash_max_size 2048;
        include /etc/nginx/mime.types;
        default_type application/octet-stream;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
        ssl_prefer_server_ciphers on;
        access_log /var/log/nginx/access.log;
        error_log /var/log/nginx/error.log;
        gzip on;
        gzip_disable "msie6";
        include /etc/nginx/conf.d/*.conf;
        include /etc/nginx/sites-enabled/*;
}
nginx
  • 1 个回答
  • 119 Views
Martin Hope
Raffael
Asked: 2017-02-07 02:07:24 +0800 CST

如何显示 EC2 实例摘要报告?

  • 0

通过 SSH 连接到 EC2 实例后,我得到了一份不错的摘要报告 - 您可以在下面找到该报告。是否可以使用命令显示此报告?

➜  ~ ssh ...
Warning: the ECDSA host key for 'example.net' differs from the key for the IP address '12.34.56.78'
Offending key for IP in /home/user/.ssh/known_hosts:30
Matching host key in /home/user/.ssh/known_hosts:66
Are you sure you want to continue connecting (yes/no)? yes
Welcome to Ubuntu 16.04.1 LTS (GNU/Linux 4.4.0-59-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

  System information as of Mon Feb  6 10:03:28 UTC 2017

  System load:  0.66               Processes:           155
  Usage of /:   43.0% of 49.08GB   Users logged in:     0
  Memory usage: 1%                 IP address for eth0: 172.12.34.56
  Swap usage:   0%

  Graph this data and manage this system at:
    https://landscape.canonical.com/

  Get cloud support with Ubuntu Advantage Cloud Guest:
    http://www.ubuntu.com/business/services/cloud

10 packages can be updated.
10 updates are security updates.


*** System restart required ***
Last login: Mon Feb  6 09:20:51 2017 from 31.19.89.2
ubuntu@ip-172-12-34-56:~$ 
amazon-ec2 amazon-web-services ubuntu-16.04
  • 2 个回答
  • 292 Views
Martin Hope
Raffael
Asked: 2016-07-21 02:11:44 +0800 CST

为什么请求频率下降时响应时间会爆炸?

  • 22

更正:响应时间 ( %D) 是 μs 而不是 ms!1

这并没有改变这种模式的怪异之处,但这意味着它实际上具有更少的破坏性。


为什么响应时间与请求频率成反比?

当处理请求不那么忙时,服务器不应该更快地响应吗?

有什么建议可以让 Apache “利用”更少的负载吗?

在此处输入图像描述

这种模式是周期性的。这意味着如果印象数下降到每分钟约 200 个请求以下,它就会显示出来——这种情况从深夜到清晨发生(由于自然的用户活动)。


请求是非常简单的 POST,发送少于 1000 个字符的 JSON - 此 JSON 已存储(附加到文本文件) - 就是这样。回复只是“-”。

图中显示的数据是由 Apache 本身记录的:

LogFormat "%{%Y-%m-%d+%H:%M:%S}t %k %D %I %O" performance
CustomLog "/var/log/apache2/performance.log" performance
apache-2.4 high-load ubuntu-14.04
  • 6 个回答
  • 3210 Views
Martin Hope
Raffael
Asked: 2016-07-12 00:24:08 +0800 CST

对于每个客户端几乎只处理一个请求的服务器,是否开启或关闭 KeepAlive?

  • 0

有问题的 Apache 在 Ubuntu-EC2 实例上运行。它基本上每小时处理大约一百万个请求。本质上,客户端将POST是一个 JSON,仅此而已 - 因此客户端与服务器的交互仅包含此单个请求。

我天真的假设会转向KeepAlive那时off。虽然我读到如果跨客户端接收到的请求非常相似,保持连接活动也是有益的。

我应该切换KeepAlive on还是off?

(正如我们已经在做的那样 - 我也很感激关于MaxKeepAliveRequestsand的建议/澄清KeepAliveTimeout)

apache-2.4 high-load
  • 2 个回答
  • 835 Views
Martin Hope
Raffael
Asked: 2016-07-09 01:25:12 +0800 CST

如何检测 Apache 是否(即将)被请求淹没?

  • 3

我正在维护和规划一个在 Ubuntu 上运行 Apache2 的 EC2 服务器实例,该实例目前每小时接收大约 10000 个(非常简单的)请求。这只是一些通过 POST 传入的数据,并以一个虚拟的纯文本连字符作为响应。

随着时间的推移,请求的数量将逐渐增加,达到每小时一百万左右。

我如何(可靠地>)检测到服务器已经瘫痪并且不再能够处理传入的请求?

我目前正在做的只是检查内存和 CPU 负载htop——如果它们没有接近满容量,那么我认为一切都很好。

apache-2.4 high-load
  • 3 个回答
  • 1229 Views
Martin Hope
Raffael
Asked: 2016-03-01 02:53:24 +0800 CST

如何找出网站代码所在的位置?

  • 28

事实:

  • 有一个网站
  • 该网站可通过 www.example.org 访问
  • 有一个 EC2 实例很可能保留该网站
  • 服务器是 Apache
  • 服务器操作系统是 Ubuntu
  • 我拥有对服务器的完全访问权限(和 sudo 权限)
  • 服务器是一个巨大的混乱

问题是我不知道在哪里 - 简单地说 - 找到加载的 index.html/index.php。

如何确定在哪里可以找到网站的 PHP 和 HTML 代码?是否有解决这个问题的系统方法?

apache-2.2
  • 6 个回答
  • 5922 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve