You are not logged in.

#1 2015-04-04 11:58:55

RubenKelevra
Member
Registered: 2013-03-01
Posts: 41

dhcpd4-Daemon uses extremly much ram

Hey there,

I'm using a dhcpd4-daemon on a server which also do radvd, named and run routing. The dhcpd4-daemon uses 60-80% of memory (the system has 512 MB), even right after the start with an empty lease file.

The daemon is configured for 26 subnets with /16 of size each, but there are only about 300-600 clients  (within the lease time of 600 seconds), but the environment is very dynamic.

Is there a reason for this exorbitant memory hungry? Are there comparable alternatives?

ddns-update-style none;
ignore client-updates;
deny declines;
one-lease-per-client true;
ignore bootp;
default-lease-time 600;
max-lease-time 800;
min-lease-time 60;
ignore-client-uids true;
authoritative;
log-facility local7;

subnet 10.66.0.0 netmask 255.255.0.0 {
    range 10.66.11.1 10.66.20.255; #main
    pool {
        range 10.66.1.1 10.66.10.255;
        deny all clients;
    }
    pool {
        range 10.66.30.1 10.66.254.255;
        deny all clients;
    }
    option broadcast-address 10.66.255.255;
    option routers 10.66.11.0;
    option domain-name-servers 10.66.11.0;
    option ntp-servers 10.66.11.0;

    interface subnet-x;
}

[...]

There are 26 identically nets, on other interfaces with other ip-ranges.

Best regards,

Ruben

Offline

#2 2015-04-04 16:31:28

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,353

Re: dhcpd4-Daemon uses extremly much ram

I just did a sanity check.  Based on what you stated, it would indicate that it is using about 400 bytes/client.   That does not seem overly out of line.   Storage of Lease times, MAC addresses, host names, IP addresses, and other information add up pretty fast with half a K of clients.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#3 2015-04-06 15:54:22

RubenKelevra
Member
Registered: 2013-03-01
Posts: 41

Re: dhcpd4-Daemon uses extremly much ram

Well, if I start the daemon with an empty-leasefile it uses the same amount of storage, here for example with a small leasefile:

[root@bragi ~]# pmap -x 3174
3174:   /usr/bin/dhcpd -4 -q -pf /run/dhcpd4.pid
Adresse            kByte     RSS   Dirty Modus Zuordnung
0000000000400000    2000     624       0 r-x-- dhcpd
00000000007f3000       4       4       0 r---- dhcpd
00000000007f4000      32      20      16 rw--- dhcpd
00000000007fc000     240      24      20 rw---   [ anon ]
0000000001709000   50980    2100     392 rw---   [ anon ]
00007f758d881000  472112  259264   15928 rw---   [ anon ]
00007f75aa58d000      44       0       0 r-x-- libnss_files-2.21.so
00007f75aa598000    2048       0       0 ----- libnss_files-2.21.so
00007f75aa798000       4       0       0 r---- libnss_files-2.21.so
00007f75aa799000       4       0       0 rw--- libnss_files-2.21.so
00007f75aa79a000    1636    1240       0 r-x-- libc-2.21.so
00007f75aa933000    2048       0       0 ----- libc-2.21.so
00007f75aab33000      16      12       0 r---- libc-2.21.so
00007f75aab37000       8       8       8 rw--- libc-2.21.so
00007f75aab39000      16      12      12 rw---   [ anon ]
00007f75aab3d000     136     124       0 r-x-- ld-2.21.so
00007f75aab67000    1964     252      64 rw---   [ anon ]
00007f75aad5d000       4       4       4 rw---   [ anon ]
00007f75aad5e000       4       4       0 r---- ld-2.21.so
00007f75aad5f000       4       4       4 rw--- ld-2.21.so
00007f75aad60000       4       4       0 rw---   [ anon ]
00007ffee1b13000     132      24      20 rw---   [ stack ]
00007ffee1bd4000       8       0       0 r----   [ anon ]
00007ffee1bd6000       8       4       0 r-x--   [ anon ]
ffffffffff600000       4       0       0 r-x--   [ anon ]
---------------- ------- ------- -------
kB gesamt         533460  263728   16468
[root@bragi ~]# du -h /var/lib/dhcp/dhcpd.leases
776K    /var/lib/dhcp/dhcpd.leases

But to respond to your thought, if we think of one client is using 5 KByte of data, instead of 400 Bytes, the Server would need to save infos about 600 Clients around 3 MByte, so the question is, why do it need 470 MByte?

Last edited by RubenKelevra (2015-04-06 15:58:01)

Offline

Board footer

Powered by FluxBB