Avahi et latence sur le lancement d'applications [Réglé]

babs3 Membre non connecté
-
- Voir le profil du membre babs3
- Inscrit le : 22/05/2013
- Groupes :
J'ai observé un phénomène curieux sur 2 laptops différents, sous Mageia 7.1 sous plasma qui arrive de temps en temps.
Une très grosse latence dès que l'on veut lancer une application.
J'ai en ce moment ce phénomène sur mon laptop aussi j'en profite pour faire un diagnostic.
Si je lance par exemple konsole avec strace j'observe lors du blocage :
fcntl(7, F_SETFD, FD_CLOEXEC) = 0
connect(7, {sa_family=AF_UNIX, sun_path="/var/run/avahi-daemon/socket"}, 110) = 0
fcntl(7, F_GETFL) = 0x2 (flags O_RDWR)
fstat(7, {st_mode=S_IFSOCK|0777, st_size=0, ...}) = 0
write(7, "RESOLVE-HOSTNAME-IPV4 linux.loca"..., 34) = 34
read(7, "-15 Timeout reached\n", 4096) = 20
close(7) = 0
J'ai aussi vu passer cela :
_IceTransSocketUNIXConnect: Cannot connect to non-local host localhost.localdomain
Qt: Session management error: Could not open network socket
Sur l'autre laptop (ce phénomene était fréquent) j'ai résolu le problème en virant avahi.
Pourquoi ai-je ce phénomène cette fois-ci ?
Pourquoi as-t-il besoin de se connecter au réseau pour lancer une application type konsole ?
Quel est l'utilité d'avahi ?
Merci !
Jacques
Édité par babs3 Le 08/06/2020 à 16h06

Jybz Membre non connecté
-
- Voir le profil du membre Jybz
- Inscrit le : 10/10/2018
- Groupes :
-
Administrateur
-
Forgeron
Comme : android.local peut être une adresse pour accéder à un smartphone sous android (au lieu de taper son ip).
Téléverser une image : /wiki/hebergement-de-fichiers-sur-mlo
Arch | Machine | OS |
x86_64 | lenovo x250 | mga9 |
armv7hl | bananapro | mga9 |
aarch64 | Raspberry Pi 4B | mga9 |

babs3 Membre non connecté
-
- Voir le profil du membre babs3
- Inscrit le : 22/05/2013
- Groupes :
Pourquoi RESOLVE-HOSTNAME-IPV4 linux.loca n'arrive pas à se faire sur cette cession ? Qu'est-ce que je peux lancer comme diagnostic sur ma machine ?
Si je désactive avahi quelle est la conséquence.. ?
Je trouve bizarre que tout lancement d'application sous plasma comme konsole nécessite cela.
Merci !
Jacques

Papoteur Membre non connecté
-
- Voir le profil du membre Papoteur
- Inscrit le : 03/10/2011
- Groupes :
-
Modérateur
-
Équipe Mageia
-
Administrateur
-
Forgeron
Tu peux commencer par inspecter le fichier /etc/nswitch.conf
tu dois avoir dedans une ligne genre :
nswitch.conf :
hosts: files mdns4_minimal nis dns mdns4 myhostname
Cette ligne indique quels sont les différents moyens interrogés pour trouver une adresse IP et dans quel ordre.
le premier DOIT être "files", ce qui correspond au fichier /etc/hosts
mdns4_minimal correspond à avahi. Je soupçonne qu'il est placé avant files. J'ai eu un souci du genre pendant longtemps, où mon application web locale était très peu réactive. J'avais des délais de 5s pour les requêtes, ce qui correspondait à un timeout sur le service avahi.
Yves

babs3 Membre non connecté
-
- Voir le profil du membre babs3
- Inscrit le : 22/05/2013
- Groupes :
hosts: mdns4_minimal files nis dns mdns4 myhostname
Ce serait un défaut de conception de Mageia 7.1 il faudrait faire un bug report...
Merci !
Jacques
Édité par babs3 Le 05/06/2020 à 15h51

babs3 Membre non connecté
-
- Voir le profil du membre babs3
- Inscrit le : 22/05/2013
- Groupes :
La question aussi c'est pourquoi cela bug maintenant et pas avant ou probablement si je fais un reboot.
Et quel est l'intérêt de ce service. Je ne comprends pas pourquoi konsole ai besoin d'une IP..
Jacques

