Mailing List
Home
Forum Home
Linux - General Red Hat Linux discussion list
Installation - Getting started with Red Hat Linux
Enterprise Linux 3 - Discussion of Red Hat Enterprise Linux 3 (Taroon)
Red Hat Linux 9 - Discussion of Red Hat Linux 9 (Shrike)
Red Hat Linux 7.2 - Discussion of Red Hat Linux 7.2 (Enigma)
Red Hat Linux 7.3 - Discussion of Red Hat Linux 7.3 (Valhalla)
Apache Web Server
Oracle database, Microsoft SQL server ...
Subjects
application/x mplayer2 plugin
RPM error: db4 error(16) from dbenv >remove: Device or resource
   busy
Command stream end of file while reading
X Windows problem (xauth)
Upgrading openoffice 1 1 rpm
FTP: connection refused
FTP: connection refused
mount: /dev/cdrom: is not a valid block device
Dell Precision 650, RedHat 9, no sound
how to trace the cause resulting in the crash of bind server
Virus on the list
UNINSTALL RPM MYSQL
usb pen drives: mounting as a user
broadcom network interface
make mrproper
Couldn 't open PID file /var/run/named/named pid Permission denied
sendmail configuration on redhat
kernel 2 6 and /dev/sound/mixer not found
Promise 378 controller
Problem using up2date
mrtg step by step howto/configuration for a newbie?
Compiling and Installing Kernel 2 6
Can 't locate module ppp0, can 't locate module ppp compress 21
Lotus Notes under Wine
HOW I CAN MAKE BOOTABLE FLOPPY DISKET
/etc/security/limits conf question
Intel E/1000 driver
rpm database corrupt
Command stream end of file while reading
qla2300 modules
 
System hang problem.

System hang problem.

2006-10-05       - By Paul Krizak

 Back
Reply:     <<     11     12     13     14     15  

We solved precisely this problem on our interactive login systems.  We
wanted to limit anybody that logged in to 3GB of useable memory (process
size, not RSS).

To do this, I added the following two scripts to /etc/profile.d:

[skaven@(protected) /etc/profile.d]$ cat limits.csh
# Set a 3GB process limit size
limit vmemoryuse 3096000
[skaven@(protected) /etc/profile.d]$ cat limits.sh
# Set a 3GB process limit size
ulimit -v 3096000

I then had to modify /etc/csh.cshrc and /etc/csh.login.  For some odd
reason the RHEL folks have the /etc/profile.d stuff executing for login
shells for bash, but not tcsh.  So I added this little tidbit to our
cfengine config:

# Fix RHEL3/RHEL4 /etc/profile.d/*.csh issues -- profile.d should
# only be read for login shells for both bash and tcsh.
profile.(RHEL3|RHEL4)::

# Remove profile.d stuff from cshrc
{ /etc/csh.cshrc
    LocateLineMatching "^if.*/etc/profile.d.*"
    DeleteToLineMatching "^endif$"
    DeleteNLines "1"
    CatchAbort
}

# Add profile.d stuff to login
{ /etc/csh.login
    BeginGroupIfNoLineMatching "^if.*/etc/profile.d.*"
        Append ""
        Append "if ( -d /etc/profile.d ) then"
        Append "${tab}set nonomatch"
        Append "${tab}${tab}foreach i ( /etc/profile.d/*.csh )"
        Append "${tab}${tab}if ( -r $i ) then"
        Append "${tab}${tab}${tab}source $i"
        Append "${tab}${tab}endif"
        Append "${tab}${tab}end"
        Append "${tab}unset i nonomatch"
        Append "endif"
    EndGroup
}


The end result is that anybody logging into one of these systems has a
hard limit of 3GB applied to their shell.  If you want this limit to
apply to non-login shells, you can try modifying /etc/csh.cshrc and
/etc/bashrc to put the limits in there, though I haven't tried to see if
that works or not.

Paul Krizak                         5900 E. Ben White Blvd. MS 625
Advanced Micro Devices              Austin, TX  78741
Linux/Unix Systems Engineering      Phone: (512) 602-8775
Silicon Design Division


Manish Neema wrote:
> It is not uncommon for us to see a process size ~40GB on 16 GB machines.
> I know, the simple answer would be to buy machines with more RAM.
>
> Anyway, I'll ask my last question again. Under the given circumstances,
> is there any way for me to limit the jobs based on SIZE (and NOT RSS;
> their RAM footprint)?
>
> -Manish
>
>
>
> --
> Taroon-list mailing list
> Taroon-list@(protected)
> https://www.redhat.com/mailman/listinfo/taroon-list
>
>


--
Taroon-list mailing list
Taroon-list@(protected)
https://www.redhat.com/mailman/listinfo/taroon-list