Seite 1 von 1

Performance-Problem mit opsi-cli auf MacOS

Verfasst: 16 Mai 2025, 17:29
von yumxac
Hallo zusammen.

Während "opsi-cli" unter Linux wunderbar funktioniert, ist es unter MacOS (Sequoia 15.4.1, arm64) furchtbar langsam.

Ein "opsi-cli package list" braucht auf dem OPSI-Server selbst 1.673s und remote von einen anderen Linux-Host 2.085s (bei 5ms Latenz zum OPSI-Server). Von meinem Mac aus (12ms Latenz) braucht der gleiche Befehl mind. 30 Sekunden. Wie es aussieht verliert er die Zeit bei DNS-Lookups:

Code: Alles auswählen

❯ opsi-cli -l6 package list
[6] [2025-05-16 16:50:53.555] [               ] Loading plugin 'package' (name=Package, cli=<RichGroup package>)   (plugin.py:140)
[5] [2025-05-16 16:50:53.556] [               ] opsi-cli version 4.3.19.1 starting   (__main__.py:201)
[6] [2025-05-16 16:50:53.559] [               ] Reusing session cookie from cache   (opsiservice.py:104)
[6] [2025-05-16 16:50:53.560] [               ] Using proxy settings: http_proxy=None, https_proxy=None, no_proxy='127.0.0.1,localhost,::1,ip6-loopback,ip6-localhost'   (__init__.py:271)
[6] [2025-05-16 16:50:53.595] [               ] No hostname for {'family': 'ipv6', 'interface': 'en7', 'address': 'xxxx:xxxx:4149:6400:a422:7464:6bf5:52d3', 'ip_address': IPv6Address('xxxx:xxxx:4149:6400:a422:7464:6bf5:52d3')}: [Errno 1] Unknown host   (network.py:90)
[6] [2025-05-16 16:50:53.596] [               ] No hostname for {'family': 'ipv6', 'interface': 'en7', 'address': 'fd45:8b16:8f6e:0:14d8:d739:b0b9:a0a1', 'ip_address': IPv6Address('fd45:8b16:8f6e:0:14d8:d739:b0b9:a0a1')}: [Errno 1] Unknown host   (network.py:90)
[6] [2025-05-16 16:50:53.604] [               ] No hostname for {'family': 'ipv6', 'interface': 'en0', 'address': 'xxxx:xxxx:4149:6400:2cd1:c9de:b2a4:a65c', 'ip_address': IPv6Address('xxxx:xxxx:4149:6400:2cd1:c9de:b2a4:a65c')}: [Errno 1] Unknown host   (network.py:90)
[6] [2025-05-16 16:50:53.607] [               ] No hostname for {'family': 'ipv6', 'interface': 'en0', 'address': 'fd45:8b16:8f6e:0:419:2cd6:5465:91f2', 'ip_address': IPv6Address('fd45:8b16:8f6e:0:419:2cd6:5465:91f2')}: [Errno 1] Unknown host   (network.py:90)
[6] [2025-05-16 16:50:58.609] [               ] No hostname for {'family': 'ipv6', 'interface': 'awdl0', 'address': 'fe80::a0c6:e6ff:fe3c:4cc1%awdl0', 'ip_address': IPv6Address('fe80::a0c6:e6ff:fe3c:4cc1')}: DNS lookup for fe80::a0c6:e6ff:fe3c:4cc1%awdl0 timed out after 0.1 seconds   (network.py:90)
[6] [2025-05-16 16:51:03.615] [               ] No hostname for {'family': 'ipv6', 'interface': 'llw0', 'address': 'fe80::a0c6:e6ff:fe3c:4cc1%llw0', 'ip_address': IPv6Address('fe80::a0c6:e6ff:fe3c:4cc1')}: DNS lookup for fe80::a0c6:e6ff:fe3c:4cc1%llw0 timed out after 0.1 seconds   (network.py:90)
[6] [2025-05-16 16:51:08.617] [               ] No hostname for {'family': 'ipv6', 'interface': 'utun0', 'address': 'fe80::ec96:fe01:f0cd:e07a%utun0', 'ip_address': IPv6Address('fe80::ec96:fe01:f0cd:e07a')}: DNS lookup for fe80::ec96:fe01:f0cd:e07a%utun0 timed out after 0.1 seconds   (network.py:90)
[6] [2025-05-16 16:51:13.622] [               ] No hostname for {'family': 'ipv6', 'interface': 'utun1', 'address': 'fe80::5e9c:72d1:ccb6:b8a%utun1', 'ip_address': IPv6Address('fe80::5e9c:72d1:ccb6:b8a')}: DNS lookup for fe80::5e9c:72d1:ccb6:b8a%utun1 timed out after 0.1 seconds   (network.py:90)
[6] [2025-05-16 16:51:18.627] [               ] No hostname for {'family': 'ipv6', 'interface': 'utun2', 'address': 'fe80::e0f:d95d:3f6a:574b%utun2', 'ip_address': IPv6Address('fe80::e0f:d95d:3f6a:574b')}: DNS lookup for fe80::e0f:d95d:3f6a:574b%utun2 timed out after 0.1 seconds   (network.py:90)
[6] [2025-05-16 16:51:23.632] [               ] No hostname for {'family': 'ipv6', 'interface': 'utun3', 'address': 'fe80::ce81:b1c:bd2c:69e%utun3', 'ip_address': IPv6Address('fe80::ce81:b1c:bd2c:69e')}: DNS lookup for fe80::ce81:b1c:bd2c:69e%utun3 timed out after 0.1 seconds   (network.py:90)
[6] [2025-05-16 16:51:23.639] [               ] uib opsi CA not found in cert file '/Users/me/.config/opsi/services/xxx.xxx.32.25_4447/ca-certs.pem', nothing to remove (1 certificates total)   (opsiservice.py:834)
[6] [2025-05-16 16:51:23.703] [               ] Fetching opsi CA from service (verify=/Users/me/.config/opsi/services/xxx.xxx.32.25_4447/ca-certs.pem)   (opsiservice.py:799)
[6] [2025-05-16 16:51:23.771] [               ] CA cert file '/Users/me/.config/opsi/services/xxx.xxx.32.25_4447/ca-certs.pem' successfully updated (1 certificates total)   (opsiservice.py:795)
[6] [2025-05-16 16:51:23.772] [               ] JSONRPC request to https://xxx.xxx.32.25:4447: id='0dbb14f3-146e-4ab0-a55e-a2b1e35d67b1', method=backend_getInterface, Content-Type=application/msgpack, Content-Encoding=lz4, timeout=300.0   (opsiservice.py:1552)
[6] [2025-05-16 16:51:23.805] [               ] Got response status=200, id='0dbb14f3-146e-4ab0-a55e-a2b1e35d67b1', method=backend_getInterface, Content-Type=application/msgpack, Content-Encoding=lz4, duration=0.033s   (opsiservice.py:1575)
[6] [2025-05-16 16:51:23.832] [               ] JSONRPC request to https://xxx.xxx.32.25:4447: id='cd751d6d-feb3-45bc-92fc-70b5357759bd', method=product_getObjects, Content-Type=application/msgpack, Content-Encoding=lz4, timeout=300.0   (opsiservice.py:1552)
[6] [2025-05-16 16:51:23.851] [               ] Got response status=200, id='cd751d6d-feb3-45bc-92fc-70b5357759bd', method=product_getObjects, Content-Type=application/msgpack, Content-Encoding=, duration=0.018s   (opsiservice.py:1575)
[6] [2025-05-16 16:51:23.851] [               ] JSONRPC request to https://xxx.xxx.32.25:4447: id='974c85a8-0ba7-4bc1-919e-c2262ba5a417', method=productOnDepot_getObjects, Content-Type=application/msgpack, Content-Encoding=lz4, timeout=300.0   (opsiservice.py:1552)
[6] [2025-05-16 16:51:23.869] [               ] Got response status=200, id='974c85a8-0ba7-4bc1-919e-c2262ba5a417', method=productOnDepot_getObjects, Content-Type=application/msgpack, Content-Encoding=, duration=0.018s   (opsiservice.py:1575)
Lassen sich diese Lookups irgendwie deaktivieren?

Server-Version ist 4.3.31.27 falls relevant, die opsi-cli Version steht im Log-Output.

Viele Grüße
Stefan

Re: Performance-Problem mit opsi-cli auf MacOS

Verfasst: 19 Mai 2025, 07:47
von j.schneider
Hallo Stefan,

danke für die Meldung.
Ja, ich denke, wir können diese Lookups verhindern.
Ich schaue mir das an.

Grüße
Jan Schneider

Re: Performance-Problem mit opsi-cli auf MacOS

Verfasst: 19 Mai 2025, 17:02
von j.schneider
Das Problem sollte mit opsi-cli 4.3.20.0 behoben sein.
Diese Version befindet sich aktuell im experimental-Zweig.

Code: Alles auswählen

opsi-cli self upgrade --branch experimental

Re: Performance-Problem mit opsi-cli auf MacOS

Verfasst: 19 Mai 2025, 21:11
von yumxac
1. Lauf: opsi-cli package list 0.42s user 0.10s system 14% cpu 3.590 total
Und danach: opsi-cli package list 0.37s user 0.05s system 70% cpu 0.593 total

Sieht gut aus, Danke!