CherryPy 在单核 Raspberry Pi 第一代空闲时消耗大约 15-20% 的 CPU,即根本没有处理任何请求。为了减少这种情况,我尝试了各种配置调整,但无济于事。我怎样才能减少这种情况?
>>> import cherrypy
>>> cherrypy.quickstart()
[29/Apr/2021:14:14:22] ENGINE Listening for SIGTERM.
[29/Apr/2021:14:14:22] ENGINE Listening for SIGHUP.
[29/Apr/2021:14:14:22] ENGINE Listening for SIGUSR1.
[29/Apr/2021:14:14:22] ENGINE Bus STARTING
[29/Apr/2021:14:14:22] ENGINE Started monitor thread 'Autoreloader'.
[29/Apr/2021:14:14:23] ENGINE Serving on http://127.0.0.1
[29/Apr/2021:14:14:23] ENGINE Bus STARTED
top
输出:
Tasks: 85 total, 1 running, 84 sleeping, 0 stopped, 0 zombie
%Cpu(s): 23.9 us, 8.9 sy, 0.0 ni, 66.6 id, 0.0 wa, 0.0 hi, 0.7 si, 0.0 st
MiB Mem : 430.1 total, 152.9 free, 76.2 used, 201.0 buff/cache
MiB Swap: 100.0 total, 100.0 free, 0.0 used. 297.3 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
10674 root 20 0 131484 21240 8188 S 18.5 4.8 0:45.63 python3