def get_limit_conn_shared_memory():
 import psutil
 total_vm = (psutil.virtual_memory().total / (1024 * 1024))
 return int((0.02 * total_vm))

def get_limit_conn_shared_memory ( ) : import psutil total_vm = ( psutil . virtual_memory ( ) . total / ( 1024 * 1024 ) ) return int ( ( 0.02 * total_vm ) )
allocate 2 percent of total virtual memory as shared memory for nginx limit_conn_zone .