Ubuntu – Internet sites are loading slowly sometimes with Firefox and Chromium

internetlannetworking

On Ubunustudio sometimes sites load very slowly. This happens more often when I visit the site for the first time (e.g. looking something in google). The issue occurs in Firefox and Chromium. I already tried disabling IP6 which didn't help. Is there anything I can test beside of that? Download and upload speeds are fine, I guess it's maybe due to resolving adresses?

My system:

System:
  Host: marco-MS-7817 Kernel: 5.4.0-47-lowlatency x86_64 bits: 64 
  Desktop: Xfce 4.14.2 Distro: Ubuntu 20.04.1 LTS (Focal Fossa) 
Machine:
  Type: Desktop Mobo: MSI model: H81M-E34 (MS-7817) v: 3.0 
  serial: <superuser/root required> BIOS: American Megatrends v: 17.5 
  date: 03/30/2015 
CPU:
  Topology: Quad Core model: Intel Core i5-4460 bits: 64 type: MCP 
  L2 cache: 6144 KiB 
  Speed: 3200 MHz min/max: 800/3200 MHz Core speeds (MHz): 1: 3200 2: 3200 
  3: 3200 4: 3200 
Graphics:
  Device-1: Intel Xeon E3-1200 v3/4th Gen Core Processor Integrated Graphics 
  driver: i915 v: kernel 
  Display: x11 server: X.Org 1.20.8 driver: modesetting unloaded: fbdev,vesa 
  resolution: 1920x1080~60Hz 
  OpenGL: renderer: Mesa DRI Intel HD Graphics 4600 (HSW GT2) 
  v: 4.5 Mesa 20.0.8 
Audio:
  Device-1: Intel Xeon E3-1200 v3/4th Gen Core Processor HD Audio 
  driver: snd_hda_intel 
  Device-2: BEHRINGER UMC204HD 192k type: USB driver: snd-usb-audio 
  Device-3: AKAI Professional M.I. type: USB 
  driver: hid-generic,snd-usb-audio,usbhid 
  Sound Server: ALSA v: k5.4.0-47-lowlatency 
Network:
  Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet 
  driver: r8169 
  IF: enp2s0 state: up speed: 1000 Mbps duplex: full mac: d8:cb:8a:e8:e9:99 
Drives:
  Local Storage: total: 523.08 GiB used: 159.23 GiB (30.4%) 
  ID-1: /dev/sda vendor: Samsung model: SSD 850 EVO 250GB size: 232.89 GiB 
  ID-2: /dev/sdb type: USB vendor: Samsung model: Portable SSD T5 
  size: 232.89 GiB 
  ID-3: /dev/sdc type: USB vendor: SanDisk model: Ultra size: 57.30 GiB 
Partition:
  ID-1: / size: 36.41 GiB used: 12.45 GiB (34.2%) fs: ext4 dev: /dev/sda1 
  ID-2: /home size: 184.23 GiB used: 66.59 GiB (36.1%) fs: ext4 
  dev: /dev/sda6 
  ID-3: swap-1 size: 7.45 GiB used: 0 KiB (0.0%) fs: swap dev: /dev/sda5 
Sensors:
  System Temperatures: cpu: 41.0 C mobo: N/A 
  Fan Speeds (RPM): N/A 
Info:
  Processes: 260 Uptime: 20m Memory: 7.23 GiB used: 3.97 GiB (54.9%) 
  Shell: bash inxi: 3.0.38 

edit:

 sudo lshw -C network
[sudo] Passwort für marco: 
  *-network                 
       Beschreibung: Ethernet interface
       Produkt: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
       Hersteller: Realtek Semiconductor Co., Ltd.
       Physische ID: 0
       Bus-Informationen: pci@0000:02:00.0
       Logischer Name: enp2s0
       Version: 0c
       Seriennummer: d8:cb:8a:e8:e9:99
       Größe: 1Gbit/s
       Kapazität: 1Gbit/s
       Breite: 64 bits
       Takt: 33MHz
       Fähigkeiten: pm msi pciexpress msix vpd bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
       Konfiguration: autonegotiation=on broadcast=yes driver=r8169 duplex=full firmware=rtl8168g-2_0.0.1 02/06/13 ip=192.168.178.23 latency=0 link=yes multicast=yes port=MII speed=1Gbit/s
       Ressourcen: irq:18 ioport:e000(Größe=256) memory:f7d00000-f7d00fff memory:f0000000-f0003fff

ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    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: enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether d8:cb:8a:e8:e9:99 brd ff:ff:ff:ff:ff:ff
    inet 192.168.178.23/24 brd 192.168.178.255 scope global dynamic noprefixroute enp2s0
       valid_lft 862605sec preferred_lft 862605sec

@tracepath

When I execute it I'll get 1500 in the beginning, but the second time I get 1492, which seems to be the better value. Maybe this explains why I get issues sometimes when I first try to load a page. Where can I set MTU to 1492 permanently?

tracepath www.google.com
 1?: [LOCALHOST]                      pmtu 1500
 1:  fritz.box                                             7.938ms 
 1:  wpad.fritz.box                                        1.830ms 
 2:  x4db53c5a.dyn.telefonica.de                           2.639ms pmtu 1492
 2:  loopback1.0003.acln.02.fra.de.net.telefonica.de      14.828ms 
 3:  bundle-ether30.0004.dbrx.02.fra.de.net.telefonica.de  16.144ms 
 4:  bundle-ether1.0004.prrx.02.fra.de.net.telefonica.de  15.519ms 
 5:  72.14.213.76                                         16.803ms asymm 10 
 6:  keine Antwort
 7:  keine Antwort
 8:  keine Antwort
 9:  keine Antwort
