title: python web server and periodic tasks
body: <p>I am using CherryPy to receive requests through REST API. Apart from handling requests the application should also do some resource management every few seconds. What is the easiest way to do this?</p>
  
  <p>1) run a separate thread</p>
  
  <p>2) cherrypy.process.plugins.PerpetualTimer (not sure how to use it, and it looks like it is heavy on resources?)</p>
  
  <p>3) some other way?</p>
  
  <p>The solution with a separate thread is fine by me, but I was wondering if there is a nicer way to do it?</p>
  
  <p>Note that CherryPy is not a requirement - I have decided to use it primarily because the project looks alive and because it supports multiple simultaneous connections (in other words: I am open to alternatives).</p>