DEV Community

Michael
Michael

Posted on

When a Small NIC Ring Buffer Causes Random Slow Queries in GBase 8a

GBase 8a is an MPP analytical database from Chinese vendor GBASE, and some queries move large volumes of data between nodes. If the nic's rx and tx ring settings are too small, packets get dropped and identical SQL suddenly takes much longer. Here is the symptom, the diagnosis, and the fix from a real gbase cluster.

The Symptom

The same business SQL shows occasional cliff-edge slowdowns: normally 10 seconds, sometimes 100 seconds or even over 200 seconds. When it happens, the whole batch of queries is affected, and in most cases the issue eases and recovers on its own.

Investigation

Find the Node Causing the Slowdown

By the weakest-link principle, it is usually one node (sometimes several) dragging down the whole cluster. Locate it by checking which nodes the slow SQL lands on:

select NODE_NAME, ID, user, host, command, start_time, time, state, substring(info,0,100) info from information_schema.GNODES_TASK_INFORMATION where command='query' and info is not null and info not like '%information_schema.processlist%' order by time desc limit 10;
Enter fullscreen mode Exit fullscreen mode

Inspect the NIC Statistics

Use ifconfig -a eth0 (substitute your interface name) and focus on the rx and tx packet counters. A healthy interface looks like this:

[gbase@vm161 ~]$ ifconfig -a enp0s3
enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.0.2.161  netmask 255.255.255.0  broadcast 10.0.2.255
        inet6 fe80::a00:27ff:fe70:4bfc  prefixlen 64  scopeid 0x20<link>
        ether 08:00:27:70:4b:fc  txqueuelen 1000  (Ethernet)
        RX packets 229083  bytes 328000550 (312.8 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 35066  bytes 2680368 (2.5 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
Enter fullscreen mode Exit fullscreen mode

On the faulty node, the dropped count kept rising slowly and irregularly. The counters mean different things:

  • RX errors: total receive errors, including the dropped, overruns, and frame sub-counters.
  • dropped: packets the card received successfully but had to discard because system-level resources were insufficient to hand them up to the protocol stack (TCP/IP).
  • overruns: packets lost because the card's hardware receive Ring Buffer overflowed — a hardware-level overflow, a different layer of problem from the system-buffer overflow counted by dropped.

Check the Ring Settings

[root@vm161 ~]#  ethtool -g enp0s3
Ring parameters for enp0s3:
Pre-set maximums:
RX:                     4096
RX Mini:                n/a
RX Jumbo:               n/a
TX:                     4096
TX push buff len:       n/a
Current hardware settings:
RX:                     256
RX Mini:                n/a
RX Jumbo:               n/a
TX:                     256
RX Buf Len:             n/a
CQE Size:               n/a
TX Push:                n/a
RX Push:                n/a
TX push buff len:       n/a
TCP data split:         n/a
Enter fullscreen mode Exit fullscreen mode

The card allows 4,096 descriptors for both RX and TX, but the current hardware settings are only 256 — the RX ring is far too small.

The Fix

Raise rx and tx separately, then verify:

[root@vm161 ~]#  ethtool -G enp0s3 rx 4096 tx 4096
[root@vm161 ~]#  ethtool -g enp0s3
Ring parameters for enp0s3:
Pre-set maximums:
RX:                     4096
RX Mini:                n/a
RX Jumbo:               n/a
TX:                     4096
TX push buff len:       n/a
Current hardware settings:
RX:                     4096
RX Mini:                n/a
RX Jumbo:               n/a
TX:                     4096
RX Buf Len:             n/a
CQE Size:               n/a
TX Push:                n/a
RX Push:                n/a
TX push buff len:       n/a
TCP data split:         n/a
Enter fullscreen mode Exit fullscreen mode

After the change, dropped stopped increasing. Several days of observation showed no recurrence, and performance returned to a steady state.

Looking ahead, heavy inter-node traffic in an MPP system fills a small ring buffer fast, and every dropped packet adds retransmission and wait time to the queries running on gbase. Sizing the ring to what the card actually supports is a cheap check before blaming the database for a slowdown that comes and goes.

Top comments (0)