Kind of knapsack problem


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Kind of knapsack problem
# 1  
Old 11-07-2007
Kind of knapsack problem

I need to run as many (thousands) very small cron jobs within a duration of 5 minutes and repeatedly through out the day. This kind of requirement would be up against system resources and limitations such as nproc, maxuprc, numbers of cron jobs allowed in crontab, RSS, SWAP, CPU and others that I don't know. The problem is typical knapsack problem, maximize number of jobs within constrains.

1. A typical cron job is to monitor responsiveness of a webpage. A simplified one-liner would be: time -p wget http://domain.com where domain.com is varied.

2. I have root access

3. At the other thread I read the below script, what is the purpose of the wait command? Can I use the above one-liner as a job in this example?
Quote:
#! /usr/bin/ksh
job1 &
job2 &
job3 &
wait
exit 0
4. In general, what do I have to do? What strategy?

Thanks in advance, your advise appreciated.
# 2  
Old 11-07-2007
The processes job1, job2 and job3 are all run in the background (thanks to the "&").

The "wait" command still stop until all previously spawned background processes are finished.
# 3  
Old 11-07-2007
What happened if the wait wasn't there?
# 4  
Old 11-08-2007
I found an answer for the wait question here: Zombie process - Wikipedia, the free encyclopedia
Anyway, any suggestion for my knapsack problem?
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Linux

Kind of reverse engineering

Hi everyone, I'm a linux novice , in a training purpose i have to reconstruct under windows an application running under fedora 14, the application communicates with an STB device through RS232 in a first time and then through ethernet for firmware loading purpose. All what i know is how to run... (2 Replies)
Discussion started by: nidal
2 Replies

2. Cybersecurity

What kind of hacking is going on here??

Connecting to the Internet with OpenVPN, the connection fails. Rerunning openvpn works second time round but the install is hacked at that point (e.g., a rogue 'java-security' update tries to install itself on 'yum update', yum however spots this and rejects the download, other basic things start... (3 Replies)
Discussion started by: GSO
3 Replies

3. Programming

A different kind of counting in SQL

I am looking to do a count on a database table where some of the elements count double. Say the data is as follows: id value 1 X 2 Y 3 X 4 X 5 Y A regular count (SELECT value, COUNT(*) FROM data GROUP BY value) would yield: X 3 Y 2 However, Y happens to count double so the answer should... (2 Replies)
Discussion started by: figaro
2 Replies

4. Infrastructure Monitoring

sed help,,kind of urgent!!

Hello All, My problem is: I want to replace a line from a file with sed. The first word in that line is always the same in every server. The second line is server model, which of course will vary from platform to platform and I need to leave that word as it is. After the second word, I need to... (3 Replies)
Discussion started by: solaix14
3 Replies

5. Solaris

How to check the kind of file

Hi all, I'm working on Solaris 10 and I have to install some packets in which there are files of different kind. In this situation I need to know a command of UNIX/Solaris to check the kind of file. For example how can I know if the file has ISO or ASCII or BER or HEX format? Thank you... (4 Replies)
Discussion started by: Sunb3
4 Replies

6. UNIX for Dummies Questions & Answers

What kind of Linux for the newbies?

I am one of the newbies. I want to load linux on my notebook, however, i am not sure which linux is the most recommend for the newbies. Could you please advise? Thanks you very much for any advise you may give me. Best Regards, SANLEN (2 Replies)
Discussion started by: sanlen
2 Replies

7. UNIX for Dummies Questions & Answers

Kind of weird question

I recently purchased a book titled Hacking: The Art of Exploitation. When I got it home I read the preface and found out that i shouldnt have bought it. It says the code examples in this book were done on an x86 based computer (I have a mac). Is there anything I can do to make my mac run similar to... (2 Replies)
Discussion started by: Cyberaxe
2 Replies

8. UNIX for Dummies Questions & Answers

what kind of UNIX

ok, so i want to figure out what type of UNIX i have and in this book im reading about it, it says that i can figure out what type i have by typing the command uname in the prompt. So i did this and it came up saying Darwin?? is that part of System V UNIX or BSD or do i have LINUX? if anyone can... (2 Replies)
Discussion started by: hiei
2 Replies
Login or Register to Ask a Question