2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 <2019> 2020 2021 2022 2023 2024 2025 | Index | 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 <2019> 2020 2021 2022 2023 2024 2025 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Re: Excessive scan times for periodic scans |
From: | "Johnson, Andrew N. via Core-talk" <[email protected]> |
To: | "Konrad, Martin" <[email protected]>, EPICS Core Talk <[email protected]> |
Date: | Wed, 3 Apr 2019 19:10:51 +0000 |
Hi Martin, On 4/3/19 11:58 AM, Konrad, Martin via Core-talk wrote:
How heavily loaded are the callback threads cb{Low,Medium,High}?dbScan warning from '1 second' scan thread: Scan processing averages 1.405 seconds (1.028 .. 2.559). Over-runs have now happened 10 times in a row. To fix this, move some records to a slower scan rate. The IOC is talking to 132 devices using StreamDevice. "scanppl" reports 11408 records on the '1 second' scan list. The VM hosting the IOC is running happily with 20-30% CPU load on each of its 8 cores. "top -H" reports 10-15% for the "scan-1" thread. Do you have chains of records that are linked together?Naively, I would expect the "scan-1" thread to use 100% of one core (at least most of the time) when the warning above gets printed. However, the records in question are being scanned asynchronously which might put part of the burden on other threads. Nevertheless it's unclear to me why the "scan-1" thread can't keep up and if there is anything I can do to improve performance. What other resources do your devices share that might limit how fast the IOC can communicate with them? How long does it take to "talk" to each device? Multiple callback threads was certainly added, and I suspect it might help your situation because the second-half asynchronous processing is probably happening there. For example:I'm also wondering if the work of scanning can be spread out over multiple threads as suggested by Ralph in [1] - it's unclear to me if this ever got implemented. tux% bin/linux-x86_64/softIoc Note there are two cbLow and cbHigh threads above but only one cbMedium because I didn't ask for two there. You can set the default number of threads used for all priorities at once by omitting the second argument to the callbackParallelThreads command. We have not tried to implement parallel periodic scan threads yet, IIRC we suspected there would be more likely to be issues with synchronization or deadlocks in those cases which could affect device or driver support. That's also why we default to having a single callback thread, but allow you to add more in your startup script. HTH, - Andrew -- Arguing for surveillance because you have nothing to hide is no different than making the claim, "I don't care about freedom of speech because I have nothing to say." -- Edward Snowdon |