www.fabiankeil.de/blog-surrogat/2022/06/22/clock_gettime-patch-fuer-tor-auf-electrobsd-getestet.html

clock_gettime()-Patch für Tor auf ElectroBSD getestet

Andreas Kempe veröffentlichte gestern einen Patch auf der Tor-Relays-Mailingliste der unter FreeBSD die Tor-Performance verbessern sollte und rief zum Testen auf.

Ich habe den Patch in die ElectroBSD-Ports aufgenommen und auf einem physikalischen Server getestet auf dem das von Andreas mitgelieferte Benchmark-Program einen Performance-Unterschied von weniger als Faktor vier ergab:

[fk@elektrobier /tmp]$ ./bench 
CLOCK_MONOTONIC: 0.041536 s
CLOCK_MONOTONIC_FAST: 0.013998 s

Eine signifikante Performance-Steigerung oder Load-Reduktion konnte ich nicht feststellen:

Munin-Graph vom Plugin cpu-day Munin-Graph vom Plugin if_bge0-day Munin-Graph vom Plugin if_errcoll_bge0-day Munin-Graph vom Plugin if_packets_bge0-day Munin-Graph vom Plugin load-day Munin-Graph vom Plugin memory-day Munin-Graph vom Plugin netstat-day Munin-Graph vom Plugin pf_ipv4_ipv6_packets-day Munin-Graph vom Plugin pf-day Munin-Graph vom Plugin procstat_file_descriptor_count_tor_elektrobier1-day Munin-Graph vom Plugin procstat_file_descriptor_count_tor_polizei_erziehung-day Munin-Graph vom Plugin ps_memory_usage_tor_elektrobier1-day Munin-Graph vom Plugin ps_memory_usage_tor_polizei_erziehung-day Munin-Graph vom Plugin tor_bandwidth_usage_elektrobier1-day Munin-Graph vom Plugin tor_bandwidth_usage_nginx_hs-day Munin-Graph vom Plugin tor_bandwidth_usage_polizei_erziehung-day Munin-Graph vom Plugin uptime-day

dmesg

Copyright (c) 2010-2022 Fabian Keil - IT-Beratung und Polizei-Erziehung
Copyright (c) 1992-2021 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
	The Regents of the University of California. All rights reserved.
ElectroBSD ain't no registered trademark of The ElectroBSD Foundation (which does not exist).
ElectroBSD 13.1-STABLE #0: Wed Apr  6 08:24:00 UTC 2022
    elektropunker@ElectroBSD-20220406-406c7486ba78:/usr/obj/usr/src/amd64.amd64/sys/ELECTRO_BLOAT amd64
VT(vga): resolution 640x480
CPU: Intel(R) Pentium(R) CPU        G6950  @ 2.80GHz (2793.12-MHz K8-class CPU)
  Origin="GenuineIntel"  Id=0x20655  Family=0x6  Model=0x25  Stepping=5
  Features=0xbfebfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE>
  Features2=0x82e3bd<SSE3,DTES64,MON,DS_CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,PCID,POPCNT>
  AMD Features=0x28100800<SYSCALL,NX,RDTSCP,LM>
  AMD Features2=0x1<LAHF>
  VT-x: PAT,HLT,MTF,PAUSE,EPT,UG,VPID
  TSC: P-state invariant, performance statistics
