LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-16-2011, 12:40 PM   #1
user3323
LQ Newbie
 
Registered: Feb 2011
Posts: 1

Rep: Reputation: 0
consecutive jobs, different users, high cpu load


Hello everybody

I am new here, this is my first post. I know something about linux, although not too much. I have a problem, looking for solutions.
My sistem is a Centos 5.4, 64 bit, multiCPU (intel xeons). There is a program installed on it, that will execute high cpu consuming tasks (all cpu's at once), for different amounts of time (optimizations, that is..).
I need to make it available for different users to somehow queue this tasks, so that only one at a time is executed.
Tasks are given by ssh (like "command >& logfile &").
I only need to queue this commands (from different users) so that the commands are executed one at a time.
I know commands like cron, at, and batch, but they does not satisfy my needs (or I don't know yet how to do it).
Any help is appreciated. Thank you.
 
Old 02-16-2011, 01:52 PM   #2
xeleema
Member
 
Registered: Aug 2005
Location: D.i.t.h.o, Texas
Distribution: Slackware 13.x, rhel3/5, Solaris 8-10(sparc), HP-UX 11.x (pa-risc)
Posts: 988
Blog Entries: 4

Rep: Reputation: 254Reputation: 254Reputation: 254
Greetingz and Welcome to LQ!

It sounds like SQS is something that could help you out.

However, if you're adamant about keeping things as close to "as-is" in your environment, then you might need to create a custom solution. Perhaps something like this;

Directory Structure
/path/to/jobs
If your users are sloppy, this should be on a filesystem separate from the important ones.
/path/to/jobs/old
Because keeping the old jobs might prove useful.
/path/to/jobs/new
Where as-of-yet un-run jobs go.
/path/to/jobs/running
Where currently running job(s) go.

Create a "batch_schedule.sh" script that does the following;
Take input file "batch_job.in" and copy it's contents to "/path/to/jobs/new/`seconds-since-the-epoch`.job".

Create a "batch_run.sh" script and have it called by cron every minute.
This script would check "/path/to/jobs/running", if empty (or if less-than-$MAX jobs running), it would move a job from "/path/to/jobs/new" and then start running that job.
If there was a *.job file in /path/to/jobs/running (or $MAX jobs currently running), then do nothing (maybe log that).

NOTE: I'm not sure how your users would adept to change, but if experience has taught me anything, it's that non-technical people loath learning a new process. So test it, document it, put that document on an Intranet website, then email a bookmark to everyone.
Oh, and only change things once a year or so.

EDIT: If you need something with more "oomph", take a look at TORQUE.

Last edited by xeleema; 02-16-2011 at 01:58 PM. Reason: My reason for doing it? Same reason I do anything.....Because it's cool.
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
High load and high cpu kernel usage enid Linux - Server 8 09-30-2010 03:33 AM
udevd high cpu load fancylad Slackware 2 06-01-2010 07:53 AM
nvidia and high cpu load Simon Bridge Linux - Hardware 5 06-06-2006 03:25 AM
High load - but CPU 99% idle? Boss Hoss Linux - Hardware 6 05-24-2004 04:39 AM
Why am I getting ?high? CPU load? pnh73 Linux - General 15 10-21-2003 10:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:28 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