LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 02-15-2007, 06:21 PM   #1
comforteagle
LQ Newbie
 
Registered: Jan 2004
Distribution: redhat/mandrake/YD/SuSE
Posts: 4

Rep: Reputation: 0
out of memory/sshd dies


I'm trying to run some pretty intense scripts on my server & it uses up a lot, a lot, of memory. So much so that I think the kernel turns off sshd. I'm remote to logging in over ssh is crucial.

How can I keep sshd up or test if it is running and if not start it again?

/puzzled
 
Old 02-16-2007, 12:35 PM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
Write a script that checks for sshd, if it's not present, restart it. Stick it in cron and have it run every 5 minutes or so..
 
Old 02-16-2007, 12:45 PM   #3
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
You also probably want to de-intensify your script.

Putting some sleep statements in it will likely help.

Does the script do anything like a for or while loop that spawns background processes? This will kill your CPU rather than your memory. Putting sleeps inside loops definitely helps.

e.g.

while true
do ls -lR / &
done

Would peg your CPU rather quickly. Whereas:

while true
do ls -lR / &
sleep 300
done

Would tell it to wait 5 minutes between each ls -lR /. Not saying you should have sleeps of 300 between everything. It depends a lot on what you're running. Doing sleep 1 would probably be sufficient if you were doing "ps" (with no flags) in the loop. If you were doing "ps -ef" you'd probably want to do a sleep 5 instead.

The sleep doesn't necessarily have to be in a loop. Also any time you background in the script it is going to do that then immediately proceed to the next item. Simply taking out the & that does the backgrounding of the items will make the next item wait until the first is done.

Last edited by MensaWater; 02-16-2007 at 12:47 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
SSHD starts and dies without any error messages bugg_tb Linux - Software 3 04-19-2006 06:22 AM
SSHD starts and dies without any error messages bugg_tb Linux - Networking 1 04-19-2006 03:45 AM
FC4-Starting sshd: Privilege separation user sshd does not exist FAILED kiranherekar Fedora 5 12-29-2005 02:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:33 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration