forked from tabo/cherrypy-dynpool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
32 lines (23 loc) · 771 Bytes
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
cherrypy-dynpool
================
A dynamic threadpool tool for CherryPy 3.x
(A backport from CherryPy 4)
Usage::
from cherrypy_dynpool import ThreadPoolMonitor
...
cherrypy.engine.threadpool_monitor = ThreadPoolMonitor(cherrypy.engine)
cherrypy.engine.threadpool_monitor.subscribe()
cherrypy.config.update({
'server.thread_pool': 5,
'server.thread_pool_max': -1,
'server.thread_pool_minspare': 5,
'server.thread_pool_maxspare': 15,
'server.thread_pool_frequency': 2,
'server.thread_pool_shrink_frequency': 5,
})
...
cherrypy.engine.start()
cherrypy.engine.threadpool_monitor.configure(
thread_pool=cherrypy.server.httpserver.requests,
logger=cherrypy.log
)