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
    • 最新
    • 标签
主页 / server / 问题

问题[high-load](server)

Martin Hope
sw123456
Asked: 2024-01-14 02:44:15 +0800 CST

CPU 和 RAM 使用率较低时出现间歇性“高负载”

  • 6

我有一个托管在 Vultr HF 8CPU 服务器上的 WordPress 学习平台 (LearnDash) 网站。这太过分了,我的网站目前没有接近 CPU 或 RAM 限制。然而,有时站点“负载”会变高并且磁盘操作会激增。该网站仍然可以运行,但在一段时间内速度会变慢。

我仍在调查,但我相信这是一个 30 名左右的学生同时注册的情况(使用 WordPress 插件 uncanny groups 注册代码,在其中创建他们的帐户,然后立即分配给 LearnDash 课程和小组)。

考虑到高规格服务器,这种同时注册的方案真的会最大化磁盘读/写吗?或者它不太可能引起峰值?

当然,如果说 200 个用户同时进行测验(这种情况不会出现任何站点问题),由于不断读取和写入 DB,情况应该是类似的,但我的服务器可以正常处理。

我想还有其他网站有许多同时注册而不会减慢网站速度(暂时高负载)?

问题是,如果我是正确的,这些学生就会立即开始探索该网站,并且他们的第一堂课的负载会保持在很高的水平,并会影响该网站上的其他人。

通常我的网站可以毫无问题地处理 100 个并发用户,但似乎一群人一起注册是有问题的。

我对管理自己的服务器还很陌生,所以请友善。如果有人愿意就 1. 同时用户注册是否可能是问题以及 2. 如何缓解这个问题提供一些建议,我将非常感激。

已经联系了 Vultr 和我的控制面板“RunCloud”,他们都没有提供太多帮助。

high-load
  • 1 个回答
  • 147 Views
Martin Hope
deepbluecake123
Asked: 2022-04-11 06:31:05 +0800 CST

重负载测试期间内存使用率非常低

  • 0

我有一个 wordpress 网站,我在上面进行了繁重的负载测试。正如您在下面看到的,CPU 使用率当然很高,但同时 RAM 使用率永远不会高于 0.4%。负载测试不会产生任何错误,但网站的加载时间很长。我担心 RAM 的可用容量并没有真正使用。还是每秒 10000 个客户端的低 RAM 使用率是正常的?

服务器规格:

  • CPU:AMD Ryzen 7 PRO 3700 8 核处理器(16 核)
  • 内存:64 GB
  • 固态硬盘:960 GB NVMe
  • 带宽:1 Gbps
  • 操作系统:Ubuntu 20.04.4 LTS

未激活缓存

top我用命令得到这些结果

