<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>MultiChain Developer Q&amp;A - Recent questions tagged cpu</title>
<link>https://www.multichain.com/qa/tag/cpu</link>
<description>Powered by Question2Answer</description>
<item>
<title>How to find out CPU usage in the mining process?</title>
<link>https://www.multichain.com/qa/15842/how-to-find-out-cpu-usage-in-the-mining-process</link>
<description>Hello, i am now in a study/research about using multichain for IoT, and i need to know how to know the CPU usage ( maybe in percentage or anything) while mining process happened&lt;br /&gt;
&lt;br /&gt;
because IoT device have a limit in resource and my focus is the relation of changing the value of mining-diversity with the CPU usage and mining time&lt;br /&gt;
&lt;br /&gt;
Actually I have tried it using Python, by recording the usage of CPU using psutil library while always checking the confirmation field If the value is 0, it has not yet been mined (as explained in &lt;a href=&quot;https://www.multichain.com/qa/11525/how-do-transactions-work-in-a-data-stream&quot; rel=&quot;nofollow&quot;&gt;https://www.multichain.com/qa/11525/how-do-transactions-work-in-a-data-stream&lt;/a&gt;)&lt;br /&gt;
&lt;br /&gt;
so if the value isn't 0, then it has been mined and the recording process will stop.&lt;br /&gt;
&lt;br /&gt;
but i don't think that is the right way to do it, I would appreciate if there is a more appropriate way to do it&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
many thanks.</description>
<guid isPermaLink="true">https://www.multichain.com/qa/15842/how-to-find-out-cpu-usage-in-the-mining-process</guid>
<pubDate>Thu, 03 Oct 2019 04:17:56 +0000</pubDate>
</item>
<item>
<title>Node consuming 4-10% of CPU doing nothing?</title>
<link>https://www.multichain.com/qa/12526/node-consuming-4-10%25-of-cpu-doing-nothing</link>
<description>Hi&lt;br /&gt;
&lt;br /&gt;
I am using &amp;quot;MultiChain 1.0 Daemon (protocol 10008)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
I am running a multichain node on two servers that are identical in hardware and setup.&lt;br /&gt;
&lt;br /&gt;
On one server, multichaind consumes 4-10% of the CPU constantly. On the other it consumes 0.5-1% of CPU constantly.&lt;br /&gt;
&lt;br /&gt;
I enabled &amp;quot;-debug&amp;quot; on the server where multichaind consumes 4-10%. However, the debug log just contains an endless repetition of this:&lt;br /&gt;
&lt;br /&gt;
2019-01-23 08:26:34 received: pong (8 bytes) peer=1&lt;br /&gt;
2019-01-23 08:26:35 mcnet: received header: ping&lt;br /&gt;
2019-01-23 08:26:35 mcnet: complete message: ping, peer=1&lt;br /&gt;
2019-01-23 08:26:35 mchn: RECV: ping, peer=1&lt;br /&gt;
2019-01-23 08:26:35 received: ping (8 bytes) peer=1&lt;br /&gt;
2019-01-23 08:26:35 sending: pong mchn: SEND: pong&lt;br /&gt;
2019-01-23 08:26:35 (8 bytes) peer=1&lt;br /&gt;
2019-01-23 08:26:44 sending: ping mchn: SEND: ping&lt;br /&gt;
2019-01-23 08:26:44 (8 bytes) peer=1&lt;br /&gt;
2019-01-23 08:26:44 mcnet: received header: pong&lt;br /&gt;
2019-01-23 08:26:44 mcnet: complete message: pong, peer=1&lt;br /&gt;
2019-01-23 08:26:45 mchn: RECV: pong, peer=1&lt;br /&gt;
2019-01-23 08:26:45 received: pong (8 bytes) peer=1&lt;br /&gt;
2019-01-23 08:26:45 mcnet: received header: ping&lt;br /&gt;
2019-01-23 08:26:45 mcnet: complete message: ping, peer=1&lt;br /&gt;
2019-01-23 08:26:45 mchn: RECV: ping, peer=1&lt;br /&gt;
2019-01-23 08:26:45 received: ping (8 bytes) peer=1&lt;br /&gt;
2019-01-23 08:26:45 sending: pong mchn: SEND: pong&lt;br /&gt;
2019-01-23 08:26:45 (8 bytes) peer=1&lt;br /&gt;
2019-01-23 08:26:54 sending: ping mchn: SEND: ping&lt;br /&gt;
2019-01-23 08:26:54 (8 bytes) peer=1&lt;br /&gt;
2019-01-23 08:26:54 mcnet: received header: pong&lt;br /&gt;
2019-01-23 08:26:54 mcnet: complete message: pong, peer=1&lt;br /&gt;
2019-01-23 08:26:55 mchn: RECV: pong, peer=1&lt;br /&gt;
2019-01-23 08:26:55 received: pong (8 bytes) peer=1&lt;br /&gt;
2019-01-23 08:26:55 mcnet: received header: ping&lt;br /&gt;
2019-01-23 08:26:55 mcnet: complete message: ping, peer=1&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
There is basically zero application activity on the server (e.g. the blockchain is not really used for anything).&lt;br /&gt;
&lt;br /&gt;
So, what are those 4-10% of CPU doing?&lt;br /&gt;
&lt;br /&gt;
Top:&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;PID USER &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;PR &amp;nbsp;NI &amp;nbsp;&amp;nbsp;&amp;nbsp;VIRT &amp;nbsp;&amp;nbsp;&amp;nbsp;RES &amp;nbsp;&amp;nbsp;&amp;nbsp;SHR S %CPU %MEM &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;TIME+ COMMAND &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;
11356 multich+ &amp;nbsp;20 &amp;nbsp;&amp;nbsp;0 &amp;nbsp;701196 &amp;nbsp;40120 &amp;nbsp;11768 S &amp;nbsp;6.7 &amp;nbsp;2.0 &amp;nbsp;&amp;nbsp;0:47.55 multichaind</description>
<guid isPermaLink="true">https://www.multichain.com/qa/12526/node-consuming-4-10%25-of-cpu-doing-nothing</guid>
<pubDate>Wed, 23 Jan 2019 08:34:14 +0000</pubDate>
</item>
<item>
<title>High CPU usage when attempting to connect to unavailable nodes</title>
<link>https://www.multichain.com/qa/12097/high-cpu-usage-when-attempting-to-connect-unavailable-nodes</link>
<description>&lt;p&gt;I believe I have identified a bug with the peer reconnection code. I have a node that has done nothing for the last month. A month ago I generated a few blocks and connected to it from a couple other nodes, but then shut those other nodes down. The main node has been attempting to reconnect to those 2 nodes for the last month, and spinning more and more of the CPU as each day goes by until it's using about 25% of the instance's CPU now. I got an alert about low CPU credits this morning and found this to be the problem when I investigated.&lt;/p&gt;&lt;p&gt;When I run the node with `-debug` I see these lines repeated over and over again:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; net: Trying to connect to 123.123.123.123:6700&lt;br&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;net: trying connection 123.123.123.123:6700 lastseen=627.1hrs&lt;br&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;net: connect() to 123.123.123.123:6700 failed after select(): Connection refused (111)&lt;br&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;net: Connection not established&lt;br&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;net: Trying to connect to 192.168.1.49:6700&lt;br&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;net: trying connection 192.168.1.49:6700 lastseen=627.1hrs&lt;br&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;net: connection to 192.168.1.49:6700 timeout&lt;br&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;net: Connection not established&lt;/p&gt;&lt;p&gt;If I start the node in either `-offline` mode, or if I delete the `peers.dat` file before starting, it does not exhibit this behavior, and sits at 0% CPU like I expect for a node that only has 50 blocks, is not mining and has no actual peers.&lt;/p&gt;&lt;p&gt;This is with versions 2.0a5, 2.0a6, 2.0a7 and 2.0b1.&lt;/p&gt;&lt;p&gt;I also tested copying the .multichain directory to another instance on a newer version of Ubuntu (bionic instead of xenial), and a non-vm computer, and I get the same behavior.&lt;/p&gt;&lt;p&gt;This is a graph showing how it has escalated over the last month.&lt;/p&gt;&lt;p&gt;&lt;img alt=&quot;&quot; src=&quot;https://i.imgur.com/HwLLJOX.png&quot; style=&quot;height:303px; width:1105px&quot;&gt;&lt;/p&gt;&lt;p&gt;How long will it wait before it stops trying to connect to these dead nodes? And why is there no way to view what is in the peers.dat file, and to clean them up? I've searched around and not found any definitive answers to how this system works. (or is supposed to work.)&lt;/p&gt;&lt;p&gt;Thanks!&lt;/p&gt;&lt;p&gt;Nate&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<guid isPermaLink="true">https://www.multichain.com/qa/12097/high-cpu-usage-when-attempting-to-connect-unavailable-nodes</guid>
<pubDate>Wed, 26 Dec 2018 22:21:43 +0000</pubDate>
</item>
<item>
<title>Multichain CPU usage for high send-rates</title>
<link>https://www.multichain.com/qa/8729/multichain-cpu-usage-for-high-send-rates</link>
<description>&lt;p&gt;This is follow up of a previous thread regarding dropped connections, that was getting lengthy, so starting a new thread with some concrete observations this time. (&amp;nbsp;&lt;a href=&quot;https://www.multichain.com/qa/7815/multichain-benchmarking-with-nodejs-wrapper&quot; rel=&quot;nofollow&quot;&gt;https://www.multichain.com/qa/7815/multichain-benchmarking-with-nodejs-wrapper&lt;/a&gt; )&lt;/p&gt;&lt;p&gt;As mentioned previously, I said I was getting two errors predominantly, ETIMEDOUT and ECONNRESET.&lt;/p&gt;&lt;p&gt;For ETIMEDOUT, it turned out that the client itself was dropping requests, so they never reached the peer and the error callback fired. So I'm guessing a single node process cant handle send rates above 500tps, and this is clearly a client problem.&lt;/p&gt;&lt;p&gt;Now, I used to get ECONNRESET only if I send a much higher send rates. So now, I chose two clients, with send rates that both can handle (to avoid ECONNTIMEDOUT problems), and now I started getting ECONNRESET. I did a tcpdump to check again if requests are there, and they were present both on client and peer machines, so no problems there. --debug=mcapi doesnt show this though, so somewhere after receiving the request, its dropped either by Multichain or the OS (but tcpdump shows the request so I'm guessing its the former). But this definitely rules out any client side issues for this error.&lt;/p&gt;&lt;p&gt;You guys had initially pointed out (in the previous thread) that it could be that CPU is being used beyond its capability, so I ran htop and took some screenshots to log the CPU usage. And unsurprisingly, the reset problems were happening for high usage, particularly when one of the cores hit 60%+, and generally the process usage was 100%+&lt;/p&gt;&lt;p&gt;Some Screenshots of peer CPU -&amp;nbsp;&lt;a href=&quot;https://imgur.com/a/R1zC0&quot; rel=&quot;nofollow&quot;&gt;https://imgur.com/a/R1zC0&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Is this kind of CPU usage normal? And only way to be able to handle is a better system if all parameters are kept the same?&lt;/p&gt;&lt;p&gt;Multichain version v1.0.2&lt;/p&gt;&lt;p&gt;Command: &lt;em&gt;multichaind $CHAINNAME -debug=mcapi -printtoconsole -autosubscribe=streams -blocknotify=&quot;script.sh %s&quot;&lt;/em&gt;&lt;br&gt;&lt;br&gt;Blockchain params are default except target-block-time is set to 2 seconds&lt;/p&gt;&lt;p&gt;CPU is&amp;nbsp;Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz (4 cores with Hyperthreading x2)&lt;/p&gt;&lt;p&gt;RAM: 16GB&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
<guid isPermaLink="true">https://www.multichain.com/qa/8729/multichain-cpu-usage-for-high-send-rates</guid>
<pubDate>Wed, 28 Feb 2018 06:35:05 +0000</pubDate>
</item>
<item>
<title>amd cpu</title>
<link>https://www.multichain.com/qa/2742/amd-cpu</link>
<description>i have amd cpu on my node. i need a intel architecture?</description>
<guid isPermaLink="true">https://www.multichain.com/qa/2742/amd-cpu</guid>
<pubDate>Wed, 21 Sep 2016 19:00:14 +0000</pubDate>
</item>
<item>
<title>High CPU usage</title>
<link>https://www.multichain.com/qa/2680/high-cpu-usage</link>
<description>Hey,&lt;br /&gt;
&lt;br /&gt;
I'm working on a blockchain project which requires me to create a prototype.&lt;br /&gt;
&lt;br /&gt;
Now I'm running 2 MultiChain nodes (master and explorer) and basically I'm using only master to interact with the application.&lt;br /&gt;
&lt;br /&gt;
On master node i have almost 2000 wallets (getnewaddress) and I'm able to control balances betwen thoses wallets as well as send coins between them.&lt;br /&gt;
&lt;br /&gt;
On this scenario, I could note that master node is consuming extremelly high CPU usage.(around 85%)&lt;br /&gt;
&lt;br /&gt;
Is it possoble to known the limitation and required spec to handle a cases wich expect to have 3000 users interating with the system?</description>
<guid isPermaLink="true">https://www.multichain.com/qa/2680/high-cpu-usage</guid>
<pubDate>Thu, 15 Sep 2016 22:29:23 +0000</pubDate>
</item>
<item>
<title>CPU usage</title>
<link>https://www.multichain.com/qa/1108/cpu-usage</link>
<description>&lt;p&gt;Analyzing the CPU usage, we noticed that just one of the CPU cores is predominantly used while assets are being inserted in node, and others are running on &amp;lt;10%. Is it possible to make some optimizations, to make insertion asynchronous so more cores would be utilised fully and performance enhanced? I attached&amp;nbsp;screenshot of a typical moment in time:&amp;nbsp;&lt;a rel=&quot;nofollow&quot; href=&quot;http://imgur.com/JjT6HBs&quot;&gt;http://imgur.com/JjT6HBs&lt;/a&gt;.&lt;/p&gt;</description>
<guid isPermaLink="true">https://www.multichain.com/qa/1108/cpu-usage</guid>
<pubDate>Thu, 10 Mar 2016 14:19:56 +0000</pubDate>
</item>
</channel>
</rss>