Closed dschier-wtd closed 3 years ago
Update for a redo in the same container:
$ sudo podman run -it --name client01 --network test01 fedora:33 bash
[root@534fd4a9ce91 /]# time curl web01
<html><body><h1>It works!</h1></body></html>
real 0m0.948s
user 0m0.003s
sys 0m0.011s
[root@534fd4a9ce91 /]# time curl web01
<html><body><h1>It works!</h1></body></html>
real 0m0.954s
user 0m0.007s
sys 0m0.004s
[root@534fd4a9ce91 /]# time curl web01
<html><body><h1>It works!</h1></body></html>
real 0m0.813s
user 0m0.006s
sys 0m0.005s
Additional update / workaround:
Using the internal fqdn (excluding the search domain) solves the issue:
[root@95b42f3e3572 /]# time curl web01
<html><body><h1>It works!</h1></body></html>
real 0m0.974s
user 0m0.006s
sys 0m0.006s
[root@95b42f3e3572 /]# time curl web01.dns.podman
<html><body><h1>It works!</h1></body></html>
real 0m0.008s
user 0m0.003s
sys 0m0.005s
For me, this is good enough, but maybe worth an inspection how dnsname/dnsmasq are resolving search domains/priorities these. Maybe internet resolving is tried first and times out or so. Not sure.
@baude Dunno, if this may impact the docker-compose functionality of podman3.0, but it may be worth a look. it is very common to define multiple networks in docker-compose and communicate via hostnames.
@daniel-wtd can you try with --dns-search dns.podman
for the podman run command
Hi,
I started both of the containers with --dns-search dns.podman
. Please find the results below. Looking good.
sudo podman container run --rm --network test01 --dns-search dns.podman fedora:33 bash -c "time curl web01"
real 0m0.005s
user 0m0.002s
sys 0m0.003s
sudo podman container run --rm --network test01 --dns-search dns.podman fedora:33 bash -c "time curl example.com"
real 0m0.227s
user 0m0.002s
sys 0m0.004s
OK I think we should add this automatically when dnsname is used. In order to do so dnsname has to add the dns search domain to the cni result and podman has to read the search domain and add it to resolv.conf.
Sounds like a plan. There may be the situation like:
And I am not sure, if there are limitations in the resolvers. (count of dns search entries, dns server entries)
Note that dnsname currently only works for one attached network, see https://github.com/containers/podman/issues/8399, https://github.com/containers/podman/issues/9492 and #12
@Luap99 can we close this issue now?
Yes
Thanks a lot everybody :)
Why this issue occurs? Any ways to reproduce this issue?
Hi,
thanks for the very cool work and effort you are putting into podman. I have identified some very weird behavior, when using podman in combination with dnsname plugin.
It seems like there is a huge performance impact (x ~150 slower response), when using podman dnsname, instead of IPs or dns servers.
Step by Step
$ sudo podman network inspect test01 | grep dns
$ sudo podman container run -dt -P --name web01 --network test01 httpd
$ sudo podman container ls
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 3261a7db67f6 docker.io/library/httpd:latest httpd-foreground 13 seconds ago Up 12 seconds ago 0.0.0.0:39323->80/tcp web01
$ sudo podman container run --rm --network test01 fedora:33 bash -c "time curl 192.168.178.106:39323"
% Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 45 100 45 0 0 45000 0 --:--:-- --:--:-- --:--:-- 45000
It works!
real 0m0.004s user 0m0.001s sys 0m0.002s
$ sudo podman inspect web01 | grep IPAddress "IPAddress": "", "IPAddress": "10.89.0.11",
$ sudo podman container run --rm --network test01 fedora:33 bash -c "time curl 10.89.0.11" % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 45 100 45 0 0 45000 0 --:--:-- --:--:-- --:--:-- 45000
It works!
real 0m0.004s user 0m0.000s sys 0m0.004s
$ sudo podman container run fedora:33 bash -c "time curl nb01:39323" % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 45 100 45 0 0 22500
It works!
0 --:--:-- --:--:-- --:--:-- 22500real 0m0.006s user 0m0.001s sys 0m0.004s
$ sudo podman container run --rm --network test01 fedora:33 bash -c "time curl web01" % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 45 100 45 0 0 54 0 --:--:-- --:--:-- --:--:-- 54
It works!
real 0m0.835s user 0m0.003s sys 0m0.003s
user -> traefik -> nextcloud-web -> nextcloud-php -> nextcloud-db
$ podman --version podman version 2.2.1
$ rpm -qa | grep podman podman-2.2.1-1.fc33.x86_64 podman-docker-2.2.1-1.fc33.noarch podman-plugins-2.2.1-1.fc33.x86_64
$ rpm -qa | grep dnsmasq dnsmasq-2.83-1.fc33.x86_64