Priority and 'NICE' command - Redhat

This is a discussion on Priority and 'NICE' command - Redhat ; Hi, I am looking for a command, which can prioritize an application. I saw that 'nice' can do the job. Now, the application can start via services... (like /sbin/service app1 start) I tried to use 'nice' with that like : ...

+ Reply to Thread
Results 1 to 7 of 7

Thread: Priority and 'NICE' command

  1. Priority and 'NICE' command

    Hi,

    I am looking for a command, which can prioritize an application.
    I saw that 'nice' can do the job.

    Now, the application can start via services... (like /sbin/service app1
    start)

    I tried to use 'nice' with that like :
    nice -10 /sbin/service app1 start

    Seems to accept the command, but I am not sure that the app1
    application, will have a high priority, on all other applications...

    What do you think ?

    Thanks and regards,

  2. Re: Priority and 'NICE' command

    In news:fsj6b0$j84$1$8300dec7@news.demon.co.uk,
    Steve typed:

    > I tried to use 'nice' with that like :
    > nice -10 /sbin/service app1 start
    >
    > Seems to accept the command, but I am not sure that the app1
    > application, will have a high priority, on all other applications...


    Nope. That will only prioritize /sbin/service. To accomplish what you want
    you're going to have to edit the /etc/init.d/app1 script and "nice" the
    invocation of the application within the "start ()" function (if that's how
    the script is structured) before running the script.



  3. Re: Priority and 'NICE' command

    ynotssor wrote:
    > In news:fsj6b0$j84$1$8300dec7@news.demon.co.uk,
    > Steve typed:
    >
    >> I tried to use 'nice' with that like :
    >> nice -10 /sbin/service app1 start
    >>
    >> Seems to accept the command, but I am not sure that the app1
    >> application, will have a high priority, on all other applications...

    >
    > Nope. That will only prioritize /sbin/service. To accomplish what you want
    > you're going to have to edit the /etc/init.d/app1 script and "nice" the
    > invocation of the application within the "start ()" function (if that's how
    > the script is structured) before running the script.
    >
    >


    There is effectively, a Start() and then the content of the function

    Not sure really how to do so.
    I can see the line :

    daemon $DAEMON $ASTARGS

    I tried to write : nice -10 daemon $DAEMON $ASTARGS
    -> answer : Starting asterisk: nice: daemon: No such file or directory







  4. Re: Priority and 'NICE' command

    In news:fsjfca$9t9$1$830fa79d@news.demon.co.uk,
    Steve typed:

    > I tried to write : nice -10 daemon $DAEMON $ASTARGS
    > -> answer : Starting asterisk: nice: daemon: No such file or directory


    What happens with:

    daemon (nice -10 $DAEMON $ASTARGS)

    Not sure if the ( ) are necessary.





  5. Re: Priority and 'NICE' command

    ynotssor wrote:
    > In news:fsjfca$9t9$1$830fa79d@news.demon.co.uk,
    > Steve typed:
    >
    >
    >>I tried to write : nice -10 daemon $DAEMON $ASTARGS
    >>-> answer : Starting asterisk: nice: daemon: No such file or directory

    >
    >
    > What happens with:
    >
    > daemon (nice -10 $DAEMON $ASTARGS)
    >
    > Not sure if the ( ) are necessary.
    >
    >
    >
    >


    Steve do you call daemon on the commandline or from a script?

    daemon is not a command, but a function provided by
    /etc/rc.d/init.d/functions

    source /etc/rc.d/init.d/functions; daemon -10 $DAEMON $ASTARGS

    would be a commandline way to do what you tried

    If you want daemon to look like a command you could add

    source /etc/rc.d/init.d/functions

    to the .bash_profile

  6. Re: Priority and 'NICE' command

    Jan Gerrit Kootstra wrote:
    > ynotssor wrote:
    >> In news:fsjfca$9t9$1$830fa79d@news.demon.co.uk,
    >> Steve typed:
    >>
    >>
    >>> I tried to write : nice -10 daemon $DAEMON $ASTARGS
    >>> -> answer : Starting asterisk: nice: daemon: No such file or directory

    >>
    >>
    >> What happens with:
    >>
    >> daemon (nice -10 $DAEMON $ASTARGS)
    >>
    >> Not sure if the ( ) are necessary.
    >>
    >>
    >>
    >>

    >
    > Steve do you call daemon on the commandline or from a script?
    >
    > daemon is not a command, but a function provided by
    > /etc/rc.d/init.d/functions
    >
    > source /etc/rc.d/init.d/functions; daemon -10 $DAEMON $ASTARGS
    >
    > would be a commandline way to do what you tried
    >
    > If you want daemon to look like a command you could add
    >
    > source /etc/rc.d/init.d/functions
    >
    > to the .bash_profile


    Thanks for all of you. I tried daemon (nice -10 $DAEMON $ASTARGS)
    And it seems to be happy.

    Is there any possibility now to list services and see which priority
    they've got ?

    Just to make sure that my app, is correctly prioritized...


    thanks

  7. Re: Priority and 'NICE' command

    In news:fsm33q$g5s$2$8300dec7@news.demon.co.uk,
    Steve typed:

    > Is there any possibility now to list services and see which priority
    > they've got ?


    "top" will show the nice value for each displayed process. It doesn't have
    the ability to sort by that field however.

    "man ps" will show you how to see the nice value in the output for each
    process in the ps output..



+ Reply to Thread