limiting 2 programs at a time - Linux

This is a discussion on limiting 2 programs at a time - Linux ; Hi, Does anyone know how I can limit the number of programs running on a Linux machine to two. The thing is, the machine (Linux-Alpha, Red-Hat 7.1) is highly unstable and whenever there are more than two programs running on ...

+ Reply to Thread
Results 1 to 8 of 8

Thread: limiting 2 programs at a time

  1. limiting 2 programs at a time

    Hi,
    Does anyone know how I can limit the number of programs running on a
    Linux machine to two. The thing is, the machine (Linux-Alpha, Red-Hat
    7.1) is highly unstable and whenever there are more than two programs
    running on it, it tends to crash. I have some 8 users on the machine
    with each one running computationally demanding FORTRAN programs this
    time or the other. I want it work in such a way that if there are
    already two programs running on the machine, then if someone is trying
    to run another program on it, it gives him the option either to abort
    it or put it in a queque and hence executing it only when one of the
    other program has finished running. Is there anyway I can configure
    this machine to do so.
    Any help will be appreciated.
    Thanks
    Kartik

  2. Re: limiting 2 programs at a time

    "Kartik Arora" wrote in message
    news:69651d9f.0309260832.6a013746@posting.google.c om

    > Does anyone know how I can limit the number of programs running on a
    > Linux machine to two. The thing is, the machine (Linux-Alpha, Red-Hat
    > 7.1) is highly unstable and whenever there are more than two programs
    > running on it, it tends to crash. I have some 8 users on the machine
    > with each one running computationally demanding FORTRAN programs this
    > time or the other. I want it work in such a way that if there are
    > already two programs running on the machine, then if someone is trying
    > to run another program on it, it gives him the option either to abort
    > it or put it in a queque and hence executing it only when one of the
    > other program has finished running. Is there anyway I can configure
    > this machine to do so.
    > Any help will be appreciated.


    It's impossible. The machine can't function with only 2 programs running, as
    you'll need init, keventd, kswapd, bdflush, kupated, kscand. mdrecoveryd and
    a several others running just to get to a login prompt.

    If the machine is "highly unstable" then you should analy[sz]e and solve the
    stability problems before loading the cpu and memory the way you are doing.
    I've administered Linux machines for many years and haven't had "stability
    problems", even with multiple users running many programs each at a time.
    What is most likely happening is that you are running out of swap space, in
    which case you should "mkswap" additional swap file space and then
    "swapon -a" to make that additional swap space available to the system.
    Editing /etc/fstab will make the additional swap available on reboots too.

    What you may wish to try is to limit the priority that each user is allotted
    to their process space. You can do this by assigning the
    computationally-intensive users to a group, say "lowpriority", and then
    "renice" their process space to a lower priority in order to share the cpu
    cycles more equitably with the system.

    This can be accomplished in /etc/profile, after editing the /etc/group file:

    if [ `groups | grep lowpriority` ]; then renice +15 -u $LOGNAME; fi

    "man mkswap swapon group renice" for more information.

    tony


    --
    use hotmail com for any email replies



    -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
    http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
    -----== Over 100,000 Newsgroups - 19 Different Servers! =-----

  3. Re: limiting 2 programs at a time

    Kartik Arora wrote:
    > Hi,
    > Does anyone know how I can limit the number of programs running on a
    > Linux machine to two. The thing is, the machine (Linux-Alpha, Red-Hat
    > 7.1) is highly unstable and whenever there are more than two programs
    > running on it, it tends to crash. I have some 8 users on the machine
    > with each one running computationally demanding FORTRAN programs this
    > time or the other. I want it work in such a way that if there are
    > already two programs running on the machine, then if someone is trying
    > to run another program on it, it gives him the option either to abort
    > it or put it in a queque and hence executing it only when one of the
    > other program has finished running. Is there anyway I can configure
    > this machine to do so.
    > Any help will be appreciated.
    > Thanks
    > Kartik


    This is really wierd, but if you see that limiting the number of CPU
    INTENSIVE processes solves your problem, then you may want to run the
    jobs through the SunGrid Engine. The engine is free, as far as I know,
    and it allows to impose all sorts of policies on the jobs - cpu, memory
    etc.

    -Michael


  4. Re: limiting 2 programs at a time

    He must surely be talking about running no more than two user
    programs (the FORTRAN programs). If the machine is that unstable,
    there is a bigger issue going on there.
    What he needs is a batch submittal facility. I guess a shell
    or Perl script could do that if the script always runs under a single
    user ID.
    The time invested in writing such a script might better be
    spent figuring out why the machine is so unstable.

    On Fri, 26 Sep 2003 13:04:27 -0700, "ynotssor" <"ynotssor"> wrote:

    >"Kartik Arora" wrote in message
    >news:69651d9f.0309260832.6a013746@posting.google.c om
    >
    >> Does anyone know how I can limit the number of programs running on a
    >> Linux machine to two. The thing is, the machine (Linux-Alpha, Red-Hat
    >> 7.1) is highly unstable and whenever there are more than two programs
    >> running on it, it tends to crash. I have some 8 users on the machine
    >> with each one running computationally demanding FORTRAN programs this
    >> time or the other. I want it work in such a way that if there are
    >> already two programs running on the machine, then if someone is trying
    >> to run another program on it, it gives him the option either to abort
    >> it or put it in a queque and hence executing it only when one of the
    >> other program has finished running. Is there anyway I can configure
    >> this machine to do so.
    >> Any help will be appreciated.

    >
    >It's impossible. The machine can't function with only 2 programs running, as
    >you'll need init, keventd, kswapd, bdflush, kupated, kscand. mdrecoveryd and
    >a several others running just to get to a login prompt.
    >
    >If the machine is "highly unstable" then you should analy[sz]e and solve the
    >stability problems before loading the cpu and memory the way you are doing.
    >I've administered Linux machines for many years and haven't had "stability
    >problems", even with multiple users running many programs each at a time.
    >What is most likely happening is that you are running out of swap space, in
    >which case you should "mkswap" additional swap file space and then
    >"swapon -a" to make that additional swap space available to the system.
    >Editing /etc/fstab will make the additional swap available on reboots too.
    >
    >What you may wish to try is to limit the priority that each user is allotted
    >to their process space. You can do this by assigning the
    >computationally-intensive users to a group, say "lowpriority", and then
    >"renice" their process space to a lower priority in order to share the cpu
    >cycles more equitably with the system.
    >
    >This can be accomplished in /etc/profile, after editing the /etc/group file:
    >
    >if [ `groups | grep lowpriority` ]; then renice +15 -u $LOGNAME; fi
    >
    >"man mkswap swapon group renice" for more information.
    >
    > tony
    >
    >
    >--
    >use hotmail com for any email replies
    >
    >
    >
    >-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
    >http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
    >-----== Over 100,000 Newsgroups - 19 Different Servers! =-----


    ------------
    Remove the underscores from the e-mail address.

  5. Re: limiting 2 programs at a time

    "Joe Fischer" wrote in message
    news:3f74ca10.507772948@news-server.insight.rr.com

    > He must surely be talking about running no more than two user
    > programs (the FORTRAN programs). If the machine is that unstable,
    > there is a bigger issue going on there.


    I would bet that it's a lack of sufficient swap space.


    --
    use hotmail com for any email replies


    -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
    http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
    -----== Over 100,000 Newsgroups - 19 Different Servers! =-----

  6. Re: limiting 2 programs at a time

    "Michael" wrote in message
    news:Nl2db.155442$mp.84330@rwcrnsc51.ops.asp.att.n et

    > This is really wierd, but if you see that limiting the number of CPU
    > INTENSIVE processes solves your problem, then you may want to run the
    > jobs through the SunGrid Engine. The engine is free, as far as I know,
    > and it allows to impose all sorts of policies on the jobs - cpu,
    > memory etc.


    Why do you feel that cluster-management software is the solution for a
    single machine, especially when it would be yet another cpu-intensive,
    swap-hungry parent process on an "unstable" system?

    --
    use hotmail com for any email replies



    -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
    http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
    -----== Over 100,000 Newsgroups - 19 Different Servers! =-----

  7. Re: limiting 2 programs at a time

    ynotssor wrote:
    >
    > Why do you feel that cluster-management software is the solution for a
    > single machine, especially when it would be yet another cpu-intensive,
    > swap-hungry parent process on an "unstable" system?


    Beacuse I am familiar with the SunGrid engine and I believe it might
    help in this case -- the engine will run on a single host just fine and
    the engine itself will not fry the cpu by itself. BTW, while I agree
    that increasing the swap space may help, your other recommendation about
    renicing the processes does not make any sense to me. Renice-ing the
    process will only give it lower scheduling priority with respect to
    other running processes on a 100% loaded machine, which by itself is not
    going to lighten the load to either cpu or swap.
    Michael


  8. Re: limiting 2 programs at a time

    You could try to use the pam_limit module:
    http://www.kernel.org/pub/linux/libs...-6.html#ss6.12
    configure /etc/security/limits.conf file to meet your needs.

    Kartik Arora wrote:
    > Hi,
    > Does anyone know how I can limit the number of programs running on a
    > Linux machine to two. The thing is, the machine (Linux-Alpha, Red-Hat
    > 7.1) is highly unstable and whenever there are more than two programs
    > running on it, it tends to crash. I have some 8 users on the machine
    > with each one running computationally demanding FORTRAN programs this
    > time or the other. I want it work in such a way that if there are
    > already two programs running on the machine, then if someone is trying
    > to run another program on it, it gives him the option either to abort
    > it or put it in a queque and hence executing it only when one of the
    > other program has finished running. Is there anyway I can configure
    > this machine to do so.
    > Any help will be appreciated.
    > Thanks
    > Kartik



+ Reply to Thread