LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-23-2012, 11:48 AM   #1
kdelover
Member
 
Registered: Aug 2009
Posts: 311

Rep: Reputation: 36
Programming suggestion - multiprocessing


This is more like a programming assignment -- I'd like to write a script in perl using Forking,well the task of the script is to poll 150-200 different hosts every 5 mins and get some stats from them.

Since the polling is to happen every 5mins,would it be a good practice to have 150-200 process spawn every 5 mins,connect to the servers & get the info and die out ?Or would it better to have a pre-fork ( may be 5 threads ? )sort of a implementation where each pre-fork thread will spawn may be 30-40 individual processes ?

What would be best way in dealing with this case?

Thanks
 
Old 08-23-2012, 12:55 PM   #2
byannoni
Member
 
Registered: Aug 2012
Location: /home/byannoni
Distribution: Arch
Posts: 128

Rep: Reputation: 36
Spawning 200 processes doesn't sound like a good idea. I would create a few threads that each poll a small range of hosts.
 
Old 08-23-2012, 09:46 PM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.10, Centos 7.5
Posts: 17,568

Rep: Reputation: 2426Reputation: 2426Reputation: 2426Reputation: 2426Reputation: 2426Reputation: 2426Reputation: 2426Reputation: 2426Reputation: 2426Reputation: 2426Reputation: 2426
Sounds like a typical job for Nagios http://www.nagios.org/ to me; that's pretty much what it does.

If you really want to do it by hand, consider http://search.cpan.org/~twilde/Paral.../BossWorker.pm or http://search.cpan.org/~jvannucci/Pa...WorkerAsync.pm
 
Old 08-24-2012, 10:19 AM   #4
kdelover
Member
 
Registered: Aug 2009
Posts: 311

Original Poster
Rep: Reputation: 36
Yes i can use nagios,but this more or less an assignment sort of a thing .How does a combination of forks and threads work out in this case ?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Suggestion about which programming language to use. [Text Processing] adam_blackice Programming 9 06-27-2011 02:11 AM
Video Processing and Programming in Linux..Please Help me..any suggestion are welcome andrapgm03 Programming 5 01-12-2011 02:58 PM
Some good books for Linux programming. Suggestion ? the_cpp Programming 2 12-25-2008 04:55 AM
Programming suggestion DirkDiggler Programming 14 06-20-2007 09:17 AM
multiprocessing in suse sxbah Linux - Hardware 3 03-29-2003 12:11 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:24 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration