[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Default size limits for /run (/var/run) and /run/lock (/var/lock)



On Mon, Apr 11, 2011 at 08:01:42PM +0100, Roger Leigh wrote:
> With the transition to /run and /run/lock as tmpfs filesystems, it
> would be desirable to provide sensible default size limits.  Currently,
> we default to the tmpfs default of ½ RAM.  But with several tmpfs
> filesystems, this does have the potential for the system to be OOMed
> by a user filling up more than one of the filesystems.  A sensible
> default size limit would be useful here, for at least some of the
> filesystems.

What about 5% of RAM + 20% of swap?  Perhaps even just 5% of (RAM + swap).
Unused space doesn't cost you anything, and when there's swap available,
tmpfs is strictly better than any "real" filesystem could possibly be.

Unlike a fixed limit, a ratio would both prevent a runaway daemon from
OOMing the system and ensure non-embedded systems have plenty of space.

Ie, that 50MB of samba files would fit comfortably on any system that's not
starved for memory.  Samba typically means a file server -- ie, often very
little physical RAM but plenty of disk space.

A static number would be either too big on a smartphone or too small on
regular machines.

-- 
1KB		// Microsoft corollary to Hanlon's razor:
		//	Never attribute to stupidity what can be
		//	adequately explained by malice.


Reply to: