Announcement

Collapse
No announcement yet.

optimizing nic for speed

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    optimizing nic for speed

    I just switched to at&t fiber. When booted into windows, I pull speeds of 700-900 Mbps down. Running same test (speedtest.net) in Kubuntu 16.0, I am maxing around 350 Mbps. I know using the full 1Gbps is probably unattainable, but I would like to get closer to what windows can do. Not sure where to start. Driver tweaks, network settings

    #2
    please post the output of nmcli device show and nmcli device
    Last edited by flamboyant; Oct 27, 2017, 03:37 AM.
    community is what will save us

    Comment


      #3
      There a literally dozens of web pages (if not hundreds) about networking tweaks. Here's a few I've been using in /etc/sysctl.conf;

      Code:
      [FONT=monospace][COLOR=#000000]net.core.wmem_max = 12582912[/COLOR]
      net.core.rmem_max = 12582912
      net.ipv4.tcp_rmem = 10240 87380 12582912
      net.ipv4.tcp_wmem = 10240 87380 12582912
      net.ipv4.tcp_window_scaling = 1
      net.ipv4.tcp_timestamps = 1
      net.ipv4.tcp_sack = 1
      net.ipv4.tcp_no_metrics_save = 1
      net.ipv4.tcp_challenge_ack_limit = 999999999
      net.core.netdev_max_backlog = 5000
      # new
      net.ipv4.tcp_fin_timeout = 60
      net.ipv4.tcp_retries1 = 3
      net.ipv4.tcp_keepalive_probes = 9
      net.ipv4.tcp_keepalive_time = 7200
      net.ipv4.tcp_syn_retries = 5
      #disable ipv6
      net.ipv6.conf.all.disable_ipv6 = 1
      net.ipv6.conf.default.disable_ipv6 = 1
      net.ipv6.conf.lo.disable_ipv6 = 1
      
      [/FONT]
      However, it's been a long time since I've reviewed these. I have a 200Mbs connection and Speedtest shows me around 210-215 so I'm happy as-is.

      https://pleiades.ucsc.edu/hyades/Linux_Network_Tuning

      Please Read Me

      Comment


        #4
        On the above linked page is a neat way to set your txqueuelen to 10000 which can help performance. My ethernet cards names all start with "en" so this udev rule worked for me:

        Code:
        #
        # custom txqueuelen parameter value
        #
        KERNEL=="en*", RUN+="/sbin/ip link set %k txqueuelen 10000"

        Please Read Me

        Comment


          #5
          Originally posted by flamboyant View Post
          please post the
          output of nmcli device show
          virgil@reeser:~$ nmcli device show
          GENERAL.DEVICE: virbr0
          GENERAL.TYPE: bridge
          GENERAL.HWADDR: 00:00:00:00:00:00
          GENERAL.MTU: 1500
          GENERAL.STATE: 100 (connected)
          GENERAL.CONNECTION: virbr0
          GENERAL.CON-PATH: /org/freedesktop/NetworkManager/ActiveConnection/1
          IP4.ADDRESS[1]: 192.168.122.1/24
          IP4.GATEWAY:
          IP6.GATEWAY:

          GENERAL.DEVICE: enp5s0
          GENERAL.TYPE: ethernet
          GENERAL.HWADDR: 4C:CC:6A:27:42:A2
          GENERAL.MTU: 1500
          GENERAL.STATE: 100 (connected)
          GENERAL.CONNECTION: Wired connection 1
          GENERAL.CON-PATH: /org/freedesktop/NetworkManager/ActiveConnection/0
          WIRED-PROPERTIES.CARRIER: on
          IP4.ADDRESS[1]: 192.168.1.90/24
          IP4.GATEWAY: 192.168.1.254
          IP4.ROUTE[1]: dst = 169.254.0.0/16, nh = 0.0.0.0, mt = 1000
          IP4.DNS[1]: 192.168.1.254
          IP4.DOMAIN[1]: attlocal.net
          IP6.ADDRESS[1]: fe80::4ecc:6aff:fe27:42a2/64
          IP6.GATEWAY:

          GENERAL.DEVICE: wlx00c0ca5a5f67
          GENERAL.TYPE: wifi
          GENERAL.HWADDR: 00:C0:CA:5A:5F:67
          GENERAL.MTU: 0
          GENERAL.STATE: 30 (disconnected)
          GENERAL.CONNECTION: --
          GENERAL.CON-PATH: --

          GENERAL.DEVICE: lo
          GENERAL.TYPE: loopback
          GENERAL.HWADDR: 00:00:00:00:00:00
          GENERAL.MTU: 65536
          GENERAL.STATE: 10 (unmanaged)
          GENERAL.CONNECTION: --
          GENERAL.CON-PATH: --
          IP4.ADDRESS[1]: 127.0.0.1/8
          IP4.GATEWAY:
          IP6.ADDRESS[1]: ::1/128
          IP6.GATEWAY:

          GENERAL.DEVICE: virbr0-nic
          GENERAL.TYPE: tun
          GENERAL.HWADDR: 52:54:00:43:B9:D3
          GENERAL.MTU: 1500
          GENERAL.STATE: 10 (unmanaged)
          GENERAL.CONNECTION: --
          GENERAL.CON-PATH: --



          nmcli device

          virgil@reeser:~$ nmcli device
          DEVICE TYPE STATE CONNECTION
          virbr0 bridge connected virbr0
          enp5s0 ethernet connected Wired connection 1
          wlx00c0ca5a5f67 wifi disconnected --
          lo loopback unmanaged --
          virbr0-nic tun unmanaged --

          Comment


            #6
            Originally posted by oshunluvr View Post
            There a literally dozens of web pages (if not hundreds) about networking tweaks. Here's a few I've been using in /etc/sysctl.conf;

            Code:
            [FONT=monospace][COLOR=#000000]net.core.wmem_max = 12582912[/COLOR]
            net.core.rmem_max = 12582912
            net.ipv4.tcp_rmem = 10240 87380 12582912
            net.ipv4.tcp_wmem = 10240 87380 12582912
            net.ipv4.tcp_window_scaling = 1
            net.ipv4.tcp_timestamps = 1
            net.ipv4.tcp_sack = 1
            net.ipv4.tcp_no_metrics_save = 1
            net.ipv4.tcp_challenge_ack_limit = 999999999
            net.core.netdev_max_backlog = 5000
            # new
            net.ipv4.tcp_fin_timeout = 60
            net.ipv4.tcp_retries1 = 3
            net.ipv4.tcp_keepalive_probes = 9
            net.ipv4.tcp_keepalive_time = 7200
            net.ipv4.tcp_syn_retries = 5
            #disable ipv6
            net.ipv6.conf.all.disable_ipv6 = 1
            net.ipv6.conf.default.disable_ipv6 = 1
            net.ipv6.conf.lo.disable_ipv6 = 1
            
            [/FONT]
            However, it's been a long time since I've reviewed these. I have a 200Mbs connection and Speedtest shows me around 210-215 so I'm happy as-is.

            https://pleiades.ucsc.edu/hyades/Linux_Network_Tuning
            using

            # increase TCP max buffer size setable using setsockopt()
            net.core.rmem_max = 16777216
            net.core.wmem_max = 16777216
            # increase Linux autotuning TCP buffer limits
            # min, default, and max number of bytes to use
            # set max to at least 4MB, or higher if you use very high BDP paths
            net.ipv4.tcp_rmem = 4096 87380 16777216
            net.ipv4.tcp_wmem = 4096 65536 16777216
            # don't cache ssthresh from previous connection
            net.ipv4.tcp_no_metrics_save = 1
            net.ipv4.tcp_moderate_rcvbuf = 1
            # recommended to increase this for 1000 BT or higher
            net.core.netdev_max_backlog = 5000
            # Turn off timestamps
            net.ipv4.tcp_timestamps = 0
            # disable tcp selective acknowledgements.
            net.ipv4.tcp_sack = 0
            #enable window scaling
            net.ipv4.tcp_window_scaling = 1

            #disable ipv6
            net.ipv6.conf.all.disable_ipv6 = 1
            net.ipv6.conf.default.disable_ipv6 = 1
            net.ipv6.conf.lo.disable_ipv6 = 1


            Comment


              #7
              after turning off ipv6 I get

              PING 26ms

              DOWNLOAD 929.63 Mbps

              UPLOAD 939.80 Mbps

              Much better
              Last edited by Snowhog; Oct 27, 2017, 06:57 PM.

              Comment


                #8
                Originally posted by vsreeser View Post
                virgil@reeser:~$ nmcli device
                virbr0 bridge connected virbr0
                ...
                virbr0-nic tun unmanaged --
                is your Kubuntu on a virtual machine?

                Originally posted by vsreeser View Post
                PING 26ms
                DOWNLOAD 929.63 Mbps
                UPLOAD 939.80 Mbps
                i guess that's what you wanted. if yes, please mark the thread as solved.
                community is what will save us

                Comment


                  #9
                  Mmmm ...
                  Do you have IPv6 configured and working?
                  IPv6 is 30% of the Internet traffic.
                  I have a Hurricane IPv6 tunnel. It is my default protocol with a fallback to IPv4 in less than a second.
                  My 100 Mb fiber optic gives me a symmetrical 100 Mb up and down using my ISP ‘s server.
                  Half a world awayI get around 85 Mb down. That’s browsing speed. I downloaded the 19Gb JFK files and the max DL speed was 17 Mbps. Regardless of your ISP bandwidth you can’t DL faster than thesource server will allow.
                  "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
                  – John F. Kennedy, February 26, 1962.

                  Comment


                    #10
                    Tried both sysctl configs listed above and both brought significant improvement but I got the best performance from the options in the Arch wiki - since y'all got me started on this and all

                    https://wiki.archlinux.org/index.php/sysctl#Networking

                    Code:
                    # The maximum size of the receive queue.
                    # The received frames will be stored in this queue after taking them from the ring buffer on the NIC.
                    # Use high value for high speed cards to prevent loosing packets.
                    # In real time application like SIP router, long queue must be assigned with high speed CPU otherwise the data in the queue will be out of date (old).
                    
                    net.core.netdev_max_backlog = 65536
                    
                    # The maximum ancillary buffer size allowed per socket.
                    # Ancillary data is a sequence of struct cmsghdr structures with appended data.
                    
                    net.core.optmem_max = 65536
                    
                    # The upper limit on the value of the backlog parameter passed to the listen function.
                    # Setting to higher values is only needed on a single highloaded server where new connection rate is high/bursty
                    
                    net.core.somaxconn = 16384
                    
                    # The default and maximum amount for the receive/send socket memory
                    # By default the Linux network stack is not configured for high speed large file transfer across WAN links.
                    # This is done to save memory resources.
                    # You can easily tune Linux network stack by increasing network buffers size for high-speed networks that connect server systems to handle more network packets.
                    
                    net.core.rmem_default = 1048576
                    net.core.wmem_default = 1048576
                    net.core.rmem_max = 16777216
                    net.core.wmem_max = 16777216
                    net.ipv4.tcp_rmem = 4096 87380 16777216
                    net.ipv4.tcp_wmem = 4096 65536 16777216
                    net.ipv4.udp_rmem_min = 16384
                    net.ipv4.udp_wmem_min = 16384
                    
                    # An extension to the transmission control protocol (TCP) that helps reduce network latency by enabling data to be exchanged during the sender’s initial TCP SYN.
                    # If both of your server and client are deployed on Linux 3.7.1 or higher, you can turn on fast_open for lower latency
                    
                    net.ipv4.tcp_fastopen = 3
                    
                    # The maximum queue length of pending connections 'Waiting Acknowledgment'
                    # In the event of a synflood DOS attack, this queue can fill up pretty quickly, at which point tcp_syncookies will kick in allowing your system to continue to respond to legitimate traffic, and allowing you to gain access to block malicious IPs.
                    # If the server suffers from overloads at peak times, you may want to increase this value a little bit.
                    
                    net.ipv4.tcp_max_syn_backlog = 65536
                    
                    # The maximum number of sockets in 'TIME_WAIT' state.
                    # After reaching this number the system will start destroying the socket in this state.
                    # Increase this to prevent simple DOS attacks
                    
                    net.ipv4.tcp_max_tw_buckets = 65536
                    
                    # Whether TCP should start at the default window size only for new connections or also for existing connections that have been idle for too long.
                    # It kills persistent single connection performance and should be turned off.
                    
                    net.ipv4.tcp_slow_start_after_idle = 0
                    
                    # Whether TCP should reuse an existing connection in the TIME-WAIT state for a new outgoing connection if the new timestamp is strictly bigger than the most recent timestamp recorded for the previous connection.
                    # This helps avoid from running out of available network sockets.
                    
                    net.ipv4.tcp_tw_reuse = 1
                    
                    # Fast-fail FIN connections which are useless.
                    
                    net.ipv4.tcp_fin_timeout = 15
                    
                    # TCP keepalive is a mechanism for TCP connections that help to determine whether the other end has stopped responding or not.
                    # TCP will send the keepalive probe contains null data to the network peer several times after a period of idle time. If the peer does not respond, the socket will be closed automatically.
                    # By default, TCP keepalive process waits for two hours (7200 secs) for socket activity before sending the first keepalive probe, and then resend it every 75 seconds. As long as there is TCP/IP socket communications going on and active, no keepalive packets are needed.
                    # With the following settings, your application will detect dead TCP connections after 120 seconds (60s + 10s + 10s + 10s + 10s + 10s + 10s)
                    
                    net.ipv4.tcp_keepalive_time = 60
                    net.ipv4.tcp_keepalive_intvl = 10
                    net.ipv4.tcp_keepalive_probes = 6
                    
                    # The longer the MTU the better for performance, but the worse for reliability.
                    # This is because a lost packet means more data to be retransmitted and because many routers on the Internet can't deliver very long packets.
                    # Enable smart MTU discovery when an ICMP black hole detected.
                    
                    net.ipv4.tcp_mtu_probing = 1
                    
                    # Turn timestamps off to reduce performance spikes related to timestamp generation.
                    
                    net.ipv4.tcp_timestamps = 0
                    i also disabled IPv6. Getting a reproducible 2ms ping and 115Mbps on a 100 megabit fiber connection.
                    Last edited by wizard10000; Oct 28, 2017, 01:46 PM.
                    we see things not as they are, but as we are.
                    -- anais nin

                    Comment


                      #11
                      Originally posted by flamboyant View Post
                      is your Kubuntu on a virtual machine?

                      i guess that's what you wanted. if yes, please mark the thread as solved.
                      Speed appears to be a fluke. Can't get there again. Not on a virtual machine. Bare metal. Fairly hefty machine (self-build) can handle most anything. I'm always looking for things to tweak for more speed. Used to do that in cars til I wrecked one at 100+ in a 35 zone. I was 19, immortal, and stupid. Easier to fix broken software than dead body

                      Comment


                        #12
                        Did IPv6 get turned on again?

                        (Immortal teenager -- check. Borrowed my dad's new 1957 Plymouth Fury at 11:45PM. He worked at Shwayder Bros, near where the I25 on ramp off Broadway is. He said to be back by 1:00AM, when he gets off of work. Full tank of gas, 25 gal. What to do? I got onto I25 and drove to the city limits of Colorado Springs, turned around and drove back. Met him at the employee entrance at 1AM. 1/4th tank of gas left. He asked how many of my friends I siphoned gas into their cars for. He never noticed the extra 140 miles on the odometer.)
                        "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
                        – John F. Kennedy, February 26, 1962.

                        Comment

                        Working...
                        X