Solved

limit resource of a user

Posted on 2002-04-21
4
183 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

738 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