- 工信部备案号 滇ICP备05000110号-1
- 滇公安备案 滇53010302000111
- 增值电信业务经营许可证 B1.B2-20181647、滇B1.B2-20190004
- 云南互联网协会理事单位
- 安全联盟认证网站身份V标记
- 域名注册服务机构许可:滇D3-20230001
- 代理域名注册服务机构:新网数码
# systemctl show -p CPUShares httpd.service
CPUShares=1024
注意:各个服务的默认CPU分配份额=1024,你可以增加/减少某个进程的CPU分配份额。
# systemctl set-property httpd.service CPUShares=2000
# systemctl show -p CPUShares httpd.service
CPUShares=2000
注意:当你为某个服务设置CPUShares,会自动创建一个以服务名命名的目录(如 httpd.service),里面包含了一个名为90-CPUShares.conf的文件,该文件含有CPUShare限制信息,你可以通过以下方式查看该?件:
# vi /etc/systemd/system/httpd.service.d/90-CPUShares.conf
[Service]
CPUShares=2000
# systemctl show httpd
Id=httpd.service
Names=httpd.service
Requires=basic.target
Wants=system.slice
WantedBy=multi-user.target
Conflicts=shutdown.target
Before=shutdown.target multi-user.target
After=network.target remote-fs.target nss-lookup.target systemd-journald.socket basic.target system.slice
Description=TheApache HTTP Server
LoadState=loaded
ActiveState=active
SubState=running
FragmentPath=/usr/lib/systemd/system/httpd.service
....
# systemd-analyze critical-chain httpd.service
The time after the unit is active or started is printed after the "@" character.
The time the unit takes to start is printed after the "+" character.
httpd.service +142ms
└─network.target @11.168s
└─network.service @9.456s+1.712s
└─NetworkManager.service @8.858s+596ms
└─firewalld.service @4.931s+3.926s
└─basic.target @4.916s
└─sockets.target @4.916s
└─dbus.socket @4.916s
└─sysinit.target @4.905s
└─systemd-update-utmp.service @4.864s+39ms
└─auditd.service @4.563s+301ms
└─systemd-tmpfiles-setup.service @4.485s+69ms
└─rhel-import-state.service @4.342s+142ms
└─local-fs.target @4.324s
└─boot.mount @4.286s+31ms
└─systemd-fsck@dev-disk-byx2duuid-79f594adx2da332x2d4730x2dbb5fx2d85d196080964.service@4.092s+149ms
└─dev-disk-byx2duuid-79f594adx2da332x2d4730x2dbb5fx2d85d196080964.device@4.092s
# systemctl list-dependencies httpd.service
httpd.service
├─system.slice
└─basic.target
├─firewalld.service
├─microcode.service
├─rhel-autorelabel-mark.service
├─rhel-autorelabel.service
├─rhel-configure.service
├─rhel-dmesg.service
├─rhel-loadmodules.service
├─paths.target
├─slices.target
│├─-.slice
│└─system.slice
├─sockets.target
│├─dbus.socket
....
# systemd-cgls
├─1/usr/lib/systemd/systemd --switched-root --system --deserialize 23
├─user.slice
│└─user-0.slice
│└─session-1.scope
│├─2498 sshd: root@pts/0
│├─2500-bash
│├─4521 systemd-cgls
│└─4522 systemd-cgls
└─system.slice
├─httpd.service
│├─4440/usr/sbin/httpd -DFOREGROUND
│├─4442/usr/sbin/httpd -DFOREGROUND
│├─4443/usr/sbin/httpd -DFOREGROUND
│├─4444/usr/sbin/httpd -DFOREGROUND
│├─4445/usr/sbin/httpd -DFOREGROUND
│└─4446/usr/sbin/httpd -DFOREGROUND
├─polkit.service
│└─721/usr/lib/polkit-1/polkitd --no-debug
....
# systemd-cgtop
PathTasks%CPU MemoryInput/s Output/s
/831.0437.8M--
/system.slice -0.1---
/system.slice/mariadb.service 20.1---
/system.slice/tuned.service 10.0---
/system.slice/httpd.service 60.0---
/system.slice/NetworkManager.service 1----
/system.slice/atop.service 1----
/system.slice/atopacct.service 1----
/system.slice/auditd.service 1----
/system.slice/crond.service 1----
/system.slice/dbus.service 1----
/system.slice/firewalld.service 1----
/system.slice/lvm2-lvmetad.service 1----
/system.slice/polkit.service 1----
/system.slice/postfix.service 3----
/system.slice/rsyslog.service 1----
/system.slice/system-getty.slice/getty@tty1.service 1----
/system.slice/systemd-journald.service 1----
/system.slice/systemd-logind.service 1----
/system.slice/systemd-udevd.service 1----
/system.slice/webmin.service 1----
/user.slice/user-0.slice/session-1.scope3----
售前咨询
售后咨询
备案咨询
二维码
TOP