Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

loadwatch(1) [debian man page]

LOADWATCH(1)						      General Commands Manual						      LOADWATCH(1)

NAME
loadwatch - run a program when machine is idle SYNOPSIS
loadwatch [options] -p pid | [--] prog [args] DESCRIPTION
loadwatch either spawns a child process prog with the arguments args and controls it with all its process group, or takes control of an already running process with pid pid with all its process group. loadwatch allows the controlled processes to run while the load average remains below high_limit. Every delay seconds, loadwatch checks the load average. If the load is above high_limit, the child is suspended; the child is resumed when the load falls below low_limit. OPTIONS
A summary of options is included below. -h high_limit A decimal value that sets the system load at which the child process will be suspended. (Default: 1.25) -l low_limit A decimal value that sets the system load at which the child process will be resumed. (Default: 0.25) -d delay An integral number of seconds that sets how often the system load will be checked. (Default: 10) -n copies An integer value that sets the number of copies of prog to run. (Default: 1) -u file Create a UNIX domain socket file for use by lw-ctl. -p pid The pid of the program that should be controlled by loadwatch (with all its process group). SEE ALSO
lw-ctl(1), nice(1) BUGS
You should choose low_limit and high_limit carefully. When the load drops below low_limit, the process(es) will be resumed, and it should not, by itself, cause the load to raise above high_limit, or the whole will oscillate, periodically suspending and resuming the process(es). Similarly, if several instances of loadwatch are running, they may resume their processes at the same time, leading to oscillations if the limits are not carefully chosen. Hence, each instance of loadwatch affects every other instance on the computer, and should not be consid- ered in isolation. AUTHOR
This manual page was written by Dale E. Martin <dmartin@debian.org>, for the Debian GNU/Linux system (but may be used by others). It was then updated by Nicolas Boullis <nboullis@debian.org>. July 2003 LOADWATCH(1)

Check Out this Related Man Page

setpgid(3)						     Library Functions Manual							setpgid(3)

Name
       setpgid - set process group (POSIX)

Syntax
       #include <sys/types.h>
       int
       setpgid(pid, pgrp)
       pid_t pid, pgrp;

Description
       The  function is used to either join an existing process group or create a new process group within the session of the calling process (see
       Upon successful completion, the process group ID of the process that has a process ID which matches pid is set to pgrp.	If  pid  is  zero,
       then the call applies to the current process. In addition, if pgrp is zero, the process ID of the indicated process is used.

       This function is available only in the POSIX environment.

Return Values
       The  function  returns 0 when the operation is successful.  If the request fails, -1 is returned and the global variable indicates the rea-
       son.

Diagnostics
       The function fails and the process group is not altered if one of the following occurs:

       [EACCES]       The value of the pid argument matches the process ID of a child process of the calling process and  the  child  process  has
		      successfully executed an function.

       [EINVAL]       The value of the pgrp argument is less than zero or is not a supported value.

       [EPERM]	      The process indicated by the pid argument is a session leader.

		      The  value of the pid argument matches the process ID of a child process of the calling process and the child process is not
		      in the same session as the calling process.

		      The value of the pgrp argument does not match the process ID of the process indicated by the pid argument and  there  is	no
		      process with a process group ID that matches the value of the pgrp argument in the same session as the calling process.

       [ESRCH]	      The  value  of  the  pid	argument  does	not  match the process ID of the calling process of a child process of the calling
		      process.

See Also
       getpgrp(2), setsid(2)

																	setpgid(3)
Man Page