On 2012-04-20, Kostas Zorbadelos <kzo...@otenet.gr> wrote: > Stuart Henderson <s...@spacehopper.org> writes: > >> On 2012/04/20 22:44, Kostas Zorbadelos wrote: >>> Stuart Henderson <s...@spacehopper.org> writes: >>> >>> > On 2012-04-20, Kostas Zorbadelos <kzo...@otenet.gr> wrote: >>> >>> Also, per process limits play a role. >>> >>> >>> >> >>> >> Does named has such a limit by default? >>> > >>> > OpenBSD has a limit by default, see login.conf(5). Daemons started >>> > when the system is booted or using /etc/rc.d scripts typically use >>> > the class 'daemon'. >>> > >>> >>> I gathered that. However in login.conf: >>> >>> daemon:\ >>> :ignorenologin:\ >>> :datasize=infinity:\ >>> ^^^^^^^^^^^^^^^^^^^^ >>> :maxproc=infinity:\ >>> :openfiles-cur=128:\ >>> :stacksize-cur=8M:\ >>> :localcipher=blowfish,8:\ >>> :tc=default: >>> >>> Also ps(1) output seems to confirm that named process limit is the >>> entire memory of the machine. >>> >>> root@openbsd: /var/named/tmp # ps -ax -v | head >>> PID STAT TIME SL RE PAGEIN VSZ RSS LIM TSIZ %CPU %MEM >>> COMMAND >>> 31077 S 277:43.57 0 127 15 608272 610340 8145988 1292 10.6 7.3 >>> /usr/sbin/named >> >> lim is "memory" not "datasize". >> >> Considering the amount of memory this process is actually using, it >> looks to me more like it's being run with a 512MB datasize limit, >> so perhaps it's not running under the expected 'daemon' class. >> > > Thanks Stuart, this seems reasonable. How can I find under what class > the named process is? Study the sources?
I'm not sure if you can directly identify this after the fact, but this is determined by how it was started. If started by a user logged-in directly as root, it should be using the root user's class, by default 'daemon'. As per rc.d(8) if started by the normal system startup scripts, either at boot or manually afterwards, the class will be 'daemon' *unless* a class with the name of the daemon (in this case "named") exists in login.conf, in which case that will be used instead. If restarted at runtime *without* using the rc.d scripts, e.g. 'sudo pkill named; sudo named' then it would use the limits that applied to the user you were logged in as *at the time you logged in*. Note that if you change login.conf while you're logged in you will need a totally new login before the new limits apply. (In the case of ssh multiplexing, the old master process will need to go away too, not just your shell). Also note that people using login.conf.db will need to update it (I would not normally recommend login.conf.db though). >> BTW, under OpenBSD/amd64 the most the datasize for a single process >> can be without modifying the kernel is 8GB. > > Interesting. For other arch, grep MAXDSIZ /sys/arch/*/include/vmparam.h