10:  keine Antwort
11:  keine Antwort
12:  keine Antwort
13:  keine Antwort
14:  keine Antwort
15:  keine Antwort
16:  keine Antwort
17:  keine Antwort
18:  keine Antwort
19:  keine Antwort
20:  keine Antwort
21:  keine Antwort
22:  keine Antwort
23:  keine Antwort
24:  keine Antwort
25:  keine Antwort
26:  keine Antwort
27:  keine Antwort
28:  keine Antwort
29:  keine Antwort
30:  keine Antwort
     Too many hops: pmtu 1492
     Resume: pmtu 1492 

more info added on 28th september ….

link to image file with MTU settings: https://imgur.com/AOiPxjE.png

systemd-resolve --status
Global
       LLMNR setting: no                  
MulticastDNS setting: no                  
  DNSOverTLS setting: no                  
      DNSSEC setting: no                  
    DNSSEC supported: no                  
          DNS Domain: fritz.box           
          DNSSEC NTA: 10.in-addr.arpa     
                      16.172.in-addr.arpa 
                      168.192.in-addr.arpa
                      17.172.in-addr.arpa 
                      18.172.in-addr.arpa 
                      19.172.in-addr.arpa 
                      20.172.in-addr.arpa 
                      21.172.in-addr.arpa 
                      22.172.in-addr.arpa 
                      23.172.in-addr.arpa 
                      24.172.in-addr.arpa 
                      25.172.in-addr.arpa 
                      26.172.in-addr.arpa 
                      27.172.in-addr.arpa 
                      28.172.in-addr.arpa 
                      29.172.in-addr.arpa 
                      30.172.in-addr.arpa 
                      31.172.in-addr.arpa 
                      corp                
                      d.f.ip6.arpa        
                      home                
                      internal            
                      intranet            
                      lan                 
                      local               
                      private             
                      test                

Link 2 (enp2s0)
      Current Scopes: DNS          
DefaultRoute setting: yes          
       LLMNR setting: yes          
MulticastDNS setting: no           
  DNSOverTLS setting: no           
      DNSSEC setting: no           
    DNSSEC supported: no           
  Current DNS Server: 192.168.178.1
         DNS Servers: 192.168.178.1
          DNS Domain: ~.           
                      fritz.box    
lines 25-47/47 (END)
                      31.172.in-addr.arpa 
                      corp                
                      d.f.ip6.arpa        
                      home                
                      internal            
                      intranet            
                      lan                 
                      local               
                      private             
                      test                

Link 2 (enp2s0)
      Current Scopes: DNS          
DefaultRoute setting: yes          
       LLMNR setting: yes          
MulticastDNS setting: no           
  DNSOverTLS setting: no           
      DNSSEC setting: no           
    DNSSEC supported: no           
  Current DNS Server: 192.168.178.1
         DNS Servers: 192.168.178.1
          DNS Domain: ~.           
                      fritz.box    
~

ls -al /etc/resolv.conf
lrwxrwxrwx 1 root root 29 Sep 27 22:10 /etc/resolv.conf -> ../run/resolvconf/resolv.conf



 cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
# 127.0.0.53 is the systemd-resolved stub resolver.
# run "systemd-resolve --status" to see details about the actual nameservers.

nameserver 127.0.0.53
search fritz.box




dpkg -l *dnsmasq* | grep ii
ii  dnsmasq-base     2.80-1.1ubuntu1 amd64        Small caching DNS proxy and DHCP/TFTP server

Best Answer

  • Your problem is probably with the MTU setting for your DSL connection.

    enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500
    

    There's a MTU setting in Ubuntu's network configuration, and a WAN MTU setting in your router.

    For DSL, a common MTU setting is 1492. Just go ahead and try this value first and see if your web sites are now accessible.

    enter image description here

    To determine the correct setting, start with all MTU settings = 1500 and VPN = off. (VPN requires different testing).

    In the terminal:

    ping [-c count] [-M do] [-s packet_size] [host]
    

    The options used are:

    • c count: number of times to ping
    • M hint: Select Path MTU Discovery strategy. may be either do (prohibit fragmentation, even local one), want (do PMTU discovery, fragment locally when packet size is large), or dont (do not set DF flag).
    • s packet_size: Specifies the number of data bytes to be sent.

    You should always start at 1472 and work your way down by 10 each time. Once you get a reply, go up by 1 until you get a fragmented packet. Take that value (last good value) and add 28 to the value to account for the various TCP/IP headers. Eg. let's say that 1452 was the proper packet size (where you first got an ICMP reply to your ping). The actual MTU size would be 1480, which is the optimum for the network we're working with.

        ping -c 4 -M do -s 1472 8.8.8.8 # this will probably show fragmentation

        ping -c 4 -M do -s 1462 8.8.8.8 # may show fragmentation

        ping -c 4 -M do -s 1452 8.8.8.8 # no fragmentation?

        ping -c 4 -M do -s 1453 8.8.8.8 # still no fragmentation?

    reference: How to determine the proper MTU size with ICMP pings

  • Related Question