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-514127

j4nd3r53n's questions

Martin Hope
j4nd3r53n
Asked: 2021-10-28 01:40:03 +0800 CST

iostat不可靠吗?

  • 1

我注意到 iostat 令人担忧的一些我无法解释的问题 - 看来 iostat 可能不太可靠(?)

我正在尝试解决 MySQL 性能不佳的问题,一个值得关注的地方是磁盘,所以:

ip-10-14-4-14 root : iostat -x nvme2n1
Linux 5.4.0-1029-aws (ip-10-14-4-14)    10/27/21        _x86_64_        (8 CPU)

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           1.19    0.00    0.47    0.84    0.00   97.49

Device            r/s     rkB/s   rrqm/s  %rrqm r_await rareq-sz     w/s     wkB/s   wrqm/s  %wrqm w_await wareq-sz     d/s     dkB/s   drqm/s  %drqm d_await dareq-sz  aqu-sz  %util
nvme2n1          4.93    160.70     0.26   4.95    0.53    32.60  216.03   6863.39    57.07  20.90    0.78    31.77    0.00      0.00     0.00   0.00    0.00     0.00    0.00  16.50

看起来还不错——%util只有 16.5;然而:

ip-10-14-4-14 root : iostat -y 1 -x nvme2n1
Linux 5.4.0-1029-aws (ip-10-14-4-14)    10/27/21        _x86_64_        (8 CPU)


avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           4.65    0.00    1.26    1.13    0.00   92.96

Device            r/s     rkB/s   rrqm/s  %rrqm r_await rareq-sz     w/s     wkB/s   wrqm/s  %wrqm w_await wareq-sz     d/s     dkB/s   drqm/s  %drqm d_await dareq-sz  aqu-sz  %util
nvme2n1         10.00    160.00     0.00   0.00    0.40    16.00 2058.00  40260.00   326.00  13.67    0.65    19.56    0.00      0.00     0.00   0.00    0.00     0.00    0.00 100.00

相同的系统,几乎同时,但现在%util是 100。我什至尝试在循环中运行第一个版本,然后%util保持低位:

for i in $(seq 1 50); do iostat -x nvme2n1; done
Linux 5.4.0-1029-aws (ip-10-14-4-14)    10/27/21        _x86_64_        (8 CPU)

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           1.19    0.00    0.48    0.84    0.00   97.49

Device            r/s     rkB/s   rrqm/s  %rrqm r_await rareq-sz     w/s     wkB/s   wrqm/s  %wrqm w_await wareq-sz     d/s     dkB/s   drqm/s  %drqm d_await dareq-sz  aqu-sz  %util
nvme2n1          4.93    160.70     0.26   4.95    0.53    32.59  216.32   6868.15    57.10  20.88    0.78    31.75    0.00      0.00     0.00   0.00    0.00     0.00    0.00  16.51
...

发生了什么事 - 我只是没有正确使用该工具吗?

iostat
  • 1 个回答
  • 64 Views
Martin Hope
j4nd3r53n
Asked: 2020-07-10 00:52:07 +0800 CST

使用 cgroups/systemd 限制每个用户的资源使用

  • 1

Debian 10:我想限制所有用户的内存、CPU 等,除了root; 我找到了几篇关于这个的文章,但到目前为止,它们都围绕着 cgconfig 展开,这似乎不是现在完成的方式。我已经看到了一些使用切片的建议,因此对于 UID 1000,创建如下内容:

# cat /lib/systemd/system/user-1000.slice
[Unit]
Description=User and Session Slice
Documentation=man:systemd.special(7)
Before=slices.target
MemoryHigh=20M

[Slice]
Slice=user-slice

[Install]
WantedBy=multi-user.target

并使用systemctl enable user-1000.slice. 这似乎成功了一半:

 $ systemctl status user-1000.slice
Warning: The unit file, source configuration file or drop-ins of user-1000.slice changed on disk. Run 'systemctl daemon-reload' to reload units.
● user-1000.slice - User Slice of UID 1000
   Loaded: loaded (/lib/systemd/system/user-1000.slice; enabled; vendor preset: enabled)
  Drop-In: /usr/lib/systemd/system/user-.slice.d
           └─10-defaults.conf
   Active: active since Thu 2020-07-09 07:37:28 UTC; 1h 8min ago
     Docs: man:systemd.special(7)
           man:[email protected](5)
    Tasks: 7 (limit: 5237)
   Memory: 5.4M
   CGroup: /user.slice/user-1000.slice
           ├─session-15.scope
           │ ├─1089 sshd: jan [priv]
           │ ├─1107 sshd: jan@pts/1
           │ ├─1108 -bash
           │ ├─1113 systemctl status user-1000.slice
           │ └─1114 pager
           └─[email protected]
             └─init.scope
               ├─1092 /lib/systemd/systemd --user
               └─1093 (sd-pam)

但是,MemoryHigh未设置:

 $ systemctl show user-1000.slice
Slice=user.slice
ControlGroup=/user.slice/user-1000.slice
...
MemoryHigh=infinity
...

我似乎很接近,但一定少了点什么——那是什么?

systemd debian-buster cgroup
  • 1 个回答
  • 1348 Views
Martin Hope
j4nd3r53n
Asked: 2020-07-09 07:04:19 +0800 CST

systemd:如何创建一个新的 .slice 文件?

  • 0

我正在努力了解如何在我的 debian 10 系统上设置新切片。我system-db.slice通过复制system.slice和更改几件事创建了一个文件:

#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.

[Unit]
Description=System DB Slice
Documentation=man:systemd.special(7)
DefaultDependencies=no
Before=slices.target
Requires=system.slice
After=system.slice

这似乎根本没有做任何事情。例如,它不会出现在 中systemd-cgls。另一方面,systemctl发现它:

# systemctl status system-db.slice
● system-db.slice - System DB Slice
   Loaded: loaded (/etc/systemd/system/system-db.slice; static; vendor preset: enabled)
   Active: inactive (dead)
     Docs: man:systemd.special(7)

显然有些事情我没有做或做错。我应该怎么做?我在哪里可以了解更多信息?

debian systemd cgroup
  • 1 个回答
  • 2867 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