Jybz Membre non connecté
-
- Voir le profil du membre Jybz
- Inscrit le : 10/10/2018
- Groupes :
-
Administrateur
-
Forgeron
Beaucoup d'appel sur la boucle locale 127.0.0.1, etc.
Je répète, je ne sais pas. Mais j'imagine et ça ne me choque pas.
Par contre, je ne dirais pas un défaut de conception, je vérifierai ( je ne le peux pas immédiatement) mais ton fichier n'a pas l'air d'être celui par défaut.
Téléverser une image : /wiki/hebergement-de-fichiers-sur-mlo
Arch | Machine | OS |
x86_64 | lenovo x250 | mga9 |
armv7hl | bananapro | mga9 |
aarch64 | Raspberry Pi 4B | mga9 |

babs3 Membre non connecté
-
- Voir le profil du membre babs3
- Inscrit le : 22/05/2013
- Groupes :
_IceTransSocketUNIXConnect: Cannot connect to non-local host localhost.localdomain
Qt: Session management error: Could not open network socket
Sur les recommandations de papoteur, j'ai
- j'ai changé /etc/nsswitch.conf pour mettre files en premier
toujours le problème.
puis plus tard :
- désactivé le wifi
toujours le problème.
- désactivé le réseau filaire puis réactivé le réseau
cela a résolu le problème.
Si je remets files en deuxième dans nsswitch (en désactivant/réactiant l'éthernet) le problème ne revient pas.
Si relance ksysguard je n'ai plus le message d'erreur.
Jacques
Édité par babs3 Le 05/06/2020 à 18h25

babs3 Membre non connecté
-
- Voir le profil du membre babs3
- Inscrit le : 22/05/2013
- Groupes :
A noter avec la relance du réseau ma machine est passé du nom "linux" au nom "localhost".
Le problème est peut-être juste que le nom de la machine n'était pas bon pour avahi.
Je ne comprends toujours pas ce que je perdrais en inactivant avahi sur mon laptop..
Merci !
Jacques
Édité par babs3 Le 05/06/2020 à 20h50

Jybz Membre non connecté
-
- Voir le profil du membre Jybz
- Inscrit le : 10/10/2018
- Groupes :
-
Administrateur
-
Forgeron
Téléverser une image : /wiki/hebergement-de-fichiers-sur-mlo
Arch | Machine | OS |
x86_64 | lenovo x250 | mga9 |
armv7hl | bananapro | mga9 |
aarch64 | Raspberry Pi 4B | mga9 |

babs3 Membre non connecté
-
- Voir le profil du membre babs3
- Inscrit le : 22/05/2013
- Groupes :
Est-ce que cela veut juste dire juste que je ne peux plus identifier automatiquement une imprimante réseau ? Comme j'utilise une ip ce n'est pas un souci. ou bien cela veut dire que mon imprimante réseau ne pourra plus m'identifier sur le réseau ?
Si je lis ce qui est écrit ici cela semble être le cas :
https://wiki.archlinux.fr/Avahi
Je note ce matin que j'ai le même problème qu'hier...
J'ai démarré le portable avec activation de 3 interfaces réseaux : éthernet, wifi et mobile.
Ma machine a été baptisé d'office :
hostname: linux.local
Si je fais strace -o /tmp/poub.txt konsole j'ai :
connect(7, {sa_family=AF_UNIX, sun_path="/var/run/avahi-daemon/socket"}, 110) = 0
fcntl(7, F_GETFL) = 0x2 (flags O_RDWR)
fstat(7, {st_mode=S_IFSOCK|0777, st_size=0, ...}) = 0
write(7, "RESOLVE-HOSTNAME-IPV4 linux.loca"..., 34) = 34 [blocage ici avant un timeout]
read(7, "-15 Timeout reached\n", 4096) = 20
Et cela qui apparait :
_IceTransSocketUNIXConnect: Cannot connect to non-local host localhost.localdomain
Qt: Session management error: Could not open network socket
Si j'ouvre dolphin il y a la même latence.
Si je clique sur un lien dans thunderbird il met un temps fou à se lancer dans firefox.
mais si je lance soffice il n'y a pas de latence.
Si je regarde /etc/nsswitch.conf, j'ai files en premier :
hosts: files mdns4_minimal nis dns mdns4 myhostname
donc files en premier n'est pas la solution.
Jacques
Édité par babs3 Le 06/06/2020 à 11h15

babs3 Membre non connecté
-
- Voir le profil du membre babs3
- Inscrit le : 22/05/2013
- Groupes :
J'ai dans mon /etc/hosts
127.0.0.1 localhost
::1 localhost
Si je fais :
ping localhost
cela marche tout de suite
PING localhost(localhost (::1)) 56 data bytes
64 bytes from localhost (::1): icmp_seq=1 ttl=64 time=0.137 ms
64 bytes from localhost (::1): icmp_seq=2 ttl=64 time=0.100 m
si je fais :
ping linux.local
cela ne répond qu'avec une latence importante :
PING linux.local(linux.local (fe80::2e0:4cff:fe68:1122%ens8u1u1)) 56 data bytes
64 bytes from linux.local (fe80::2e0:4cff:fe68:1122%ens8u1u1): icmp_seq=1 ttl=64 time=3.78 ms
64 bytes from linux.local (fe80::2e0:4cff:fe68:1122%ens8u1u1): icmp_seq=2 ttl=64 time=0.126 ms
Cela bloque au même endroit :
connect(5, {sa_family=AF_UNIX, sun_path="/var/run/avahi-daemon/socket"}, 110) = 0
fcntl(5, F_GETFL) = 0x2 (flags O_RDWR)
fstat(5, {st_mode=S_IFSOCK|0777, st_size=0, ...}) = 0
write(5, "RESOLVE-HOSTNAME-IPV4 linux.loca"..., 34) = 34
Si je fais :
ping linux
pas de latence, cela affiche tout de suite :
ping: linux: Nom ou service inconnu
ping localhost.local
Latence (même phénomène avec strace) puis affichage :
ping: localhost.local: Nom ou service inconnu

Jybz Membre non connecté
-
- Voir le profil du membre Jybz
- Inscrit le : 10/10/2018
- Groupes :
-
Administrateur
-
Forgeron
ping NomImprimante.local
Ne fonctionnera plus.
Cependant,
Ping ip.ip.ip.ip
Fonctionnera tjr
Téléverser une image : /wiki/hebergement-de-fichiers-sur-mlo
Arch | Machine | OS |
x86_64 | lenovo x250 | mga9 |
armv7hl | bananapro | mga9 |
aarch64 | Raspberry Pi 4B | mga9 |

babs3 Membre non connecté
-
- Voir le profil du membre babs3
- Inscrit le : 22/05/2013
- Groupes :
J'imagine que c'est un problème de nom de machine ?
Merci !
Jacques

babs3 Membre non connecté
-
- Voir le profil du membre babs3
- Inscrit le : 22/05/2013
- Groupes :
Toujours dans mes tests (suggestions papoteur).
avahi-browse -a -t ne trouvait rien hier
aujourd'hui cela marche :
Caché :
+ wlo1 IPv4 DCP9020CDW @ linux Internet Printer local
+ wlo1 IPv4 Brother DCP-9020CDW-NB @ linux Internet Printer local
+ ens8u1u1 IPv6 DCP9020CDW @ linux Internet Printer local
+ ens8u1u1 IPv6 Brother DCP-9020CDW-NB @ linux Internet Printer local
+ ens8u1u1 IPv4 DCP9020CDW @ linux Internet Printer local
+ ens8u1u1 IPv4 Brother DCP-9020CDW-NB @ linux Internet Printer local
+ wlo1 IPv4 DCP9020CDW @ linux Secure Internet Printer local
+ wlo1 IPv4 Brother DCP-9020CDW-NB @ linux Secure Internet Printer local
+ ens8u1u1 IPv6 DCP9020CDW @ linux Secure Internet Printer local
+ ens8u1u1 IPv6 Brother DCP-9020CDW-NB @ linux Secure Internet Printer local
+ ens8u1u1 IPv4 DCP9020CDW @ linux Secure Internet Printer local
+ ens8u1u1 IPv4 Brother DCP-9020CDW-NB @ linux Secure Internet Printer local
+ wlo1 IPv4 DCP9020CDW @ linux UNIX Printer local
+ wlo1 IPv4 Brother DCP-9020CDW-NB @ linux UNIX Printer local
+ ens8u1u1 IPv6 DCP9020CDW @ linux UNIX Printer local
+ ens8u1u1 IPv6 Brother DCP-9020CDW-NB @ linux UNIX Printer local
+ ens8u1u1 IPv4 DCP9020CDW @ linux UNIX Printer local
+ ens8u1u1 IPv4 Brother DCP-9020CDW-NB @ linux UNIX Printer local
+ wlo1 IPv4 linux SSH Remote Terminal local
+ ens8u1u1 IPv6 linux SSH Remote Terminal local
+ ens8u1u1 IPv4 linux SSH Remote Terminal local
+ wlo1 IPv4 DCP9020CDW @ linux Internet Printer local
+ wlo1 IPv4 Brother DCP-9020CDW-NB @ linux Internet Printer local
+ ens8u1u1 IPv6 DCP9020CDW @ linux Internet Printer local
+ ens8u1u1 IPv6 Brother DCP-9020CDW-NB @ linux Internet Printer local
+ ens8u1u1 IPv4 DCP9020CDW @ linux Internet Printer local
+ ens8u1u1 IPv4 Brother DCP-9020CDW-NB @ linux Internet Printer local
+ wlo1 IPv4 DCP9020CDW @ linux Secure Internet Printer local
+ wlo1 IPv4 Brother DCP-9020CDW-NB @ linux Secure Internet Printer local
+ ens8u1u1 IPv6 DCP9020CDW @ linux Secure Internet Printer local
+ ens8u1u1 IPv6 Brother DCP-9020CDW-NB @ linux Secure Internet Printer local
+ ens8u1u1 IPv4 DCP9020CDW @ linux Secure Internet Printer local
+ ens8u1u1 IPv4 Brother DCP-9020CDW-NB @ linux Secure Internet Printer local
+ wlo1 IPv4 DCP9020CDW @ linux UNIX Printer local
+ wlo1 IPv4 Brother DCP-9020CDW-NB @ linux UNIX Printer local
+ ens8u1u1 IPv6 DCP9020CDW @ linux UNIX Printer local
+ ens8u1u1 IPv6 Brother DCP-9020CDW-NB @ linux UNIX Printer local
+ ens8u1u1 IPv4 DCP9020CDW @ linux UNIX Printer local
+ ens8u1u1 IPv4 Brother DCP-9020CDW-NB @ linux UNIX Printer local
+ wlo1 IPv4 linux SSH Remote Terminal local
+ ens8u1u1 IPv6 linux SSH Remote Terminal local
+ ens8u1u1 IPv4 linux SSH Remote Terminal local
Si je fais en route :
systemctl stop avahi-daemon.service
puis ensuite :
avahi-browse -a -t
il n'affiche plus rien (et se bloque sans le -t)
mais on dirait qu'avahi se relance immédiatement :
systemctl status avahi-daemon.service
affiche :
Loaded: loaded (/usr/lib/systemd/system/avahi-daemon.service; enabled; vendor preset: >
Active: active (running) since Sat 2020-06-06 11:35:20 CEST; 7min ago
Caché :
avahi-daemon.service - Avahi mDNS/DNS-SD Stack
Loaded: loaded (/usr/lib/systemd/system/avahi-daemon.service; enabled; vendor preset: >
Active: active (running) since Sat 2020-06-06 11:35:20 CEST; 7min ago
Main PID: 3857 (avahi-daemon)
Status: "avahi-daemon 0.7 starting up."
Tasks: 2 (limit: 4915)
Memory: 1.2M
CGroup: /system.slice/avahi-daemon.service
├─3857 avahi-daemon: running [linux.local]
└─3858 avahi-daemon: chroot helper
avahi-daemon.service - Avahi mDNS/DNS-SD Stack
Loaded: loaded (/usr/lib/systemd/system/avahi-daemon.service; enabled; vendor preset: >
Active: active (running) since Sat 2020-06-06 11:35:20 CEST; 7min ago
Main PID: 3857 (avahi-daemon)
Status: "avahi-daemon 0.7 starting up."
Tasks: 2 (limit: 4915)
Memory: 1.2M
CGroup: /system.slice/avahi-daemon.service
├─3857 avahi-daemon: running [linux.local]
└─3858 avahi-daemon: chroot helper
ps -ef | grep avahi
avahi 32503 1 0 11:45 ? 00:00:00 avahi-daemon: running [linux.local]
avahi 32504 32503 0 11:45 ? 00:00:00 avahi-daemon: chroot helper
il y a toujours le problème de latence avec le même symptome strace.
Sous network-manager j'ai via modifier les connections
Parametre ipv4 :
pour éthernet ens8u1u1 (00:E0:4C:68:11:22) (correspond à mon extension usb-c to ethernet)
adresse automatique par dhcp
Serveurs DNS: 8.8.8.8, 8.8.4.4
Pour wifi:
adresse automatique par dhcp
Serveurs DNS: 8.8.8.8, 8.8.4.4
4G Orange
Methode : automatique
J'ai l'applet network-manager et net-applet.
net-applet affiche :

network-manager affiche :



Si je fais :
hostname
j'ai :
linux.local
si je fais:
nmcli general hostname
j'ai :
localhost.localdomain
cat /etc/hostname
localhost.localdomain
cat /etc/sysconfig/network
HOSTNAME=localhost.localdomain
NETWORKING=yes
CRDA_DOMAIN=FR
Édité par babs3 Le 06/06/2020 à 12h36
Répondre
Vous n'êtes pas autorisé à écrire dans cette catégorie