top - 14:12:22 up  4:11,  2 users,  load average: 29.49, 16.27, 7.29
Tasks: 467 total, 143 running, 301 sleeping,  23 stopped,   0 zombie
%Cpu(s): 27.6 us, 45.5 sy,  0.0 ni, 24.8 id,  0.0 wa,  0.0 hi,  2.1 si,  0.0 st
MiB Mem :  64306.9 total,  50683.7 free,   7559.5 used,   6063.7 buff/cache
MiB Swap:   7630.0 total,   7630.0 free,      0.0 used.  55881.2 avail Mem

    PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND
  37346 nginx     20   0  270356 266728   6364 R  78.1   0.4   2:19.89 nginx
  57982 fibonac+  20   0  355720 153908 105132 S  14.0   0.2   0:03.36 php-fpm
  61772 fibonac+  20   0  353552 150692 105776 S  14.0   0.2   0:01.26 php-fpm
   1524 mysql     20   0 9117616 192712  20468 S  13.6   0.3   1:17.50 mysqld
  57048 fibonac+  20   0  355788 153888 105072 S  13.6   0.2   0:04.08 php-fpm
  59186 fibonac+  20   0  353712 151920 105132 S  13.6   0.2   0:02.86 php-fpm
  61435 fibonac+  20   0  353680 150108 105120 R  13.6   0.2   0:01.66 php-fpm
  57693 fibonac+  20   0  355760 153964 105132 S  13.3   0.2   0:04.53 php-fpm
  59195 fibonac+  20   0  353684 151912 105124 S  13.3   0.2   0:02.86 php-fpm
  51154 fibonac+  20   0  357824 156160 105136 R  12.3   0.2   0:08.10 php-fpm
  51197 fibonac+  20   0  357780 156064 105088 R  12.0   0.2   0:07.05 php-fpm
  58034 fibonac+  20   0  355728 153616 105132 R  11.0   0.2   0:03.17 php-fpm
  51261 fibonac+  20   0  357780 156064 105136 R  10.0   0.2   0:06.74 php-fpm
  52563 fibonac+  20   0  358116 162056 110892 R  10.0   0.2   0:06.62 php-fpm
  57410 fibonac+  20   0  355728 153948 105132 R  10.0   0.2   0:03.86 php-fpm
  59521 fibonac+  20   0  351636 149816 105136 R  10.0   0.2   0:01.98 php-fpm
  60246 fibonac+  20   0  353752 151856 105140 R  10.0   0.2   0:02.70 php-fpm
  51147 fibonac+  20   0  357812 156156 105136 R   9.6   0.2   0:07.93 php-fpm
  51210 fibonac+  20   0  357780 156136 105136 R   9.6   0.2   0:08.08 php-fpm
  51225 fibonac+  20   0  357776 156112 105128 R   9.6   0.2   0:07.47 php-fpm
  51241 fibonac+  20   0  357780 156112 105136 R   9.6   0.2   0:06.95 php-fpm
  51251 fibonac+  20   0  357784 156072 105136 R   9.3   0.2   0:06.92 php-fpm
  51255 fibonac+  20   0  357784 156132 105140 R   9.3   0.2   0:07.43 php-fpm
  57054 fibonac+  20   0  355784 153952 105124 R   9.3   0.2   0:03.91 php-fpm
  57056 fibonac+  20   0  355768 153960 105132 R   9.3   0.2   0:03.85 php-fpm
  59192 fibonac+  20   0  353708 151508 105120 R   9.3   0.2   0:02.73 php-fpm
  61746 fibonac+  20   0  343316 140124 105140 R   9.3   0.2   0:00.74 php-fpm
  51233 fibonac+  20   0  357776 156112 105140 R   9.0   0.2   0:06.65 php-fpm
  51243 fibonac+  20   0  357784 156140 105120 R   9.0   0.2   0:07.97 php-fpm
  55161 fibonac+  20   0  355728 153988 105132 R   9.0   0.2   0:04.28 php-fpm
  57424 fibonac+  20   0  355736 153600 105132 R   9.0   0.2   0:03.30 php-fpm
  59185 fibonac+  20   0  353684 151496 104832 R   9.0   0.2   0:02.73 php-fpm
  51177 fibonac+  20   0  357812 156132 105136 R   8.6   0.2   0:07.17 php-fpm
  57401 fibonac+  20   0  355728 153620 105132 R   8.6   0.2   0:03.25 php-fpm
  51239 fibonac+  20   0  357836 156128 105136 R   8.3   0.2   0:06.93 php-fpm
  54835 fibonac+  20   0  357776 155544 104892 R   8.3   0.2   0:04.93 php-fpm
  61764 fibonac+  20   0  345492 143512 105588 R   8.3   0.2   0:01.07 php-fpm
  50951 fibonac+  20   0  357860 156164 105140 R   8.0   0.2   0:08.77 php-fpm
  51024 fibonac+  20   0  357816 156128 105136 R   8.0   0.2   0:07.97 php-fpm
  51160 fibonac+  20   0  357808 156156 105136 R   8.0   0.2   0:07.45 php-fpm
  54833 fibonac+  20   0  357832 155788 104816 R   8.0   0.2   0:06.09 php-fpm
  57047 fibonac+  20   0  355788 153864 105068 R   8.0   0.2   0:03.91 php-fpm
  59193 fibonac+  20   0  355760 153208 105080 R   8.0   0.2   0:03.08 php-fpm
  63679 fibonac+  20   0  260456 107648  80836 R   8.0   0.2   0:00.24 php-fpm
  63682 fibonac+  20   0  260456 107672  80860 R   8.0   0.2   0:00.24 php-fpm
  51028 fibonac+  20   0  357856 156068 105136 R   7.6   0.2   0:06.58 php-fpm
  53620 fibonac+  20   0  357776 156048 105132 R   7.6   0.2   0:05.68 php-fpm
  54832 fibonac+  20   0  357776 155968 105052 R   7.6   0.2   0:05.61 php-fpm
  55152 fibonac+  20   0  357780 156040 105132 R   7.6   0.2   0:05.36 php-fpm
  57981 fibonac+  20   0  355732 153596 105132 R   7.6   0.2   0:03.30 php-fpm
  58035 fibonac+  20   0  355736 153604 105132 R   7.6   0.2   0:03.29 php-fpm
  59184 fibonac+  20   0  353736 151484 105100 R   7.6   0.2   0:02.47 php-fpm
  59189 fibonac+  20   0  356072 159176 110760 R   7.6   0.2   0:05.38 php-fpm
  63683 fibonac+  20   0  260456 106668  80072 R   7.6   0.2   0:00.23 php-fpm
  51208 fibonac+  20   0  357780 156188 105140 R   7.3   0.2   0:07.25 php-fpm
  51237 fibonac+  20   0  357776 156184 105136 R   7.3   0.2   0:07.43 php-fpm
