You're on linux so bring up 'top' while it's happening, press H to enable thread mode, and see what thread(s) is/are consuming CPU at the time. The bitcoin daemon has lots of threads that are named so you may be able to track which particular thread is consuming CPU and hence figure out what it's doing.
Right, okay. I can give that a shot. So nobody else has experienced similar CPU spikes?
Yeah, not that long though. Turned out my node was connected to a service that was pushing several thousand transactions to it every X minutes. If you have a network spike (from a few kbit/s to several mbit/s) at the same times that might be it.
A redditer was complaining about high node CPU usage a year ago. He identified a high number of connections correlating with high CPU usage, and speculated it might be due to suboptimally configured nodes pushing dust and spam transactions. His error log was full of nonstandard transaction/dust errors.
UdevNull's node's error log might contain the same errors if he's experiencing the same problem.
https://www.reddit.com/r/Bitcoin/comments/3xp22r/fully_synced_bitcoin_core_is_using_50_cpu_is/cy6l0oi/
I'm running bitcoind on several different servers, some of them are reachable via a public IP, other aren't.
With public IP:
version v0.11.0, minrelaytxfee=0.00004
CPU fluctuates between 20% and 50%
113 connections
37135 transactions in mempool, 463 MB total
I see a lot of ERROR messages in debug.log
.
2015-12-21 13:51:16 ERROR: AcceptToMemoryPool: free transaction rejected by rate limiter
2015-12-21 13:51:16 ERROR: AcceptToMemoryPool: nonstandard transaction: dust
Without public IP:
version v0.11.1, no config tweaks
CPU usage often stays in 0-2% range,
9 connections
35766 transactions in mempool, 428 MB
very few ERROR messages in debug.log
So it looks like CPU usage correlates with the number of connections. I'm not sure if there is any specific cause (possible causes: old/misconfigured nodes pushing dust & spam transactions; thin clients catching up with the blockchain using bloom queries), or just the sheer number of connections.
You can restrict the number of connection with maxconnections config parameter.