# Setting Resource Limits - login.conf



## APseudoUtopia (Dec 3, 2011)

I'm setting up a general-purpose server on FreeBSD 9.0. It's going to be used for web, database, gateway, irc, and various other things I'd like to play with.

I'm trying to set up the user resource limits in /etc/login.conf. Obviously for specific classes like for the database, web server, or admins, I can create new classes to increase limits. But I'm trying to set up the default class for users. I am going to have several user accounts on the system.

I'm a bit lost when it comes to what to set the limits to. I read the login.conf man page, and also the FreeBSD handbook page on resource limits. They explain each option, but they don't give "hey, this value would be appropriate for a typical system."

My guesses for the limits are as follows:


```
coredumpsize=256m
cputime=60s
memoryuse=1g
openfiles=50
maxproc=25
filesize=1g
sbsize=10m (I have absolutely no idea on this one...how much memory does a typical tcp connection use?)
stacksize=200m (again, no idea..)
```
Any suggestions? Tips?

I appreciate it!


----------



## wblock@ (Dec 3, 2011)

"Typical" varies widely.  One approach:


```
limits = bestguess;
while ( users_are_complaining_more_than_usual ) {
     limits++;
}
```

That shouldn't take long to converge to something realistic for what the users are actually doing.


----------

