def serve(path=None, port=8080):
    """Serve the web app with profiler activated."""
    if profile is None or pstats is None:
        msg = (
            'Your installation of Python does not have a profile module. '
            "If you're on Debian, try "
            '`sudo apt-get install python-profiler`. '
            'See http://www.cherrypy.org/wiki/ProfilingOnDebian '
            'for details.'
        )
        warnings.warn(msg)

    cherrypy.config.update(
        {
            'server.socket_port': int(port),
            'server.thread_pool': 10,
            'environment': 'production',
        },
    )
    cherrypy.quickstart(Profiler(path))
Serve the web app with profiler activated.
cherrypy/lib/profiler.py