add threading.Lock for cherrypy, or performance suffer.