title: redis memory and cpu spikes
body: <p>We use redis for some data in our app, and it's totally great. I noticed however occasional cpu and memory spikes on the <code>redis-server</code> process.</p>
  
  <p><img src="https://i.stack.imgur.com/BNMky.png" alt="Process and memory monitoring on our Giraffe dashboard"></p>
  
  <p>This is the <a href="http://giraffe.kenhub.com/" rel="noreferrer">Giraffe dashboard</a> from both our production and staging environments. Staging is obviously much less busy, but production isn't terribly busy either normally...</p>
  
  <p>This seems to correlate with the background saving, but not with all of them. Only a handful of those create this spike. Perhaps all do, and it's only down to the measurement resolution though (some are simply not caught within our memory/cpu monitoring cycle). I'm not entirely sure.</p>
  
  <p>I'm still wondering whether this is expected / normal. We don't observe any issues, but I want to be on the safe side. If we have more traffic/activity on our production, are we likely to see many more spikes like these?</p>
  
  <p><strong>UPDATE</strong>: </p>
  
  <p>redis log file around the time of the spike</p>
  
  <pre><code>[18588] 05 May 11:42:51.004 * 10 changes in 300 seconds. Saving...
  [18588] 05 May 11:42:51.258 * Background saving started by pid 32712
  [32712] 05 May 11:43:00.511 * DB saved on disk
  [32712] 05 May 11:43:00.549 * RDB: 1 MB of memory used by copy-on-write
  [18588] 05 May 11:43:00.629 * Background saving terminated with success
  </code></pre>