# kern.maxfilesperproc not affected



## henosx (Apr 15, 2010)

fbsd7.3-Stable, P4 3.0, Ram 2Gb


```
cat /boot/loader.conf

kern.maxfiles=32768
[color="Red"]kern.maxfilesperproc=16384[/color]
kern.ipc.nmbclusters=32768
kern.ipc.maxsockets=32768
[color="Red"]kern.ipc.somaxconn=1024[/color]
kern.maxdsiz="1073741824"
kern.dfldsiz="268435456"
kern.maxssiz="134217728"
```


```
sysctl -a | egrep 'maxfiles|maxfilesperproc|nmbclusters|maxsockets|somaxconn'
kern.maxfiles: 32768
[color="Red"]kern.maxfilesperproc: 29491[/color]
[color="Red"]kern.ipc.somaxconn: 128[/color]
kern.ipc.nmbclusters: 32768
kern.ipc.maxsockets: 32768
```

see the red, it's not affected..
why this happen & how to fix it ?

thanks in advance

note : i have try to include this on /etc/sysctl.conf (same problems)


----------



## DutchDaemon (Apr 15, 2010)

Could you try putting the values in double quotes in loader.conf? 

loader.conf(5)


```
All settings have the following format:

           variable="value"
```

Worth a shot.


----------



## henosx (Apr 16, 2010)

done! try to give all the values in double quote


```
cat /boot/loader.conf
kern.maxfiles="32768"
kern.maxfilesperproc="16384"
kern.ipc.nmbclusters="32768"
kern.ipc.maxsockets="32768"
kern.ipc.somaxconn="1024"
kern.maxdsiz="1073741824"
kern.dfldsiz="268435456"
kern.maxssiz="134217728"
```


```
sysctl -a | egrep 'maxfiles|maxfilesperproc|nmbclusters|maxsockets|somaxconn'
kern.maxfiles: 32768
kern.maxfilesperproc: 29491
kern.ipc.somaxconn: 128
kern.ipc.nmbclusters: 32768
kern.ipc.maxsockets: 32768
```

but still not affected..


----------



## fronclynne (Apr 16, 2010)

shouldn't these be in /etc/sysctl.conf?
Without slogging through the sources (something which I read poorly, if at all) might perhaps kern.maxfiles override kern.maxfilesperproc?
I'm not finding anything right quickly, but can some of these be tuned in your kernel conf?

You might try asking on freebsd-hackers@, I mean, I do know that some of the devs read the forums, but I'd think that the odds would be better with the mailing lists.


----------



## phoenix (Apr 16, 2010)

Kernel tunables have to be set via /boot/loader.conf, as these can only be set before the kernel loads.

However, kernel tunables are listed as part of the sysctl tree.  If you try to set these via /etc/sysctl.conf, you will get "read-only" errors.


----------

