Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!us.feeder.erje.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.020 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'hosts': 0.07; 'advice.': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'python': 0.11; 'thread': 0.14; 'ah,': 0.16; 'bound,': 0.16; 'finishes': 0.16; 'message-id:@4ax.com': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'worst': 0.16; 'creating': 0.23; 'url:home': 0.24; 'second': 0.26; 'header:X-Complaints-To:1': 0.27; "i'm": 0.30; 'apparently': 0.31; 'clock': 0.31; 'overhead': 0.31; 'second,': 0.31; 'use?': 0.31; 'probably': 0.32; 'maintaining': 0.32; 'plain': 0.33; 'maybe': 0.34; 'could': 0.34; 'connection': 0.35; 'created': 0.35; 'transaction': 0.35; 'there': 0.35; 'entry': 0.36; 'charset:us-ascii': 0.36; 'should': 0.36; 'implement': 0.38; 'desirable': 0.38; 'nov': 0.38; 'to:addr :python-list': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'how': 0.40; 'full': 0.61; "you're": 0.61; 'making': 0.63; 'analysis': 0.75; '100': 0.79; 'polling': 0.84; 'yet?': 0.84; 'time)': 0.91; 'received:108': 0.93 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dennis Lee Bieber Subject: Re: Recurring Task Date: Sun, 23 Nov 2014 13:35:19 -0500 Organization: IISS Elusive Unicorn References: <4a496b58-867f-43ae-b6f9-48f4d885b170@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: adsl-108-79-223-115.dsl.klmzmi.sbcglobal.net X-Newsreader: Forte Agent 6.00/32.1186 X-No-Archive: YES X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 27 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1416767724 news.xs4all.nl 2955 [2001:888:2000:d::a6]:58788 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:81398 On Sun, 23 Nov 2014 07:23:43 -0800 (PST), tim@timothyarnold.co.uk declaimed the following: >Hi All >Looking for some advice. I'm creating a small netwok poller and wondered what people recommend to use? Will be polling up to 100 hosts every ten reconds or so > That's only 10 per second -- presuming scattered access is allowed... How much overhead is there in making the connection and transferring the data? That is -- what is your worst case transaction time (account for failure to connect time-outs). Since you're likely I/O bound, plain Python threads are probably usable. You worst case analysis should indicate how many threads are desirable (if 9 of the 10 per second take the full second, you likely want 10 and maybe a few extra threads). Trickiest part would be maintaining the time-ordered queue (has Python created a priority queue yet? -- Ah, apparently it has -- so one could use the desired clock value for the priority, and when the thread finishes it requeues incrementing the clock value by the rescan interval... -- you'd need to implement a sleep_until if the thread grabs an entry before its time) -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/