Solved

limit resource of a user

Posted on 2002-04-21
4
180 Views
Last Modified: 2010-04-20
hi,
I am running a linux server (RH) to host some domains, using Apache 1.3.23.


Some of my clients use CGI, and they make my server very high loading at peak hrs.

Do you know any methods to limit the usage of CPU/MEM/resources of a particular user?
(I use SUEXEC for CGI programs.)

0
Comment
Question by:stanleyhuen
  • 2
  • 2
4 Comments
 
LVL 51

Accepted Solution

by:
ahoffmann earned 100 total points
ID: 6962080
- either change shell limits
     for sh and friends in /etc/profile (or similar)
          ulimit -u 10
     for csh and friends in /etc/csh.cshrc or ~/.cshrc
          limit maxproc 10
  see limit or ulimit man-page for details

- or change /usr/src/linux/include/linux/tasks.h
     #define NR_TASKS
     #define MAX_TASKS_PER_USER
     #define MIN_TASKS_LEFT_FOR_ROOT
then recompile the kernel
0
 

Author Comment

by:stanleyhuen
ID: 6962112
Thanks ahoffmann,

Can you describe more how to ulimit/limit a particular user?

I don't want to limit all users, but only one or two, How can I do?

Thanks.

Stanley
0
 

Author Comment

by:stanleyhuen
ID: 6962130
And I am using bash, any ulimit/limit command in bash?
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 6962183
put the suggested commands in the files in /etc (which cannot be modified by ordinary users), make these commands dependent on the $USER variable, like

if [ $USER = "you" ]; then
     ulimit -u 10
fi

check the docs of your shell how to make this limit unchangeable by the user.
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will explain how to establish a SSH connection to Ubuntu through the firewall and using a different port other then 22. I have set up a Ubuntu virtual machine in Virtualbox and I am running a Windows 7 workstation. From the Ubuntu vi…
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question