Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Root queue in "Status: Traffic shaper: Queues" is showing double values

    Scheduled Pinned Locked Moved Traffic Shaping
    2 Posts 1 Posters 1.6k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • C
      ConfusedUser
      last edited by

      Hi All,
      I have two systems where I'm currently testing the traffic shaper with CBQ.
      It works well but the status view is always shoing a number for Bandwidth and PPS which is the exact double from what it should be. The sums for the other lines are correct. Only bandwith and PPS are a double of the real sum.
      Any idea how to fix that?

      Attached are the screenshots from the two different test systems.

      Thanks,
      Mike
      Clipboard01.jpg
      Clipboard02.jpg_thumb
      Clipboard02.jpg
      Clipboard01.jpg_thumb

      1 Reply Last reply Reply Quote 0
      • C
        ConfusedUser
        last edited by

        In the meantime I found a workaround which makes the PPS and the Bandwidth column showing the correct values.

        status_queues.php is reading from a file called /tmp/qstats
        This /tmp/qstats file is already having the sum of each child queues for the root queue for bandwidth and PPS. But the PHP code still adds the amount of all child queues to it which is causing the doubles.

        I did a change in status_queues.php to fix it. I commented two lines (highlighted in red):

        function statsQueues($xml){
        global $statistics;

        $current = new QueueStats();
        $child = new QueueStats();
        $current->queuename = $xml['name'] . $xml['interface'];
        $current->queuelength = $xml['qlength'];
        $current->pps = $xml['measured'];
        $current->bandwidth = $xml['measuredspeedint'];
        $current->borrows = intval($xml['borrows']);
        $current->suspends = intval($xml['suspends']);
        $current->drops = intval($xml['droppedpkts']);
        if (is_array($xml['queue'])) {
        foreach($xml['queue'] as $q) {
        $child = statsQueues($q);
        /* $current->pps += $child->pps;
        $current->bandwidth += $child->bandwidth; */
        $current->borrows += $child->borrows;
        $current->suspends += $child->suspends;
        $current->drops += $child->drops;
        }
        }
        unset($child);
        $statistics[] = $current;
        return $current;
        }

        1 Reply Last reply Reply Quote 0
        • First post
          Last post
        Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.