How to start SSHD in high priority?

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

How to start SSHD in high priority?

howard chen
Hello,

Is it possible to config SSHD to start in high priority?

Since sometime the mysql database server is busy... I would like to
ssh into the server to kill some long running process...


Is it possible?

Thanks.

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: How to start SSHD in high priority?

Bart Silverstrim
howard chen wrote:
> Hello,
>
> Is it possible to config SSHD to start in high priority?
>
> Since sometime the mysql database server is busy... I would like to
> ssh into the server to kill some long running process...
>
>
> Is it possible?

I don't know how easy that would be to do, but you could look into a
watchdog program that when it sees a particular condition can run a
script that would either boost SSHD or kill an errant process for you
and email you about the issue.

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: How to start SSHD in high priority?

Mihamina Rakotomandimby (R12y)
In reply to this post by howard chen
howard chen wrote:
> Since sometime the mysql database server is busy... I would like to
> ssh into the server to kill some long running process...

One other possibility if easier, run mysql in very low priority.

--
Chef de projet chez Vectoris
http://www.google.com/search?q=mihamina+rakotomandimby
System: xUbuntu 8.10 with almost all from package install

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: How to start SSHD in high priority?

Christopher Chan-9
In reply to this post by howard chen

> Is it possible to config SSHD to start in high priority?
>
> Since sometime the mysql database server is busy... I would like to
> ssh into the server to kill some long running process...
>
>  

Are you sure that your login problems are due to mysql pegging cpu? It
could also be due to heavy disk i/o (aka swapping) and if it is,
changing priorities makes zero difference.


If the problem really is mysql pegging cpu, do you have a lot of
connections? If you do, consider getting connection pooling into your
architecture if you do not already do so.

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: How to start SSHD in high priority?

howard chen
Hey,

On Wed, Feb 11, 2009 at 10:49 PM, Chan Chung Hang Christopher
<[hidden email]> wrote:

> Are you sure that your login problems are due to mysql pegging cpu? It
> could also be due to heavy disk i/o (aka swapping) and if it is,
> changing priorities makes zero difference.
>

Why? If priority is reduced => chance of using I/O also reduced

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: How to start SSHD in high priority?

John Hubbard-3
howard chen wrote:

> Hey,
>
> On Wed, Feb 11, 2009 at 10:49 PM, Chan Chung Hang Christopher
> <[hidden email]> wrote:
>  
>> Are you sure that your login problems are due to mysql pegging cpu? It
>> could also be due to heavy disk i/o (aka swapping) and if it is,
>> changing priorities makes zero difference.
> Why? If priority is reduced => chance of using I/O also reduced
>  
What process carries out paging? If paging is preformed by a paging
daemon, then the paging process will still bring the computer to its
knees. sshd would need to have a higher priority than the paging daemon.

--
-john

To be or not to be, that is the question
                2b || !2b
(0b10)*(0b1100010) || !(0b10)*(0b1100010)
        0b11000100 || !0b11000100
        0b11000100 || 0b00111011
               0b11111111
        255, that is the answer.



--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: How to start SSHD in high priority?

Smoot Carl-Mitchell
In reply to this post by howard chen
On Thu, 2009-02-12 at 00:15 +0800, howard chen wrote:

> Hey,
>
> On Wed, Feb 11, 2009 at 10:49 PM, Chan Chung Hang Christopher
> <[hidden email]> wrote:
>
> > Are you sure that your login problems are due to mysql pegging cpu? It
> > could also be due to heavy disk i/o (aka swapping) and if it is,
> > changing priorities makes zero difference.
> >
>
> Why? If priority is reduced => chance of using I/O also reduced

Process priority when elevated using "nice" only affects the cpu queing
algorithm.  It does not affect I/O.  You might try running "vmstat 5" as
a quick and dirty way to get an idea of what is going on when the system
is sluggish.  My guess will be that you will see high paging activity
which can have a substantial impact on responsiveness.  Pay particular
attention to the "so" column.  Also, if you see a lot of processes in
the 'b' (blocked) column, then your system is I/O bound.

I am not convinced running the SSH dameon at a higher priority will make
much difference.  The login sequence just does not take up that many cpu
cycles.  However, the login sequence has to create several processes
including a new instance of the shell.  If you are paging at a high
rate, this can slow down the shell execution as the system searches for
pages to pageout to make room for the pages needed by the new shell.
Also, if you start the SSH daemon with a higher priority then all of the
child processes of the daemon will also have the elevated priority which
I do not think is what you want to do.
--
Smoot Carl-Mitchell
Computer Systems and
Network Consultant
[hidden email]
+1 480 922 7313
cell: +1 602 421 9005

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: How to start SSHD in high priority?

Derek Broughton-2
In reply to this post by John Hubbard-3
John Hubbard wrote:

> What process carries out paging? If paging is preformed by a paging
> daemon, then the paging process will still bring the computer to its
> knees. sshd would need to have a higher priority than the paging daemon.

Which, iirc from my undergrad days, is a Very Bad Idea.  :-)

--
derek


--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: How to start SSHD in high priority?

John Hubbard-3
Derek Broughton wrote:

> John Hubbard wrote:
>
>  
>> What process carries out paging? If paging is preformed by a paging
>> daemon, then the paging process will still bring the computer to its
>> knees. sshd would need to have a higher priority than the paging daemon.
>>    
>
> Which, iirc from my undergrad days, is a Very Bad Idea.  :-)
>
>  
It doesn't sound like a good idea to me either. I am also not sure that
it would really fix the problem. If there is no memory a higher priority
won't help.

--
-john

To be or not to be, that is the question
                2b || !2b
(0b10)*(0b1100010) || !(0b10)*(0b1100010)
        0b11000100 || !0b11000100
        0b11000100 || 0b00111011
               0b11111111
        255, that is the answer.



--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: How to start SSHD in high priority?

Hal Burgiss
In reply to this post by howard chen
On Wed, Feb 11, 2009 at 09:46:26PM +0800, howard chen wrote:
> Hello,
>

Yo. Another indirect solution ...

The times I've seen this kind of behavior is because mysql was
severely underconfigured, or the system just needed more/better
hardware. Have you touched my.cnf? Most Linuxes, including Ubuntu,
have a conservative stock config. You can find a selection of configs
in /usr/share/doc/mysql-server-5.0/examples/. This is definitely worth
looking at even if its not the whole solution. A misbehaved application
can be another source of headaches.

--
Hal


--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: How to start SSHD in high priority?

Christopher Chan-9
In reply to this post by howard chen
howard chen wrote:

> Hey,
>
> On Wed, Feb 11, 2009 at 10:49 PM, Chan Chung Hang Christopher
> <[hidden email]> wrote:
>
>> Are you sure that your login problems are due to mysql pegging cpu? It
>> could also be due to heavy disk i/o (aka swapping) and if it is,
>> changing priorities makes zero difference.
>>
>
> Why? If priority is reduced => chance of using I/O also reduced
>


As another poster has already explained, setting a different priority
has zero bearing on disk i/o since it is only for cpu processing time.
There is no provision for giving a particular process more privileges in
disk i/o as far as I know too.

What you really need to do is follow the suggestion of another poster
and run 'vmstat 1'.

Look at the last number which should correspond to wa. High wa numbers
mean that the box is suffering from a i/o bottleneck. That might also
mean high id numbers (id is the second last column and stands for cpu
idle) which would mean the box only suffers i/o bottlenecks which is
preventing optimal use of available cpu power.

If you have high wa numbers and low id numbers (maybe even 0) you are
suffering from both lack of cpu processing power to a degree and an i/o
bottleneck.

If you have both low id and wa numbers, you need more cpu processing
power...especially if id is 0 and wa is still low. The box is maxxed out.

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: How to start SSHD in high priority?

sktsee-2
On Thu, 12 Feb 2009 11:34:24 +0800, Christopher Chan wrote:

> howard chen wrote:
>> Hey,
>>
>> On Wed, Feb 11, 2009 at 10:49 PM, Chan Chung Hang Christopher
>> <[hidden email]> wrote:
>>
>>> Are you sure that your login problems are due to mysql pegging cpu? It
>>> could also be due to heavy disk i/o (aka swapping) and if it is,
>>> changing priorities makes zero difference.
>>>
>>>
>> Why? If priority is reduced => chance of using I/O also reduced
>>
>>
>
> As another poster has already explained, setting a different priority
> has zero bearing on disk i/o since it is only for cpu processing time.
> There is no provision for giving a particular process more privileges in
> disk i/o as far as I know too.
>

ionice

--
sktsee


--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: How to start SSHD in high priority?

howard chen
Hello.

On Sat, Feb 14, 2009 at 12:06 AM, sktsee <[hidden email]> wrote:
> ionice

wow....never heard this command before...should give a try !

Thanks.

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: How to start SSHD in high priority?

Christopher Chan-9
howard chen wrote:

> Hello.
>
> On Sat, Feb 14, 2009 at 12:06 AM, sktsee <[hidden email]> wrote:
>  
>> ionice
>>    
>
> wow....never heard this command before...should give a try !
>
>  
Except from man page:

NOTES
       Linux  supports  io scheduling priorities and classes since
2.6.13 with
       the CFQ io scheduler.


Man, we have to learn how to keep up...

Oh well, it is going to be tough to do that when you don't have a need
to...school jobs are so much more relaxed than 24/7 environments. Thanks
sktsee!

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users