Solved

limit resource of a user

Posted on 2002-04-21
4
173 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
Comment Utility
- 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
Comment Utility
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
Comment Utility
And I am using bash, any ulimit/limit command in bash?
0
 
LVL 51

Expert Comment

by:ahoffmann
Comment Utility
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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Join & Write a Comment

This document is written for Red Hat Enterprise Linux AS release 4 and ORACLE 10g.  Earlier releases can be installed using this document as well however there are some additional steps for packages to be installed see Metalink. Disclaimer: I hav…
In my business, I use the LTS (Long Term Support) versions of Linux. My workstations do real work, and so I rarely have the patience to deal with silly problems caused by an upgraded kernel that had experimental software on it to begin with from a r…
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.

763 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

13 Experts available now in Live!

Get 1:1 Help Now