{
    "content": [
        {
            "type": "text",
            "text": "# FQ (man)\n\n## NAME\n\nFQ - Fair Queue traffic policing\n\n## SYNOPSIS\n\ntc  qdisc ... fq [ limit PACKETS ] [ flowlimit PACKETS ] [ quantum BYTES ] [ initialquantum\nBYTES ] [ maxrate RATE ] [ buckets NUMBER ] [ orphanmask NUMBER ] [ pacing |  nopacing  ]  [\ncethreshold TIME ]\n\n## DESCRIPTION\n\nFQ (Fair Queue) is a classless packet scheduler meant to be mostly used for locally generated\ntraffic.  It is designed to achieve per flow pacing.  FQ does flow separation, and is able to\nrespect  pacing requirements set by TCP stack.  All packets belonging to a socket are consid‐\nered as a 'flow'.  For non local packets (router workload), packet hash is used as fallback.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **PARAMETERS** (9 subsections)\n- **EXAMPLES**\n- **SEE ALSO**\n- **AUTHORS**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "FQ",
        "section": "",
        "mode": "man",
        "summary": "FQ - Fair Queue traffic policing",
        "synopsis": "tc  qdisc ... fq [ limit PACKETS ] [ flowlimit PACKETS ] [ quantum BYTES ] [ initialquantum\nBYTES ] [ maxrate RATE ] [ buckets NUMBER ] [ orphanmask NUMBER ] [ pacing |  nopacing  ]  [\ncethreshold 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": 5,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 21,
                "subsections": []
            },
            {
                "name": "PARAMETERS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "limit",
                        "lines": 4
                    },
                    {
                        "name": "flow_limit",
                        "lines": 2
                    },
                    {
                        "name": "quantum",
                        "lines": 4
                    },
                    {
                        "name": "initial_quantum",
                        "lines": 4
                    },
                    {
                        "name": "maxrate",
                        "lines": 3
                    },
                    {
                        "name": "buckets",
                        "lines": 3
                    },
                    {
                        "name": "orphan_mask",
                        "lines": 4
                    },
                    {
                        "name": "[no]pacing",
                        "lines": 2
                    },
                    {
                        "name": "ce_threshold",
                        "lines": 5
                    }
                ]
            },
            {
                "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 BYTES ] [ initialquantum\nBYTES ] [ maxrate RATE ] [ buckets NUMBER ] [ orphanmask NUMBER ] [ pacing |  nopacing  ]  [\ncethreshold TIME ]\n\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "FQ (Fair Queue) is a classless packet scheduler meant to be mostly used for locally generated\ntraffic.  It is designed to achieve per flow pacing.  FQ does flow separation, and is able to\nrespect  pacing requirements set by TCP stack.  All packets belonging to a socket are consid‐\nered as a 'flow'.  For non local packets (router workload), packet hash is used as fallback.\n\nAn application can specify a maximum pacing  rate  using  the  SOMAXPACINGRATE  setsockopt\ncall.   This  packet  scheduler  adds delay between packets to respect rate limitation set on\neach socket. Note that after linux-4.20, linux adopted EDT (Earliest Departure Time) and  TCP\ndirectly sets the appropriate Departure Time for each skb.\n\nDequeueing  happens in a round-robin fashion.  A special FIFO queue is reserved for high pri‐\nority packets ( TCPRIOCONTROL priority), such packets are always dequeued first.\n\nFQ is non-work-conserving.\n\nTCP pacing is good for flows having idle times, as the congestion window permits TCP stack to\nqueue a possibly large number of packets.  This removes the 'slow start after  idle'  choice,\nbadly  hitting  large  BDP  flows  and  applications  delivering chunks of data such as video\nstreams.\n\n",
                "subsections": []
            },
            "PARAMETERS": {
                "content": "",
                "subsections": [
                    {
                        "name": "limit",
                        "content": "Hard limit on the real queue size. When this limit is reached, new packets  are  dropped.  If\nthe  value  is  lowered,  packets  are dropped so that the new limit is met. Default is 10000\npackets.\n"
                    },
                    {
                        "name": "flow_limit",
                        "content": "Hard limit on the maximum number of packets queued per flow.  Default value is 100.\n"
                    },
                    {
                        "name": "quantum",
                        "content": "The credit per dequeue RR round, i.e. the amount of bytes a flow is  allowed  to  dequeue  at\nonce. A larger value means a longer time period before the next flow will be served.  Default\nis 2 * interface MTU bytes.\n"
                    },
                    {
                        "name": "initial_quantum",
                        "content": "The  initial  sending  rate credit, i.e. the amount of bytes a new flow is allowed to dequeue\ninitially.  This is specifically meant to allow using IW10 without added delay.   Default  is\n10 * interface MTU, i.e. 15140 for 'standard' ethernet.\n"
                    },
                    {
                        "name": "maxrate",
                        "content": "Maximum  sending  rate  of  a  flow.  Default is unlimited.  Application specific setting via\nSOMAXPACINGRATE is ignored only if it is larger than this value.\n"
                    },
                    {
                        "name": "buckets",
                        "content": "The size of the hash table used for flow lookups. Each bucket is assigned  a  red-black  tree\nfor efficient collision sorting.  Default: 1024.\n"
                    },
                    {
                        "name": "orphan_mask",
                        "content": "For  packets  not owned by a socket, fq is able to mask a part of skb->hash and reduce number\nof buckets associated with the traffic. This is a DDOS prevention mechanism, and the  default\nis 1023 (meaning no more than 1024 flows are allocated for these packets)\n"
                    },
                    {
                        "name": "[no]pacing",
                        "content": "Enable or disable flow pacing. Default is enabled.\n"
                    },
                    {
                        "name": "ce_threshold",
                        "content": "sets  a threshold above which all packets are marked with ECN Congestion Experienced. This is\nuseful for DCTCP-style congestion control algorithms that require  marking  at  very  shallow\nqueueing thresholds.\n\n"
                    }
                ]
            },
            "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 buckets 1024 orphanmask\n1023 quantum 3028b initialquantum  15140b  lowratethreshold  550Kbit  refilldelay  40.0ms\ncethreshold 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": []
            }
        }
    }
}