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

    Poor response time with thousands of vlan interfaces

    Scheduled Pinned Locked Moved General pfSense Questions
    33 Posts 8 Posters 8.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.
    • Y Offline
      ycflash
      last edited by

      Hi jimp,

      I add "$bt = time(); " in the beginning and "$at = time();" in the ending of the PHP script file, the $bt is about 1s larger than $at. I think the script executed as quickly as possible. But, the script output didn't flush to client immediately, after about 30s (according to the tcpdump output) it start to transfer.

      As far as I know, the PHP script ends the output is flushed to the client without any delay, but in this situation it turns out not.

      I also comment out some code to prevent vlan interface to be added to $portlist, but the result is the same. It seams the delay has nothing to do with interface foreach loop.

      Thanks & Merry Christmas!

      1 Reply Last reply Reply Quote 0
      • jimpJ Offline
        jimp Rebel Alliance Developer Netgate
        last edited by

        Try sprinkling some calls to flush(); and ob_flush(); in the loops, see if it helps.

        Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

        Need help fast? Netgate Global Support!

        Do not Chat/PM for help!

        1 Reply Last reply Reply Quote 0
        • Y Offline
          ycflash
          last edited by

          Sorry, the script time I record previously is not acculately - I missed to recored files required in.
          After adding time record code snips recursively in every file required in, I found globals.inc called get_nics_with_capabilities() to get vlan capable interface, which caused the delay!

          code from globals.inc:

          
               43 function get_nics_with_capabilities($CAPABILITIES) {
               44         $ifs = `/sbin/ifconfig -l`;
               45         $if_list = split(" ", $ifs);
               46         $vlan_native_supp = array();
               47         foreach($if_list as $if => $iface) {
               48                 $iface = trim($iface);
               49                 $capable = pfSense_get_interface_addresses($iface);
               50                 if(isset($capable['caps'][$CAPABILITIES])) {
               51                         $interfacenonum = remove_numbers($iface);
               52                         if(!in_array($interfacenonum, $vlan_native_supp))
               53                                 $vlan_native_supp[] = $interfacenonum;
               54                 }
               55         }
               56         return $vlan_native_supp;
               57 }
          ...... some line omitted ....
           114 $vlan_native_supp = get_nics_with_capabilities("vlanmtu");
          
          

          After comment out line 114 in globals.inc, the script page shows immediately. But the side effect I found currently is that interfaces_bridges_edit.php can't see vlan interfaces any more.

          1 Reply Last reply Reply Quote 0
          • E Offline
            eri--
            last edited by

            From what i recall that function is a leftover.
            You can safely disable the call to it to speedup your test.

            Iirc it was non-existant when we tested the 4000 vlans cmb refers too.

            1 Reply Last reply Reply Quote 0
            • E Offline
              eri--
              last edited by

              Actually try this out https://github.com/bsdperimeter/pfsense/commit/121dc11eac00c2244547bf942f3e4416c8b6cf3b

              That should fix you issues with other places.

              1 Reply Last reply Reply Quote 0
              • Y Offline
                ycflash
                last edited by

                Surely it performed much better after applyling commit: 121dc11.
                But all vlan interfaces are missing in interfaces_assign.php & interfaces_bridges_edit.php list box, resulting we cannot use or configure any vlan interface we created at all. For example: we can't assign vlan interface to LAN nor bridge several vlans together.

                1 Reply Last reply Reply Quote 0
                • E Offline
                  eri--
                  last edited by

                  I am not following you.
                  Since there is nothing related with that commit and those pages!

                  Can you show me real examples or even screenshots of this?

                  1 Reply Last reply Reply Quote 0
                  • Y Offline
                    ycflash
                    last edited by

                    The version of pfsense I'm testing is the official 2.0.1-RELEASE amd64.
                    I have applied commit 121dc11.

                    As you can see in vlan.png, I have configured many vlans ( actually from vlan 999 to 3999).
                    But in assign.png, these vlan interfaces does not show in assign list.
                    Aslo in bridge.png, these vlan interfaces doest not show in select list.

                    vlan.png
                    vlan.png_thumb
                    assign.png
                    assign.png_thumb
                    bridge.png
                    bridge.png_thumb

                    1 Reply Last reply Reply Quote 0
                    • E Offline
                      eri--
                      last edited by

                      ifconfig command output does show anything?
                      Can you show me the config.xml?

                      It should be there is you have configured since displaying of vlans is taken from the config file.

                      BTW, bridge will not show any interface that is not assigned.
                      This is the limitation in 2.0.x of that interface.

                      1 Reply Last reply Reply Quote 0
                      • jimpJ Offline
                        jimp Rebel Alliance Developer Netgate
                        last edited by

                        Actually with that commit when I go to create a vlan, the parent interface drop-down is empty.

                        Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

                        Need help fast? Netgate Global Support!

                        Do not Chat/PM for help!

                        1 Reply Last reply Reply Quote 0
                        • Y Offline
                          ycflash
                          last edited by

                          ifconfig -l have the configured interfaces.

                          
                          em0 em1 em2 plip0 pflog0 pfsync0 enc0 lo0 em1_vlan999 em1_vlan1000 em1_vlan1001 em1_vlan1002 em1_vlan1003 em1_vlan1004 em1_vlan1005 em1_vlan1006 em1_vlan1007 em1_vlan1008 em1_vlan1009 em1_vlan1010 em1_vlan1011 em1_vlan1012 em1_vlan1013 em1_vlan1014 ......(omited....)
                          
                          

                          config.xml is attatched, please strip .txt suffix before unzip it, since it's over 250KB.

                          I meet the same situation jimp meets, no parent interface in drop-down list. But the vlan interfaces are created before apply that commit.

                          config.xml.zip.txt

                          1 Reply Last reply Reply Quote 0
                          • E Offline
                            eri--
                            last edited by

                            Heh jimp good catch :)

                            This is the correction https://github.com/bsdperimeter/pfsense/commit/aad163a9338995609363cdac0e97c606eeb58e9c

                            1 Reply Last reply Reply Quote 0
                            • jimpJ Offline
                              jimp Rebel Alliance Developer Netgate
                              last edited by

                              Works for me after that commit. :-)

                              Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

                              Need help fast? Netgate Global Support!

                              Do not Chat/PM for help!

                              1 Reply Last reply Reply Quote 0
                              • Y Offline
                                ycflash
                                last edited by

                                @jimp:

                                Works for me after that commit. :-)

                                Me too.
                                Still cannot see vlan interfaces in assigning or bridging page.

                                1 Reply Last reply Reply Quote 0
                                • jimpJ Offline
                                  jimp Rebel Alliance Developer Netgate
                                  last edited by

                                  They show up for me in the assignment drop-down list. And if I assign and enable one, then it shows up to bridge (the list in bridge only shows assigned and enabled interfaces)

                                  Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

                                  Need help fast? Netgate Global Support!

                                  Do not Chat/PM for help!

                                  1 Reply Last reply Reply Quote 0
                                  • Y Offline
                                    ycflash
                                    last edited by

                                    I double checked, assigning interface page drop-down list do have vlan interfaces now.
                                    But my question is: since interfaces_bridge_edit.php get only configured interface as bridge member capable ones,

                                    
                                    48 $ifacelist = get_configured_interface_with_descr(); 
                                    
                                    

                                    Is there any need to assign them before we can add to bridge?

                                    1 Reply Last reply Reply Quote 0
                                    • E Offline
                                      eri--
                                      last edited by

                                      In 2.0 that is enforced to make sure the interface part of the bridge is always properly configured.

                                      Generally, its not a requirement, but there needs to be some bookkeeping for bridge members and that is why it was not done for 2.0.

                                      1 Reply Last reply Reply Quote 0
                                      • Y Offline
                                        ycflash
                                        last edited by

                                        I understand that and thanks for your help!

                                        1 Reply Last reply Reply Quote 0
                                        • S Offline
                                          Supermule Banned
                                          last edited by

                                          Could this be purged to the official release pls :)

                                          1 Reply Last reply Reply Quote 0
                                          • jimpJ Offline
                                            jimp Rebel Alliance Developer Netgate
                                            last edited by

                                            Ermal already committed that to RELENG_2_0, but it's not like we'd make a 2.0.2 just for that… so it will be an official release eventually, just not yet. If you want it in the meantime, feel free to sync your code to the current RELENG_2_0 code using gitsync.

                                            Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

                                            Need help fast? Netgate Global Support!

                                            Do not Chat/PM for help!

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