Linuxの高速化のポイント。

/etc/fstab

  • ジャーナリングをwritebackモードにする。
    • data=writeback
  • 最終アクセス時刻の更新を止める。
    • noatime
  • バッファヘッドを回避する。
    • nobh
  • SSDのtrim機能を有効にする。
    • discard
/dev/sda1  /  ext4  errors=remount-ro,data=writeback,noatime,nobh,discard  0  1

tmpをメモリー上で動かす

tmpfs  /tmp  tmpfs  defaults,noatime  0  0
tmpfs  /var/tmp  tmpfs  defaults,noatime  0  0

高精度イベントタイマーを採用する

# cat /sys/devices/system/clocksource/clocksource0/available_clocksource
tsc hpet acpi_pm
  • 「clocksource=hpet」を起動オプションに追加する。
# cat /sys/devices/system/clocksource/clocksource0/current_clocksource
hpet

irqbalanceを有効にする

# dnf install irqbalance
# systemctl list-unit-files |grep irqbalance
# systemctl start irqbalance.service
  • 有効前。

  • 有効後。

# cat /proc/interrupts 
           CPU0       CPU1       CPU2       CPU3       CPU4       CPU5       CPU6       CPU7       
  0:          8          0          0          0          0          0          0          0   IO-APIC   2-edge      timer
  8:          0          0          0          0          1          0          0          0   IO-APIC   8-edge      rtc0
  9:          0          1          0          0          0          0          0          0   IO-APIC   9-fasteoi   acpi
 16:          0          0         90          0          0          0          0          0   IO-APIC  16-fasteoi   ahci[0000:0e:00.0]
 18:          0          0          0          0          0          0      90266          0   IO-APIC  18-fasteoi   i801_smbus, wlan0
 23:          0          0          0        381          0          0          0          0   IO-APIC  23-fasteoi   ehci_hcd:usb1
 27:          0          0          0          0          0          0          0          0  DMAR-MSI   0-edge      dmar0
 48:          0          0          0          0    6430613          0          0          0   PCI-MSI 9437184-edge      xhci_hcd
 49:          0          0          0          0          0          0          0          0   PCI-MSI 9437185-edge      xhci_hcd
 50:          0          0          0          0          0          0          0          0   PCI-MSI 9437186-edge      xhci_hcd
 51:          0          0          0          0          0          0          0          0   PCI-MSI 9437187-edge      xhci_hcd
 52:          0          0          0          0          0          0          0          0   PCI-MSI 9437188-edge      xhci_hcd
 53:          0          0          0          0          0          0          0          0   PCI-MSI 9437189-edge      xhci_hcd
 54:          0          0          0          0          0          0          0          0   PCI-MSI 9437190-edge      xhci_hcd
 55:          0          0          0          0          0          0          0          0   PCI-MSI 9437191-edge      xhci_hcd
 57:          0          0          0          0          0          2          0          0   PCI-MSI 65536-edge      ioat-msix
 58:          0          0          0          0          0          0          0         61   PCI-MSI 11534336-edge      thunderbolt
 59:         61          0          0          0          0          0          0          0   PCI-MSI 11534337-edge      thunderbolt
 75:          0          2          0          0          0          0          0          0   PCI-MSI 67584-edge      ioat-msix
 76:          0          0         61          0          0          0          0          0   PCI-MSI 48758784-edge      thunderbolt
 77:          0          0          0         61          0          0          0          0   PCI-MSI 48758785-edge      thunderbolt
 92:          0          0          0          0          2          0          0          0   PCI-MSI 69632-edge      ioat-msix
 93:          0          0          0          0          0         45          0          0   PCI-MSI 85983232-edge      thunderbolt
 94:          0          0          0          0          0          0         61          0   PCI-MSI 85983233-edge      thunderbolt
109:          0          0          0          0          0          0          0          2   PCI-MSI 71680-edge      ioat-msix
110:          0          2          0          0          0          0          0          0   PCI-MSI 73728-edge      ioat-msix
111:        397          0          0          0          0          0          0          0   PCI-MSI 442368-edge      snd_hda_intel:card2
113:          0          0        109          0          0          0          0          0   PCI-MSI 1050624-edge      snd_hda_intel:card0
114:          0          0          0          2          0          0          0          0   PCI-MSI 75776-edge      ioat-msix
116:          0          0          0          0          2          0          0          0   PCI-MSI 77824-edge      ioat-msix
117:          0          0          0          0          0        157          0          0   PCI-MSI 3147776-edge      snd_hda_intel:card1
118:          0          0          0          0          0          0          2          0   PCI-MSI 79872-edge      ioat-msix
120:          0          0          0          0          0          0          0         36   PCI-MSI 1048576-edge      amdgpu
122:     327382          0          0          0          0          0          0          0   PCI-MSI 3145728-edge      amdgpu
123:          0          1          0          0          0          0          0          0   PCI-MSI 5767168-edge      eth0-tx-0
124:          0          0          1          0          0          0          0          0   PCI-MSI 5767169-edge      eth0-rx-1
125:          0          0          0          1          0          0          0          0   PCI-MSI 5767170-edge      eth0-rx-2
126:          0          0          0          0          1          0          0          0   PCI-MSI 5767171-edge      eth0-rx-3
127:          0          0          0          0          0          1          0          0   PCI-MSI 5767172-edge      eth0-rx-4
128:          0          0          0          0          0          0          1          0   PCI-MSI 6291456-edge      eth2-tx-0
129:          0          0          0          0          0          0          0          1   PCI-MSI 6291457-edge      eth2-rx-1
130:          1          0          0          0          0          0          0          0   PCI-MSI 6291458-edge      eth2-rx-2
131:          0          1          0          0          0          0          0          0   PCI-MSI 6291459-edge      eth2-rx-3
132:          0          0          1          0          0          0          0          0   PCI-MSI 6291460-edge      eth2-rx-4
NMI:          0          0          0          0          0          0          0          0   Non-maskable interrupts
LOC:     873331     364326     826957     832828    1139910     620774    1033324     462981   Local timer interrupts
SPU:          0          0          0          0          0          0          0          0   Spurious interrupts
PMI:          0          0          0          0          0          0          0          0   Performance monitoring interrupts
IWI:          0          0          0          0          0          0          0          0   IRQ work interrupts
RTR:          4          0          0          0          0          0          0          0   APIC ICR read retries
RES:     134670     101306      47170      31359      55786      23742     106742      46630   Rescheduling interrupts
CAL:      88576      78396      83614      69056      88095      74612      79313      75986   Function call interrupts
TLB:     168917     143717     161376     132079     159225     139879     156649     138557   TLB shootdowns
TRM:          0          0          0          0          0          0          0          0   Thermal event interrupts
THR:          0          0          0          0          0          0          0          0   Threshold APIC interrupts
MCE:          0          0          0          0          0          0          0          0   Machine check exceptions
MCP:         12         13         13         13         13         13         13         13   Machine check polls
ERR:          0
MIS:          0
PIN:          0          0          0          0          0          0          0          0   Posted-interrupt notification event
NPI:          0          0          0          0          0          0          0          0   Nested posted-interrupt event
PIW:          0          0          0          0          0          0          0          0   Posted-interrupt wakeup event