\section{Process Limits}

\begin{frame}
   {Controlling Processes with ulimit}

   \begin{itemize}

      \item
      Built in \textbf{bash} command
      \item
      Displays or resets process resource limits
      \item
      Use to \textbf{restrict} capabilities so individual user
      and/or processes cannot exhaust system resources such as:
      \begin{itemize}
         \item Memory
         \item CPU time
         \item Number of active processes or files
      \end{itemize}
      \item
      System administrator can set system-wide limits for all users
   \end{itemize}

\end{frame}

\cprotect\note{

   A system administrator may need to change some of these
   values in either direction:

   \begin{itemize}
      \item
      To \textbf{restrict} capabilities so an individual user
      and/or process can not exhaust system resources, such as
      memory, cpu time or the maximum number of processes on the
      system.
      \item
      To \textbf{expand} capabilities so a process does not run
      into resource limits; for example, a server handling many
      clients may find the default of \texttt{1024} open files
      makes its work impossible to perform.
   \end{itemize}
   \begin{figure}[H]
      \includegraphics[height=2.220in]{IMAGES/ulimit}
      \caption{ulimit}
   \end{figure}
}

\begin{frame}
   {Setting Limits}

   \begin{itemize}
      \item
      Set any particular limit by doing:
      \begin{cmd}
$ ulimit [options] [limit]
      \end{cmd}
      as in
      \begin{cmd}
$ ulimit -n 1600
      \end{cmd}
      which would increase the maximum number of file
      descriptors to \verb?1600?.
      \item
      Make persistent by modifying
      \filelink{/etc/security/limits.conf} and rebooting
   \end{itemize}
\end{frame}

\cprotect\note{

   Note that the changes only affect the current shell.  To
   make changes that are effective for all logged-in users,
   one needs to modify
   \filelink{/etc/security/limits.conf}, a very nicely
   self-documented file, and then reboot.

}


\begin{frame}
   {Hard and Soft Limits}

   There are two kinds of limits:
   \begin{itemize}
      \item
      \textbf{Hard}: Maximum value, set only by the root user,
      that a user can raise the resource limit to.
      \item
      \textbf{Soft}: Current limiting value, which a user can
      modify but can not exceed the hard limit.
   \end{itemize}

\end{frame}

\cprotect\note{

   \begin{cmd}
 $ ulimit -H -n
   \end{cmd}
   \begin{response}
4096
   \end{response}
   \begin{cmd}
$ ulimit -S -n
   \end{cmd}
   \begin{response}
1024
   \end{response}
}

