Python 使用多个辅助进程时,Odoo/OpenERP中的高怠速负载
我想与大家分享我们对Odoo V9 ERP系统的性能分析结果 问题/症状 当在odoo中运行多个工作进程时,odoo在没有任何请求的情况下连续消耗1个cpu,因此我们有一个解决方案的平均系统负载 只需安装psycogreen模块即可Python 使用多个辅助进程时,Odoo/OpenERP中的高怠速负载,python,performance,multiprocessing,odoo,strace,Python,Performance,Multiprocessing,Odoo,Strace,我想与大家分享我们对Odoo V9 ERP系统的性能分析结果 问题/症状 当在odoo中运行多个工作进程时,odoo在没有任何请求的情况下连续消耗1个cpu,因此我们有一个解决方案的平均系统负载 只需安装psycogreen模块即可 我希望它能对其他Odoo用户有所帮助如果您有解决方案,您应该发布此“”,这意味着您的问题实际上需要添加一个答案您是对的。我添加了答案。当然,谢谢你的贡献,+1(可能还会显示如何安装psycogreen模块或添加链接…)它的确切功能!请分享更多细节。在奥多的上下文中。
我希望它能对其他Odoo用户有所帮助如果您有解决方案,您应该发布此“”,这意味着您的问题实际上需要添加一个答案您是对的。我添加了答案。当然,谢谢你的贡献,+1(可能还会显示如何安装psycogreen模块或添加链接…)它的确切功能!请分享更多细节。在奥多的上下文中。
top - 12:13:54 up 1 day, 35 min, 3 users, load average: 0.92, 0.82, 0.79
Tasks: 149 total, 3 running, 146 sleeping, 0 stopped, 0 zombie
%Cpu0 : 0.0 us, 3.7 sy, 0.0 ni, 96.3 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu1 : 63.0 us, 20.4 sy, 0.0 ni, 16.7 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu2 : 5.6 us, 0.0 sy, 0.0 ni, 94.4 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
%Cpu3 : 5.6 us, 7.4 sy, 0.0 ni, 85.2 id, 0.0 wa, 0.0 hi, 0.0 si, 1.9 st
KiB Mem: 4047120 total, 1660760 used, 2386360 free, 159696 buffers
KiB Swap: 4194300 total, 0 used, 4194300 free. 1040260 cached Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
12345 odoo 20 0 226576 59732 13184 S 9.3 1.5 0:50.94 odoo.py
ps -eo pcpu,pid,user,args | sort -b -k1,1n
0.3 12345 odoo /usr/bin/python /usr/bin/openerp-gevent --config /etc/odoo/openerp-server.conf --logfile /var/log/odoo/odoo-server.log
strace -o 12345.log -vtffp 12345
12:13:54 stat("/usr/lib/pymodules/python2.7/psycogreen", 0x7fffcf562920) = -1 ENOENT (No such file or directory)
12:13:54 open("/usr/lib/pymodules/python2.7/psycogreen.x86_64-linux-gnu.so", O_RDONLY) = -1 ENOENT (No such file or directory)
12:13:54 open("/usr/lib/pymodules/python2.7/psycogreen.so", O_RDONLY) = -1 ENOENT (No such file or directory)
12:13:54 open("/usr/lib/pymodules/python2.7/psycogreenmodule.so", O_RDONLY) = -1 ENOENT (No such file or directory)
12:13:54 open("/usr/lib/pymodules/python2.7/psycogreen.py", O_RDONLY) = -1 ENOENT (No such file or directory)
12:13:54 open("/usr/lib/pymodules/python2.7/psycogreen.pyc", O_RDONLY) = -1 ENOENT (No such file or directory)
12:13:54 write(2, "Traceback (most recent call last"..., 35) = 35
12:13:54 write(2, " File \"/usr/bin/openerp-gevent\""..., 54) = 54
12:13:54 open("/usr/bin/openerp-gevent", O_RDONLY) = 4
12:13:54 fstat(4, {st_dev=makedev(252, 0), st_ino=1062415, st_mode=S_IFREG|0755, st_nlink=1, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=8, st_size=196, st_atime=2016/03/09-16:12:19, st_mtime=2016/02/19-13:13:35, st_ctime=2016/03/09-16:10:52}) = 0
12:13:54 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f02133e1000
12:13:54 read(4, "#!/usr/bin/env python\n\nimport ge"..., 4096) = 196
12:13:54 write(2, " ", 4) = 4
12:13:54 write(2, "import psycogreen.gevent\n", 25) = 25
12:13:54 close(4) = 0
12:13:54 munmap(0x7f02133e1000, 4096) = 0
12:13:54 write(2, "ImportError", 11) = 11
12:13:54 write(2, ": ", 2) = 2
12:13:54 write(2, "No module named psycogreen.geven"..., 33) = 33
12:13:54 write(2, "\n", 1) = 1
12:13:54 rt_sigaction(SIGINT, {SIG_DFL, [], SA_RESTORER, 0x7f0212fb4340}, {0x45a0f5, [], SA_RESTORER, 0x7f0212fb4340}, 8) = 0
12:13:54 exit_group(1) = ?
12:13:54 +++ exited with 1 +++
apt-get install python-pip
pip install psycogreen