Problem: Nextcloud Login is sometimes very slow and sometimes very fast

dns
login
nextcloud
problem
ucs43

#1

Problem

The login to the Nextcloud app is not reliable. Sometimes it is very fast but very often it takes up to three or four minutes.

Investigation

Nextcloud was installed as a container on the UCS host.

Step 1: Server usage

top did not show any high load on the server:

top - 17:07:49 up  8:57,  1 user,  load average: 0,02, 0,05, 0,01
Tasks: 164 total,   1 running, 163 sleeping,   0 stopped,   0 zombie
%Cpu(s):  0,7 us,  1,0 sy,  0,0 ni, 97,7 id,  0,7 wa,  0,0 hi,  0,0 si,  0,0 st
KiB Mem :  4050972 total,  2568596 free,   691516 used,   790860 buff/cache
KiB Swap:  2097148 total,  2097148 free,        0 used.  3107404 avail Mem 

  PID USER      PR  NI    VIRT    RES    SHR S %CPU %MEM     TIME+ COMMAND      
    7 root      20   0       0      0      0 S  0,3  0,0   0:05.00 rcu_sched    
 1285 root      20   0  521756  43828  21236 S  0,3  1,1   0:00.28 samba        
 1926 root      20   0  177952  22240  11148 S  0,3  0,5   0:00.78 dhcpd        
30311 root      20   0  139808  10608   9152 S  0,3  0,3   0:00.03 sshd         

Step 2: Check network settings

Use ip, route and ucr to get information about network settings:

root@ucs:~# ip a

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever

2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:22:19:ba:13:67 brd ff:ff:ff:ff:ff:ff
    inet 172.16.100.100/16 brd 172.10.255.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::222:19ff:feba:1367/64 scope link 
       valid_lft forever preferred_lft forever

3: docker0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default 
    link/ether 02:42:26:c8:b9:ab brd ff:ff:ff:ff:ff:ff
    inet 172.17.42.1/16 scope global docker0
       valid_lft forever preferred_lft forever
    inet6 fe80::42:26ff:fec8:b9ab/64 scope link 
       valid_lft forever preferred_lft forever
root@ucs:~# route -n

Kernel-IP-Routentabelle
Ziel            Router          Genmask         Flags Metric Ref    Use Iface
0.0.0.0         172.16.100.1    0.0.0.0         UG    0      0        0 eth0
172.16.0.0      0.0.0.0         255.255.0.0     U     0      0        0 eth0
172.17.0.0      0.0.0.0         255.255.0.0     U     0      0        0 docker0
root@ucs:~# ucr search --brief --value 172.
appcenter/apps/nextcloud/ip: 172.17.0.2
dns/allow/query/cache: localhost; 10.0.0.0/8; 169.254.0.0/16; 172.16.0.0/12; 192.168.0.0/16; fc00::/7; fe80::/10; localnets
dns/forwarder1: 172.16.100.1
docker/daemon/default/opts/bip: 172.17.42.1/16
gateway: 172.16.100.1
interfaces/eth0/address: 172.16.100.100
interfaces/eth0/broadcast: 172.16.255.255
interfaces/eth0/network: 172.16.0.0
nameserver1: 172.16.100.100
[...]

Step 3: Check consistency of DNS entries

Repeat DNS queries to leverage chacheing:

root@ucs:~# for i in {0..3}; do host ucs.multi.ucs; sleep 3; echo ---; done
ucs.multi.ucs has address 192.168.1.9
ucs.multi.ucs has address 172.16.200.100
---
ucs.multi.ucs has address 192.168.1.9
ucs.multi.ucs has address 172.16.200.100
---
ucs.multi.ucs has address 172.16.200.100
ucs.multi.ucs has address 192.168.1.9

Above shows a second IP address for the host named “ucs.multi.ucs” but this IP address is not configured (see above steps).

Step 4:

Check DNS entry of the host in UMC.
In UMC the host had as additional IP the address 192.168.1.9 which was removed then.

Solution

In DNS settings the UCS server had an non existing IP address attached. Removing this IP led brought a fast login back.


closed #2