About this list Date view Thread view Subject view Author view Attachment view

From: Herbert Poetzl (herbert_at_13thfloor.at)
Date: Wed 24 Aug 2005 - 02:35:31 BST


On Wed, Aug 24, 2005 at 01:55:17AM +0200, Helmut Wollmersdorfer wrote:
> Hard to understand these poorly documented feature.
>
> The flowerpage says:
>
> Possible resources are
> - cpu,
> - fsize,
> - data,
> - stack,
> - core,
> - rss,
> - nproc,
> - nofile,
> - memlock,
> - as
> - locks.
>
> man bash[ulimit] says:
> -a All current limits are reported
> -c The maximum size of core files created
> -d The maximum size of a process's data segment
> -f The maximum size of files created by the shell
> -l The maximum size that may be locked into memory
> -m The maximum resident set size
> -n The maximum number of open file descriptors (most systems
> do not allow this value to be set)
> -p The pipe size in 512-byte blocks (this may not be set)
> -s The maximum stack size
> -t The maximum amount of cpu time in seconds
> -u The maximum number of processes available to a single
> user
> -v The maximum amount of virtual memory available to the
> shell
> [...]
> Values are in 1024-byte increments, except for -t,
> which is in seconds, -p, which is in units of 512-byte blocks,
> and -n and -u, which are unscaled values.
>
> # cat /proc/virtual/27/limit
> PROC: 6 9 -1 0
> VM: 3703 6455 -1 0
> VML: 0 0 -1 0
> RSS: 1304 2320 -1 0
> ANON: 165 308 -1 0
> FILES: 87 97 -1 0
> OFD: 37 41 -1 0
> LOCKS: 2 2 -1 0
> SOCK: 3 3 -1 0
> MSGQ: 0 0 -1 0
> SHM: 0 0 -1 0
>
> O.k., let's try the puzzle:
>
> config proc ulimit description
> ------ ---- ------- -----------
> cpu -t
> fsize ? -f ?
> data ? -d ?
> stack ? -s
> core ? -c ?
> rss RSS -m
> nproc PROC -u
> nofile FILES -n ?
> memlock VML -l
> as VM ? ?
> locks LOCKS ? ?
> ? ? -p
> ? ANON ? ?
> ? OFD ? ?
> ? SOCK ? ?
> ? MSGQ ? ?
> ? SHM ? ?
>
> Hmm ... if somebody exchanges the question marks by understandable
> content, I promise to write docs.

http://linux-vserver.org/Resource+Limits
(I just added that one :)

> The difference between /usr/sbin/vlimit and /proc/.../limit needs
> explanation.

I did choose shorter names than the actual defines
which all go like this RLIMIT_MEMLOCK ...
but I do not see a problem with synchronizing those
except for cases where <name>: is longer than 7 chars
(i.e. MSGQUEUE, SIGPENDING and MEMLOCK will require
different abbreviations, because of tabbing issues)

> Next I would like to know the meaning of the 3rd and 5th column of
> /proc/.../limit.

columns are:

 1 name
 2 current value
 3 observed maximum
 4 hard limit (maximum)
 5 number of hits (max)

so col 5 shows how often the maximum was reached and
the kernel had to deny a resource request ...

> At least I would like to know, how I can restrict a vserver to
> e.g. 100 MB real memory. Or is this not possible under Linux?

_real_ memory is RSS (resident set size) means pages
actually _in_ memory (not on disk, not swapped out, not
unused)

> As I understand, I can restrict VM (total virtual memory?), VML
> and RSS - hmm.

VM is the virtual addess space. per context, this means
the sum of all virtual address spaces (of all processes
in the context) which is a fictional number, but the
best we can do for now ...

VML is the number of pages which can be locked into
memory (given the required CAP is provided) so that they
will not be swapped out ...

HTH,
Herbert

> TIA
>
> Helmut Wollmersdorfer
>
> _______________________________________________
> Vserver mailing list
> Vserver_at_list.linux-vserver.org
> http://list.linux-vserver.org/mailman/listinfo/vserver
_______________________________________________
Vserver mailing list
Vserver_at_list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver


About this list Date view Thread view Subject view Author view Attachment view
[Next/Previous Months] [Main vserver Project Homepage] [Howto Subscribe/Unsubscribe] [Paul Sladen's vserver stuff]
Generated on Wed 24 Aug 2005 - 02:35:55 BST by hypermail 2.1.3