ubuntu memory wordpress load-testing high-load
  • 1 个回答
  • 215 Views
Martin Hope
user5248
Asked: 2022-01-19 11:20:58 +0800 CST

如何检查过去几天在 Digital Ocean 上触发高 CPU 使用率的原因?

  • 0

我想调查是什么导致了 1/16 几个小时的 CPU 使用率很高。Digital Ocean 图表显示,在大约 12 小时的过程中,CPU 使用率持续较高。是否有我可以利用的日志可以向我揭示有关此问题的更多详细信息?

high-load digital-ocean cpu-usage
  • 1 个回答
  • 159 Views
Martin Hope
xogoxec344
Asked: 2021-09-10 23:44:26 +0800 CST

linux系统减速调试,sys使用率高

  • 0

我有一个远程 linux 系统,昨天变得超级慢。由于我设置的远程 luks 解锁似乎工作不可靠,并且在接下来的 10 天内我将无法物理访问机器,我正在尝试调试它而不是重新启动。

我习惯使用的系统状态工具是htop,dstat并且由于我dstat在 ssh 会话中运行,我可以看到从昨天 2021-09-09 08:51:42 开始,“sys”始终完全使用一个 cpu 核心 - 我猜测意味着内核?

我看不到任何罪魁祸首进程或线程htop。

我已经停止了所有用户服务并卸载了所有非必要的东西,这使系统再次响应更好,但仍然没有达到应有的速度(使用带有 SSD 的 Intel i7 CPU)。

我找到了https://tanelpoder.com/posts/high-system-load-low-cpu-utilization-on-linux/并安装了引用的https://0x.tools/以获得以下结果psn -G syscall,wchan:

=== Active Threads ========================================================================================

 samples | avg_threads | comm              | state                  | syscall   | wchan                    
-----------------------------------------------------------------------------------------------------------
     100 |        1.00 | (btrfs-cleaner)   | Running (ON CPU)       | [running] | 0                        
     100 |        1.00 | (dpkg)            | Disk (Uninterruptible) | fsync     | btrfs_commit_transaction 
     100 |        1.00 | (systemd-journal) | Disk (Uninterruptible) | ftruncate | wait_current_trans       
       1 |        0.01 | (sshd)            | Running (ON CPU)       | [running] | 0                        
       1 |        0.01 | (thermald)        | Disk (Uninterruptible) | [running] | ec_guard                 
       1 |        0.01 | (thermald)        | Running (ON CPU)       | [running] | 0    

这个dpkg过程可以解释为我试图以apt upgrade你通常期望的速度的 1/1000 运行哪个运行(只是一种感觉,没有测量它)。

也许我的 btrfs 根文件系统有问题...?我找不到btrfs-cleanerin htop,我想我会研究更多关于那是什么..

我昨晚确实跑了btrfs scrub一个,它完成得非常快,没有发现任何问题:

# btrfs scrub status /
UUID:             2f38e0ad-7f16-4a36-8096-b7981d47b4ff
Scrub started:    Thu Sep  9 23:59:00 2021
Status:           finished
Duration:         0:00:24
Total to scrub:   53.09GiB
Rate:             1.78GiB/s
Error summary:    no errors found

但是当我使用 nano 修改根分区上的配置文件时,加载和保存它现在超级慢。

我只是偶然发现了这一点:https ://www.reddit.com/r/btrfs/comments/fmucrq/btrfs_snapshots_make_entire_system_lag_cpu_usage/其中有一条听起来与我的问题相似的评论:

每次启动时和快照后 btrfs-transacti 和 btrfs-cleaner 都会完全用完一个核心,从而导致巨大的延迟

只是这表示它在启动和创建快照时只持续了几分钟,但是btrbk几天前我在这个系统上禁用了我的备份设置,当时其中一个连接的磁盘开始出现问题。

我不确定我的 btrfs 根文件系统是否正在使用qgroups,但我只是运行btrfs quota disable /了大约 10 秒并且没有给出任何反馈。

有人对我有任何其他提示如何调试/解决这个问题吗?

linux high-load btrfs linuxmint
  • 1 个回答
  • 95 Views
Martin Hope
aye
Asked: 2017-03-05 07:37:32 +0800 CST

没有来自 top 命令的有用信息的高 CPU 使用率

  • 5

在过去的 2 天里,我开始遇到有几个用户的服务器问题。服务器是一个 OpenVZ VPS。通常当我遇到高 CPU 使用率时,我总是使用top命令找出原因。但是对于这台服务器,我没有从top命令中收到任何有用的信息。下面是我遇到的问题的示例屏幕截图 在此处输入图像描述

从截图中可以看出,%CPU所有进程的列几乎总是为零,实际上大多数时候我看到所有值都是零,但 CPU 使用率达到了 10 个核心!

我完全迷路了,不知道该怎么做才能找出原因。所以我想问一下是否有人对我面临的可能原因有任何想法?会不会是服务器问题?

感谢您的任何建议!

编辑:

请注意,此屏幕截图仅在发生高负载时拍摄。它每隔几个小时发生一次,持续约 20 分钟。正常使用只有0.0-0.2核左右。下面是一个正常使用的例子。

在此处输入图像描述

进一步更新

刚才又出现了,这里是建议命令的截图

在此处输入图像描述

对不起,我对这些是菜鸟,但如果我理解正确,磁盘使用没有任何问题,io 使用率非常低。

最后更新

我已经尝试使用建议的方法使用vmstat,ps在答案和评论中给出,但找不到有用的信息。当峰值发生时,我什至停止了 apache、mysql 但它没有帮助。我终于联系了 VPS 提供商并要求更改为另一个节点。他告诉我,他知道该节点的问题,该节点最近被恶意客户严重滥用,他正在努力解决这些问题。所以我想我现在不需要做任何事情。尽管如此,我还是要感谢所有提出建议的成员,使这个问答对以后的参考有用!

top high-load
  • 3 个回答
  • 5247 Views
Martin Hope
Bram z
Asked: 2017-02-24 11:05:45 +0800 CST

