123456789101112131415161718192021222324252627 |
- import psutil
- logical_cpu = psutil.cpu_count()
- physical_cpu = psutil.cpu_count(logical=False)
- mem = psutil.virtual_memory()
- total_mem = mem.total
- worker = 1 + (physical_cpu * 2)
- limit_memory_soft = 640 * worker
- hard_memory_soft = 768 * worker
- shared_buffer = 0
- if mem < pow(1024, 3):
- shared_buffer = total_mem / 4;
- else:
- shared_buffer = total_mem * 0.15
- print '----------------------------------------Results-------------------------------------------'
- print 'Logical CPU ---> %s' % logical_cpu
- print 'Physical CPU ---> %s' % physical_cpu
- print 'Total Memory ---> %.2f bytes - %.2f kb - %.2f mb - %.2f gb' % (total_mem, total_mem / 1024, total_mem / pow(1024, 2), total_mem / pow(1024, 3))
- print '------------------------------------------------------------------------------------------'
- print 'Odoo Workers ---> %s' % worker
- print 'Odoo Limit Memory Soft ---> %.2f mb' % limit_memory_soft
- print 'Odoo Hard Memory Soft ---> %.2f mb' % hard_memory_soft
- print 'Postgres Shared Buffer ---> %.2f bytes - %.2f kb - %.2f mb - %.2f gb' % (shared_buffer, shared_buffer / 1024, shared_buffer / pow(1024, 2), shared_buffer / pow(1024, 3))
- print '------------------------------------------------------------------------------------------'
|