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

    sg-1100 DHCP lease status page load time

    Scheduled Pinned Locked Moved Official Netgate® Hardware
    19 Posts 4 Posters 3.3k 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.
    • G
      gabric098 @Gertjan
      last edited by

      Hi @gertjan ,
      thanks for your reply.
      Please note that 80% of the time the network has a lot less clients than 100. I was trying to consider the most extreme situation that rarely happens. It's a home network with 2 families connected and a bunch of IOT devices.
      I do also suspect something goes wrong when dhcpd tries to "rotate" the dhcpd.leases file.
      I can definitely try to delete the file and restart the service but I'd like to understand what's going wrong to address the root cause of the problem.
      What log file shall I look at for dhcpd logs?

      Thanks,
      Gab

      GertjanG 1 Reply Last reply Reply Quote 0
      • GertjanG
        Gertjan @gabric098
        last edited by Gertjan

        @gabric098 said in sg-1100 DHCP lease status page load time:

        What log file shall I look at for dhcpd logs?

        Dono if the dhcpd has option to tell you what it's doing.
        I advise you to :
        Ditch de leases file.
        Get rid of the "ridiculous" /16

        A typical lease record, like :

        lease 192.168.2.80 {
          starts 6 2021/01/16 08:06:31;
          ends 6 2021/01/16 14:06:31;
          tstp 6 2021/01/16 14:06:31;
          cltt 6 2021/01/16 08:06:31;
          binding state free;
          hardware ethernet ec:c4:0d:xx:e4:89;
        }
        

        is 200 bytes in size.

        When they all get used, over you 3 networks of /16 or 65535 max entries per networks make 3 x 65535 * 200 = 39 Mbytes (worst case). You are half way, and the 1100 is already struggling.
        Make your networks more classic, like /24, and the problem will auto solve.
        Btw : dono if the actual pool size might influence all this.

        No "help me" PM's please. Use the forum, the community will thank you.
        Edit : and where are the logs ??

        G 1 Reply Last reply Reply Quote 1
        • G
          gabric098 @Gertjan
          last edited by

          I've cleaned up the /var/dhcpd/var/db directory and manually rotated the leases file. Essentially I've renamed the dhcpd.leasesto dhcpd.leases~ and created an empty dhcpd.leases file.
          Now the GUI loads in no time. I'll keep monitoring the directory as I believe something fails during what is described in the man page:

          In order to prevent the lease database from growing without bound, the file is rewritten from time to time. First, a temporary lease database is created and all known leases are dumped to it. Then, the old lease database is renamed /var/lib/dhcpd/dhcpd.leases~. Finally, the newly written lease database is moved into place.
          

          Thanks,
          Gab

          1 Reply Last reply Reply Quote 0
          • stephenw10S
            stephenw10 Netgate Administrator
            last edited by

            Ah, yes what was the scope size? If it was close to the full /16 and you have a lot of new devices I could imagine that file becoming huge.

            Steve

            G 1 Reply Last reply Reply Quote 0
            • G
              gabric098 @stephenw10
              last edited by

              @stephenw10
              I'm not sure what you mean with scope size but I believe to understand that the problem here is not the number of active leases but rather the fact that in that files there were loads of very old leases like the one I posted which was from may 2020 (expired in the same day).

              G 1 Reply Last reply Reply Quote 0
              • G
                gabric098 @gabric098
                last edited by

                Ok, this is weird.
                As I mentioned before I had created an empty dhcp.leases file this morning creating a "backup" version dhcp.leases~.
                After few hours I find again the 21MB dhcp.leases files with the first entry:

                lease 10.40.44.246 {
                  starts 2 2020/04/14 20:42:23;
                  ends 2 2020/04/14 20:52:50;
                  tstp 2 2020/04/14 20:52:50;
                  cltt 2 2020/04/14 20:42:23;
                  binding state free;
                  hardware ethernet 2c:56:dc:b7:b7:57;
                  uid "\001,V\334\267\267W";
                }
                

                ... april 2020 ?

                GertjanG 1 Reply Last reply Reply Quote 0
                • GertjanG
                  Gertjan @gabric098
                  last edited by

                  I've a theory : a zero byte dhcpd.leases file isn't .. valid.
                  So it took the backup - it recognized it as valid, and rebuild a good, huge dhcpd.leases.

                  Rename your backup to anything except dhcp.leases~ ( name it back.old.do-not-touch)
                  Jtst delete dhcpd.leases, as dhcpd will create it anyway.

                  No "help me" PM's please. Use the forum, the community will thank you.
                  Edit : and where are the logs ??

                  1 Reply Last reply Reply Quote 0
                  • stephenw10S
                    stephenw10 Netgate Administrator
                    last edited by

                    By scope size I mean what is the range?

                    You have /16 subnets there but I assumed you didn't a DHCP range with 65534 possible leases.
                    If you have a large number of new devices they will just keep claiming new leases without overwriting to old ones > massive file!

                    Steve

                    1 Reply Last reply Reply Quote 0
                    • P
                      pete35 @gabric098
                      last edited by

                      @gabric098

                      is it possible for you to change the scopes to
                      10.20.0.0/21 / 10.30.0.0/21 / 10.40.0.0/21 ?
                      This will give more than 2000 addresses per scope, should be enough for your system und the leases db will not grow that much anymore.

                      <a href="https://carsonlam.ca">bintang88</a>
                      <a href="https://carsonlam.ca">slot88</a>

                      G 1 Reply Last reply Reply Quote 0
                      • G
                        gabric098 @pete35
                        last edited by

                        I see what you mean @stephenw10 and @pete35 .
                        I've just reduced the DHCP range from 10.x.5.1 to 10.x.15.255 for all the VLANs. That will give me plenty of addresses without bloating the file.
                        The dhcpd.leases file immediately reduced its size to a more manageable 900KB, I'll keep monitoring it in the next days to see if it stays the same or keeps growing.
                        I'll update the thread.

                        Thank you all for your precious support.
                        Gab

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