Varnish 负载平衡 - 所有数据是否都通过 varnish 流动,使其成为瓶颈

  • 1

当使用 varnish 作为负载平衡服务器时,所有数据是否都流经单个 varnish 负载平衡器,从而在为数千并发访问者提供服务的优化网站上受到上传速度的瓶颈?

varnish high-load
  • 1 个回答
  • 124 Views
Martin Hope
AGamePlayer
Asked: 2017-01-16 07:18:06 +0800 CST

为什么我的服务器上有这么多“ss”进程(带有 nginx 服务网络的 CentOS)?

  • -1

大约有 500 个并发用户。这是因为社交网络上的一些名人转发了链接。

这发生在以前。我们的服务器表现良好。

但是这一次,服务器变得非常慢,我注意到负载非常高。在这张图片中,负载只有 83.22,但那是因为我重新启动了它。重启前是600+(编辑本帖后,一直爬到200+,还在爬,估计快600以上了)

我注意到有很多“ss”进程。它们是什么?对这个案子有什么进一步的建议吗?

谢谢!

在此处输入图像描述

更新:发布此问题后,它变得越来越高:

在此处输入图像描述

更新:

我试图找到这个“ss”的来源,但它是这样的:

在此处输入图像描述

更新:添加了另一张图片ps auxw

更新:

使用ps aux | grep ss并列出了这个:

/bin/sh -c ss -nlp | grep "[,=]27846," || netstat -nlp | grep "[[:space:]]27846/"

在此处输入图像描述

high-load cpu-usage
  • 2 个回答
  • 313 Views
Martin Hope
Miloš Đakonović
Asked: 2016-10-06 06:11:34 +0800 CST

Apache 越来越多地消耗资源,直到重新启动

  • 0

我的apache2( Ubuntu 12.04) 在某些(可变的)时间段内出现了异常的系统资源利用率。我很肯定我没有那么多流量,而且 dos/ddos 几乎不在列表中,因为没有 web 服务器重新启动可以对 dos/ddos 做任何事情。

有什么症状?

系统负载(uptime命令)显示2- 2.5- 3。在 8 核机器上,通常的负载永远不会超过,0.8除非发生其他事情,通常是0.1- 0.2。

top命令证明apache是罪魁祸首。

为什么我对可容忍的系统负载很重视?

似乎磁盘 I/O 也增加了(温度升高了 2-3 摄氏度),我宁愿避免这种情况,因为两个硬盘都有好几年了。而且我不知道这是怎么回事。

配置文件/etc/apache2/apache2.conf(删除大注释):

#
# The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
#
LockFile ${APACHE_LOCK_DIR}/accept.lock

#
# PidFile: The file in which the server should record its process
# identification number when it starts.
# This needs to be set in /etc/apache2/envvars
#
PidFile ${APACHE_PID_FILE}

#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 300

#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive On

#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 100

#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 5

##
## Server-Pool Size Regulation (MPM specific)
##

# prefork MPM
# StartServers: number of server processes to start
# MinSpareServers: minimum number of server processes which are kept spare
# MaxSpareServers: maximum number of server processes which are kept spare
# MaxClients: maximum number of server processes allowed to start
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule mpm_prefork_module>
    StartServers          5
    MinSpareServers       5
    MaxSpareServers      10
    MaxClients          150
    MaxRequestsPerChild   0
</IfModule>

# worker MPM
# StartServers: initial number of server processes to start
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# ThreadLimit: ThreadsPerChild can be changed to this maximum value during a
#              graceful restart. ThreadLimit can only be changed by stopping
#              and starting Apache.
# ThreadsPerChild: constant number of worker threads in each server process
# MaxClients: maximum number of simultaneous client connections
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule mpm_worker_module>
    StartServers          2
    MinSpareThreads      25
    MaxSpareThreads      75
    ThreadLimit          64
    ThreadsPerChild      25
    MaxClients          150
    MaxRequestsPerChild   0