real memory  = 8589934592 (8192 MB)
avail memory = 8200941568 (7821 MB)
Event timer "LAPIC" quality 600
ACPI APIC Table: <HP     ProLiant>
SMP: Multiprocessor System Detected: 2 CPUs
ElectroBSD/SMP: 1 package(s) x 2 core(s)
random: unblocking device.
ioapic0 <Version 2.0> irqs 0-23
Launching APs: 1
random: entropy device external interface
kbd1 at kbdmux0
vtvga0: <VT VGA driver>
smbios0: <System Management BIOS> at iomem 0xf6d00-0xf6d1e
smbios0: Version: 2.6, BCD Revision: 2.6
aesni0: No AES or SHA support.
acpi0: <HP ProLiant>
acpi0: Power Button (fixed)
acpi0: _OSC failed: AE_BUFFER_OVERFLOW
cpu0: <ACPI CPU> on acpi0
hpet0: <High Precision Event Timer> iomem 0xfed00000-0xfed003ff irq 0,8 on acpi0
Timecounter "HPET" frequency 14318180 Hz quality 950
Event timer "HPET" frequency 14318180 Hz quality 550
Event timer "HPET1" frequency 14318180 Hz quality 440
Event timer "HPET2" frequency 14318180 Hz quality 440
Event timer "HPET3" frequency 14318180 Hz quality 440
Event timer "HPET4" frequency 14318180 Hz quality 440
Event timer "HPET5" frequency 14318180 Hz quality 440
Event timer "HPET6" frequency 14318180 Hz quality 440
atrtc0: <AT realtime clock> port 0x70-0x71 on acpi0
atrtc0: registered as a time-of-day clock, resolution 1.000000s
Event timer "RTC" frequency 32768 Hz quality 0
attimer0: <AT timer> port 0x40-0x43,0x50-0x53 on acpi0
Timecounter "i8254" frequency 1193182 Hz quality 0
Event timer "i8254" frequency 1193182 Hz quality 100
apei0: <ACPI Platform Error Interface> on acpi0
Timecounter "ACPI-fast" frequency 3579545 Hz quality 900
acpi_timer0: <24-bit timer at 3.579545MHz> port 0x1008-0x100b on acpi0
pcib0: <ACPI Host-PCI bridge> port 0xcf8-0xcff on acpi0
pci0: <ACPI PCI bus> on pcib0
pcib1: <ACPI PCI-PCI bridge> irq 16 at device 1.0 on pci0
pci1: <ACPI PCI bus> on pcib1
ehci0: <Intel PCH USB 2.0 controller USB-B> mem 0xdfd02000-0xdfd023ff irq 16 at device 26.0 on pci0
usbus0: EHCI version 1.0
usbus0 on ehci0
usbus0: 480Mbps High Speed USB v2.0
pcib2: <ACPI PCI-PCI bridge> irq 17 at device 28.0 on pci0
pcib2: failed to allocate initial I/O port window: 0-0xfff
pcib3: <ACPI PCI-PCI bridge> irq 17 at device 28.4 on pci0
pci2: <ACPI PCI bus> on pcib3
pci0:32:0:0: no valid vpd ident found
pci0:32:0:0: failed to read VPD data.
bge0: <Broadcom BCM5784 A1, ASIC rev. 0x5784100> mem 0xdf900000-0xdf90ffff irq 16 at device 0.0 on pci2
bge0: CHIP ID 0x05784100; ASIC REV 0x5784; CHIP REV 0x57841; PCI-E
miibus0: <MII bus> on bge0
brgphy0: <BCM5784 10/100/1000baseT PHY> PHY 1 on miibus0
brgphy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 1000baseT-master, 1000baseT-FDX, 1000baseT-FDX-master, auto, auto-flow
bge0: Using defaults for TSO: 65518/35/2048
bge0: Ethernet address: [...]
pcib4: <ACPI PCI-PCI bridge> irq 16 at device 28.5 on pci0
pci3: <ACPI PCI bus> on pcib4
pci0:34:0:0: no valid vpd ident found
pci0:34:0:0: failed to read VPD data.
bge1: <Broadcom BCM5784 A1, ASIC rev. 0x5784100> mem 0xdfa00000-0xdfa0ffff irq 17 at device 0.0 on pci3
bge1: CHIP ID 0x05784100; ASIC REV 0x5784; CHIP REV 0x57841; PCI-E
miibus1: <MII bus> on bge1
brgphy1: <BCM5784 10/100/1000baseT PHY> PHY 1 on miibus1
brgphy1:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 1000baseT-master, 1000baseT-FDX, 1000baseT-FDX-master, auto, auto-flow
bge1: Using defaults for TSO: 65518/35/2048
bge1: Ethernet address: [...]
pcib5: <ACPI PCI-PCI bridge> irq 18 at device 28.6 on pci0
pci4: <ACPI PCI bus> on pcib5
vgapci0: <VGA-compatible display> mem 0xde000000-0xdeffffff,0xdf800000-0xdf803fff,0xdf000000-0xdf7fffff irq 18 at device 0.0 on pci4
vgapci0: Boot video device
pcib6: <ACPI PCI-PCI bridge> irq 19 at device 28.7 on pci0
pcib6: failed to allocate initial I/O port window: 0-0xfff
ehci1: <Intel PCH USB 2.0 controller USB-A> mem 0xdfd02400-0xdfd027ff irq 23 at device 29.0 on pci0
usbus1: EHCI version 1.0
usbus1 on ehci1
usbus1: 480Mbps High Speed USB v2.0
pcib7: <PCI-PCI bridge> at device 30.0 on pci0
pci5: <PCI bus> on pcib7
isab0: <PCI-ISA bridge> at device 31.0 on pci0
isa0: <ISA bus> on isab0
ahci0: <Intel Ibex Peak AHCI SATA controller> port 0x1830-0x1837,0x1824-0x1827,0x1828-0x182f,0x1820-0x1823,0x1800-0x181f mem 0xdfd01000-0xdfd017ff irq 18 at device 31.2 on pci0
ahci0: AHCI v1.30 with 6 3Gbps ports, Port Multiplier supported
ahcich0: <AHCI channel> at channel 0 on ahci0
ahcich1: <AHCI channel> at channel 1 on ahci0
ahcich2: <AHCI channel> at channel 2 on ahci0
ahcich3: <AHCI channel> at channel 3 on ahci0
ahcich4: <AHCI channel> at channel 4 on ahci0
ahcich5: <AHCI channel> at channel 5 on ahci0
acpi_syscontainer0: <System Container> on acpi0
acpi_button0: <Power Button> on acpi0
uart0: <16550 or compatible> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0
orm0: <ISA Option ROMs> at iomem 0xc0000-0xc7fff,0xca000-0xcafff,0xdf000-0xdffff pnpid ORM0000 on isa0
est0: <Enhanced SpeedStep Frequency Control> on cpu0
Timecounter "TSC-low" frequency 1396491255 Hz quality 1000
Timecounters tick every 1.000 msec
ZFS filesystem version: 5
ZFS storage pool version: features support (5000)
ugen0.1: <Intel EHCI root HUB> at usbus0
ugen1.1: <Intel EHCI root HUB> at usbus1
uhub0 on usbus0
uhub0: <Intel EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus0
uhub1 on usbus1
uhub1: <Intel EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus1
Trying to mount root from zfs:rpool []...
ada0 at ahcich0 bus 0 scbus0 target 0 lun 0
ada0: <MB0500EBNCR HPG2> ATA8-ACS SATA 2.x device
ada0: Serial Number WMAYP2947213
ada0: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 8192bytes)
ada0: Command Queueing enabled
ada0: 476940MB (976773168 512 byte sectors)
ada1 at ahcich1 bus 0 scbus1 target 0 lun 0
ada1: <MB0500EBNCR HPG2> ATA8-ACS SATA 2.x device
ada1: Serial Number WMAYP4401921
ada1: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 8192bytes)
ada1: Command Queueing enabled
ada1: 476940MB (976773168 512 byte sectors)
ada2 at ahcich2 bus 0 scbus2 target 0 lun 0
ada2: <MB0500EBNCR HPG2> ATA8-ACS SATA 2.x device
ada2: Serial Number WMAYP5767503
ada2: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 8192bytes)
ada2: Command Queueing enabled
ada2: 476940MB (976773168 512 byte sectors)
ada3 at ahcich3 bus 0 scbus3 target 0 lun 0
ada3: <MB0500EBNCR HPG2> ATA8-ACS SATA 2.x device
ada3: Serial Number WMAYP3368257
ada3: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 8192bytes)
ada3: Command Queueing enabled
ada3: 476940MB (976773168 512 byte sectors)
GEOM_ELI: Found no key files in loader.conf for ada0p3.
GEOM_ELI: Found no key files in loader.conf for ada1p3.
GEOM_ELI: Found no key files in loader.conf for ada2p3.
GEOM_ELI: Found no key files in loader.conf for ada3p3.
GEOM_ELI: Device gpt/rpool-ada0.eli created.
GEOM_ELI: Encryption: AES-XTS 256
GEOM_ELI:     Crypto: software
GEOM_ELI: Device gpt/rpool-ada1.eli created.
GEOM_ELI: Encryption: AES-XTS 256
GEOM_ELI:     Crypto: software
GEOM_ELI: Device gpt/rpool-ada2.eli created.
GEOM_ELI: Encryption: AES-XTS 256
GEOM_ELI:     Crypto: software
GEOM_ELI: Device gpt/rpool-ada3.eli created.
GEOM_ELI: Encryption: AES-XTS 256
GEOM_ELI:     Crypto: software
uhub0: 2 ports with 2 removable, self powered
uhub1: 2 ports with 2 removable, self powered
pid 33471 (zpool), jid 0, uid 0: exited on signal 6 (core dumped)
ichsmb0: <Intel PCH SMBus controller> port 0x1840-0x185f mem 0xdfd02800-0xdfd028ff irq 18 at device 31.3 on pci0
smbus0: <System Management Bus> on ichsmb0
lo0: link state changed to UP
bge0: link state changed to DOWN
lo1: link state changed to UP
bge0: link state changed to UP