{
    "content": [
        {
            "type": "text",
            "text": "# tc-fq (info)\n\n## NAME\n\nFQ - Fair Queue traffic policing\n\n## SYNOPSIS\n\ntc  qdisc  ...  fq  [  limit PACKETS ] [ flowlimit PACKETS ] [ quantum\nBYTES ] [ initialquantum BYTES ] [ maxrate RATE ] [ buckets NUMBER ] [\norphanmask NUMBER ] [ pacing | nopacing ] [ cethreshold TIME ]\n\n## DESCRIPTION\n\nFQ (Fair Queue) is a classless packet scheduler meant to be mostly used\nfor locally generated traffic.  It is designed to achieve per flow pac-\ning.   FQ  does flow separation, and is able to respect pacing require-\nments set by TCP stack.  All packets belonging to a socket are  consid-\nered as a 'flow'.  For non local packets (router workload), packet hash\nis used as fallback.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **PARAMETERS**\n- **EXAMPLES**\n- **SEE ALSO**\n- **AUTHORS**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "tc-fq",
        "section": "",
        "mode": "info",
        "summary": "FQ - Fair Queue traffic policing",
        "synopsis": "tc  qdisc  ...  fq  [  limit PACKETS ] [ flowlimit PACKETS ] [ quantum\nBYTES ] [ initialquantum BYTES ] [ maxrate RATE ] [ buckets NUMBER ] [\norphanmask NUMBER ] [ pacing | nopacing ] [ cethreshold TIME ]",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [
            "#tc qdisc add dev eth0 root fq cethreshold 4ms",
            "#tc -s -d qdisc show dev eth0",
            "qdisc  fq  8001:  dev  eth0  root refcnt 2 limit 10000p flowlimit 100p",
            "buckets 1024 orphanmask  1023  quantum  3028b  initialquantum  15140b",
            "lowratethreshold 550Kbit refilldelay 40.0ms cethreshold 4.0ms",
            "Sent 72149092 bytes 48062 pkt (dropped 2176, overlimits 0 requeues 0)",
            "backlog 1937920b 1280p requeues 0",
            "flows 34 (inactive 17 throttled 0)",
            "gc 0 highprio 0 throttled 0 cemark 47622 flowsplimit 2176"
        ],
        "see_also": [
            {
                "name": "tc",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/tc/8/json"
            },
            {
                "name": "socket",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/socket/7/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 25,
                "subsections": []
            },
            {
                "name": "PARAMETERS",
                "lines": 44,
                "subsections": []
            },
            {
                "name": "EXAMPLES",
                "lines": 10,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "AUTHORS",
                "lines": 3,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "FQ - Fair Queue traffic policing\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "tc  qdisc  ...  fq  [  limit PACKETS ] [ flowlimit PACKETS ] [ quantum\nBYTES ] [ initialquantum BYTES ] [ maxrate RATE ] [ buckets NUMBER ] [\norphanmask NUMBER ] [ pacing | nopacing ] [ cethreshold TIME ]\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "FQ (Fair Queue) is a classless packet scheduler meant to be mostly used\nfor locally generated traffic.  It is designed to achieve per flow pac-\ning.   FQ  does flow separation, and is able to respect pacing require-\nments set by TCP stack.  All packets belonging to a socket are  consid-\nered as a 'flow'.  For non local packets (router workload), packet hash\nis used as fallback.\n\nAn application can specify a maximum pacing rate using the  SOMAXPAC-\nINGRATE  setsockopt  call.   This  packet scheduler adds delay between\npackets to respect rate limitation set on each socket. Note that  after\nlinux-4.20,  linux  adopted  EDT  (Earliest Departure Time) and TCP di-\nrectly sets the appropriate Departure Time for each skb.\n\nDequeueing happens in a round-robin fashion.  A special FIFO  queue  is\nreserved  for  high  priority packets ( TCPRIOCONTROL priority), such\npackets are always dequeued first.\n\nFQ is non-work-conserving.\n\nTCP pacing is good for flows having idle times, as the congestion  win-\ndow  permits  TCP  stack  to  queue a possibly large number of packets.\nThis removes the 'slow start after idle' choice,  badly  hitting  large\nBDP  flows  and  applications  delivering  chunks of data such as video\nstreams.\n",
                "subsections": []
            },
            "PARAMETERS": {
                "content": "limit\nHard limit on the real queue size. When  this  limit  is  reached,  new\npackets  are  dropped.  If the value is lowered, packets are dropped so\nthat the new limit is met. Default is 10000 packets.\n\nflowlimit\nHard limit on the maximum number of packets queued per  flow.   Default\nvalue is 100.\n\nquantum\nThe credit per dequeue RR round, i.e. the amount of bytes a flow is al-\nlowed to dequeue at once. A larger value means a longer time period be-\nfore the next flow will be served.  Default is 2 * interface MTU bytes.\n\ninitialquantum\nThe initial sending rate credit, i.e. the amount of bytes a new flow is\nallowed to dequeue initially.  This is specifically meant to allow  us-\ning  IW10  without  added  delay.   Default is 10 * interface MTU, i.e.\n15140 for 'standard' ethernet.\n\nmaxrate\nMaximum sending rate of a flow.   Default  is  unlimited.   Application\nspecific setting via SOMAXPACINGRATE is ignored only if it is larger\nthan this value.\n\nbuckets\nThe size of the hash table used for flow lookups. Each  bucket  is  as-\nsigned  a  red-black  tree  for  efficient collision sorting.  Default:\n1024.\n\norphanmask\nFor packets not owned by a socket,  fq  is  able  to  mask  a  part  of\nskb->hash  and  reduce  number  of buckets associated with the traffic.\nThis is a DDOS prevention mechanism, and the default is  1023  (meaning\nno more than 1024 flows are allocated for these packets)\n\n[no]pacing\nEnable or disable flow pacing. Default is enabled.\n\ncethreshold\nsets a threshold above which all packets are marked with ECN Congestion\nExperienced. This is useful for DCTCP-style  congestion  control  algo-\nrithms that require marking at very shallow queueing thresholds.\n",
                "subsections": []
            },
            "EXAMPLES": {
                "content": "#tc qdisc add dev eth0 root fq cethreshold 4ms\n#tc -s -d qdisc show dev eth0\nqdisc  fq  8001:  dev  eth0  root refcnt 2 limit 10000p flowlimit 100p\nbuckets 1024 orphanmask  1023  quantum  3028b  initialquantum  15140b\nlowratethreshold 550Kbit refilldelay 40.0ms cethreshold 4.0ms\nSent 72149092 bytes 48062 pkt (dropped 2176, overlimits 0 requeues 0)\nbacklog 1937920b 1280p requeues 0\nflows 34 (inactive 17 throttled 0)\ngc 0 highprio 0 throttled 0 cemark 47622 flowsplimit 2176\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "tc(8), socket(7)\n",
                "subsections": []
            },
            "AUTHORS": {
                "content": "FQ was written by Eric Dumazet.\n\niproute2                         10 Sept 2015                            FQ(8)",
                "subsections": []
            }
        }
    }
}