26

I am a little concerned with the amount of resources that I can use in a shared machine. Is there any way to test if the administrator has a limit in the amount of resources that I can use? And if does, to make a more complete question, how can I set up such limit?

1

3 Answers 3

18

For process related limits, you can have a look in /etc/security/limits.conf (read the comments in the file, use google or use man limits.conf for more information). And as jpalecek points out, you may use ulimit -a to see (and possibly modify) all such limits currently in effect.

You can use the command quota to see if a disk quota is in effect.

Sign up to request clarification or add additional context in comments.

2 Comments

All the inputs are commented,does that mean that there is no limit?.
Most probably, at least regarding CPU and memory usage. For disk usage I think you will need to check with the quota command
12

You can try running

ulimit -a 

to see what resource limits are in effect. Also, if you are allowed to change such limits, you can change them by the ulimit command, eg.

ulimit -c unlimited 

lifts any limit for a size of a core file a process can make.

2 Comments

I realize this question is 3 years old, but the man page lists this program as being obsolete (says use getrlimit instead)
The ulimit() C library function is (see ulimit(3)), the shell builtin is not (see bash(1)).
1

At the C level, the relevant functions (actually syscalls(2)...) could be setrlimit(2) and setpriority(2) and sched_setattr(2). You probably would want them to be called from your shell.

See also proc(5) -and try cat /proc/self/limits and sched(7).

You may want to use the renice(1) command.

If you run a long-lasting program (for several hours) not requiring user interaction, you could consider using some batch processing. Some Linux systems have a batch or at command.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.