</IfModule>

# event MPM
# StartServers: initial number of server processes to start
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# ThreadsPerChild: constant number of worker threads in each server process
# MaxClients: maximum number of simultaneous client connections
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule mpm_event_module>
    StartServers          2
    MinSpareThreads      25
    MaxSpareThreads      75
    ThreadLimit          64
    ThreadsPerChild      25
    MaxClients          150
    MaxRequestsPerChild   0
</IfModule>

# These need to be set in /etc/apache2/envvars
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}

#
# AccessFileName: The name of the file to look for in each directory
# for additional configuration directives.  See also the AllowOverride
# directive.
#

AccessFileName .htaccess

#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<Files ~ "^\.ht">
    Order allow,deny
    Deny from all
    Satisfy all
</Files>

#
# DefaultType is the default MIME type the server will use for a document
# if it cannot otherwise determine one, such as from filename extensions.
# If your server contains mostly text or HTML documents, "text/plain" is
# a good value.  If most of your content is binary, such as applications
# or images, you may want to use "application/octet-stream" instead to
# keep browsers from trying to display binary files as though they are
# text.
#
# It is also possible to omit any default MIME type and let the
# client's browser guess an appropriate action instead. Typically the
# browser will decide based on the file's extension then. In cases
# where no good assumption can be made, letting the default MIME type
# unset is suggested  instead of forcing the browser to accept
# incorrect  metadata.
#
DefaultType None


#
# HostnameLookups: Log the names of clients or just their IP addresses
# e.g., www.apache.org (on) or 204.62.129.132 (off).
# The default is off because it'd be overall better for the net if people
# had to knowingly turn this feature on, since enabling it means that
# each client request will result in AT LEAST one lookup request to the
# nameserver.
#
HostnameLookups Off

# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a <VirtualHost>
# container, error messages relating to that virtual host will be
# logged here.  If you *do* define an error logfile for a <VirtualHost>
# container, that host's errors will be logged there and not here.
#
ErrorLog ${APACHE_LOG_DIR}/error.log

#
# LogLevel: Control the number of messages logged to the error_log.
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
#
LogLevel warn

# Include module configuration:
Include mods-enabled/*.load
Include mods-enabled/*.conf

# Include all the user configurations:
Include httpd.conf

# Include ports listing
Include ports.conf

#
# The following directives define some format nicknames for use with
# a CustomLog directive (see below).
# If you are behind a reverse proxy, you might want to change %h into %{X-Forwarded-For}i
#
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

# Include of directories ignores editors' and dpkg's backup files,
# see README.Debian for details.

# Include generic snippets of statements
Include conf.d/

# Include the virtual host configurations:
Include sites-enabled/



<IfModule mod_spamhaus.c>
  MS_METHODS POST,PUT,OPTIONS,CONNECT
  MS_WhiteList /etc/spamhaus.wl
  MS_CacheSize 256
</IfModule>

加载的模块:

 core_module (static)
 log_config_module (static)
 logio_module (static)
 mpm_prefork_module (static)
 http_module (static)
 so_module (static)
 alias_module (shared)
 auth_basic_module (shared)
 authn_file_module (shared)
 authz_default_module (shared)
 authz_groupfile_module (shared)
 authz_host_module (shared)
 authz_user_module (shared)
 autoindex_module (shared)
 cgi_module (shared)
 deflate_module (shared)
 dir_module (shared)
 env_module (shared)
 headers_module (shared)
 mime_module (shared)
 evasive20_module (shared)
 negotiation_module (shared)
 php5_module (shared)
 qos_module (shared)
 reqtimeout_module (shared)
 rewrite_module (shared)
 setenvif_module (shared)
 ssl_module (shared)
 status_module (shared)
 unique_id_module (shared)
Syntax OK

任何帮助表示赞赏。

performance apache-2.2 web-server high-load load-average
  • 1 个回答
  • 100 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

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