Solved

limit resource of a user

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
PHP Apache application gives "Forbidden" message 5 45
Linux Scripting 3 97
Install Predefined Certificate on Ubunto 4 13
Adding more CPU cores to a Linux VM 5 61
Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
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.

910 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now