LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   can't login via ssh when apache is under heavy load (https://www.linuxquestions.org/questions/linux-software-2/cant-login-via-ssh-when-apache-is-under-heavy-load-541709/)

SPGWhistler 03-29-2007 02:59 PM

can't login via ssh when apache is under heavy load
 
I have a dedicated web server that his hosted by hostdime.net. It is fully managed, so when I had this latest problem, I went to their tech support hoping to get an answer, but their resolution summed it up with "Your server is configured correctly, and there are not settings that can be changed to solve this issue."

The Problem:
A few days ago, we experienced a very heavy load on our server due to a sale that started at exactly noon. So, we were getting thousands of hits all at once. Two things happened: 1 - My web site was unresponsive for the duration of the hits, and 2 - I could not log in via SSH for the duration of the hits. As soon as the traffic slowed down, I was able to log in again. I could get as far as "Last Login on XXX..." but that is it. A prompt would never show up.

I understand the website being unresponsive during a heavy load. That makes sense to me.

What I don't understand is why I couldn't log in via SSH. I mean, I understand that a high load causes sshd to respond slowly, which prevents the log in, but from my understanding of linux, there should be some setting that I can change to make sshd have a higher cpu priority than apache. Or, perhaps I could change apache's resource limits to make it only use x% of the cpu. Is this not correct? Tech support said there was no such setting.

What I want:
I do not want apache to suffer performance issues because of it, but I want sshd to have a higher cpu priority than apache so that I can login - even under high server loads.

I know that you can change a thread's priority level, but I don't know if that is what I want or not.

Any help in this area would be greatly appreciated.

Ps.
Shouldn't apache be fairly responsive, even under a fairly high load of thousands of hits per second? I mean, of course the way the web site is written will dictate this, but normally, shouldn't apache be able to handle thousands of hits per second and still be fairly responsive?

Thanks in advance for all the help!

edenCC 03-30-2007 08:23 AM

how about the avg. load during the high hits?
and how along are you waiting during the login?


Quote:

Originally Posted by SPGWhistler
...

I know that you can change a thread's priority level, but I don't know if that is what I want or not.

Any help in this area would be greatly appreciated.

Ps.
Shouldn't apache be fairly responsive, even under a fairly high load of thousands of hits per second? I mean, of course the way the web site is written will dictate this, but normally, shouldn't apache be able to handle thousands of hits per second and still be fairly responsive?

Thanks in advance for all the help!

you can get details from /etc/security/limits.conf if the box is redhat series. the cpu & mem limit based on user account and user groups, it's better to specify a normal account for apache to deploy the limitation.
But i think `nice' will be a good choice if you are sure that the long delay of login was not caused by the network outgoing/ingoing traffic.

I think, EVEN IF your web page is totally static html, a x86 based normal blade server cannot suffer from thousands of hits per second.

SPGWhistler 03-31-2007 04:05 AM

I am not an advanced linux user, so forgive me if I sound stupid here, but I'm not sure how I can get the exact cpu and memory usage during the high traffic time - but when I did a TOP, the cpu was about 90% and I don't know how much memory was used.

But I see what your saying with the limits.conf file... and my apache server runs as nobody, and my ssh daemon runs as root, so I should add some lines like:
nobody soft nice VALUE
nobody hard nice VALUE

But what should the VALUEs be?

Also, do I have to reboot to make these settings take effect, or will a simple apache restart do the trick?

Thanks again.


All times are GMT -5. The time now is 05:16 AM.