CRON taking more CPU then SETI?

Crisis

Member
Apr 7, 2000
159
0
0
I have SETI set up on a linux server, as a crontab entry. When I do a ps listing, I notice that CRON is taking about 60% cpue, and seti only about 15-20. Is this normal, is that 60% that is cron actually seti?
 

Russ

Lifer
Oct 9, 1999
21,093
3
0
HMM...cron should take virtually no CPU unless it is in the middle of a scheduled job. Are you running the SETI schedule constantly (not familiar with SETI, so that might be a dumb question.:))

Russ, NCNE
 

Crisis

Member
Apr 7, 2000
159
0
0
cron and crontab is a unix service that allows proccesses to be executed at certain times, or to make sure they are always running. For example I want to have the server run seti as a process at all times, and if it were to seg fault by soem chance or the system was rebooted, cron would make sure it was restarted...
 

JWMiddleton

Diamond Member
Aug 10, 2000
5,686
172
106
Hi Crisis! Are these instantaneous numbers, or cumulative ones? I know that the SETI numbers start over each time a WU is completed. Thus, it could appear that other things have been running longer and getting more CPU time.

If it were instantaneous numbers, then I would wonder if CRON is having a problem keeping SETI running. Have you tried rebooting the system?
 

Crisis

Member
Apr 7, 2000
159
0
0
yeah ive been having the problem on a few different servers too.... who knows maybe if i get some more time ill mess with it more but it just seemed odd to me. hehe im running this on a few misc unix servers at my old university that i still have access to they dont know what they are doing lol so they wont miss the cpu usage ;-)
 

Shuxclams

Diamond Member
Oct 10, 1999
9,286
15
81
Crisis, Maybe try creating a script and add it to rc.local instead. Cron will keep running the program over and over. If you only want seti to run during certian hours then you will have to add a line to "kill" seti, and kill will need a PID. Why not just a script to start it?

#!/bin/bash
#
#Setiathome Script
#
cd /dir/to/seti
./setiathome -option
#
#end of script



SHUX
 

Shuxclams

Diamond Member
Oct 10, 1999
9,286
15
81
Hummm, I thought about "at" but it will run till the job is complete and I don't forsee seti "ending" anytime soon so that won't work. If you can create a script that will start the setiathome process and then parse "ps" for the PID and have it exicute a "kill" at a certian time then you might have something. I am not a very good bash scripter so I can't really help out without my book here. :eek:

for instance I tried parts of the script and added;

ps -uax > /var/log/seti/psout.txt | cat /var/log/seti/psout.txt | grep setiathome

Now the output is formatted in the output like;
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
user 9034 96.8 11.8 17276 15116 pts/0 RN 10:30 18:55 setiathome -verbose

What would be needed is beyond my coding ability, and that would be to parse the PID to a number that could be applied to a "kill" command at a certian time each day.








SHUX
 

Poof

Diamond Member
Jul 27, 2000
4,305
0
0
If you do use any scripts - and especially if they're run from the rc.local, please please make sure that you fork the process into the background, ala:

./seti &

Been there, done that forgetting to fork it... :eek:
 

Darkone

Senior member
Feb 26, 2000
320
0
0
I think I might have the solution to what your talking about. I run seti from CRON. Cron calls a script that calls the seti program, CRON also runs another script that will kill any existing seti processes..

Heres my crontab :

10 7 * * 1-5 /usr/bin/seti/setikill
00 22 * * 1-5 /usr/bin/seti/startseti > /dev/null 2>&1

Heres the contents of the setkill script..:

#!/bin/sh

SETI_PID=`cat /usr/bin/seti/pid.sah`
kill -9 $SETI_PID

Heres the startseti script...:

#!/bin/csh
cd /usr/bin/seti
./setiathome > /dev/null


Hope this all helps

D
 

ColinP

Golden Member
Oct 10, 1999
1,359
0
0
You could use killall as well..
Even simpler,,

do a man on killall...

Something like killall setiathome will do it..

:)


Col