ulimit is too crude a control for any interesting system of guaranteed resources.
Even per process, it is a very crude control. Once you consider multiple processes per user, it is a hopelessly crude control. If you set max processes per user and max resources per process so low that the product of the two was a reasonable level of resource per user, you would be setting it so low that it would prohibit ordinary activities (because ordinary activities tend to have several tiny processes with few large ones).
Quote:
Originally Posted by reshmirrp
If a linux server is shared my many users, can a process have unlimited virtual memory, without affecting other users?
|
It is pretty much impossible to allow any resource use by one process without "affecting" others.
Quote:
|
or will it lead to crash the whole system, if the process is using large amount od virtual memory?
|
But it also unlikely that one process using gigabytes of just
virtual memory would have much impact on the rest of even a fairly small system.
Often most of the virtual memory use is either file mappings (low impact on the rest of the system) or various "copy on write" or "demand zero" mappings that have even lower impact (until actually referenced).
Quote:
|
How to set the limits for unlimited virtual memory with limited ram and swap space on disk?
|
Since you seem to have a 32 bit system, no process can use more than 3GB of virtual memory even if unlimited. I can't think of a decent reason to limit processes to less than that.
If ulimit were per user rather than per process, it might be nice to limit anonymous memory (heap and stack). But per process even that limit wouldn't be effective at keeping one user from consuming enough resources to make the whole system unstable.
I think there exist some better per user limiting tools, but I don't know any details. Fortunately I use Linux only in environments where users are either assumed to behave responsibly or are alone on a system and are the only victim of their own irresponsible actions.