Solved

limit resource of a user

Posted on 2002-04-21
4
179 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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

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…
Fine Tune your automatic Updates for Ubuntu / Debian
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
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.

809 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