chkconfig --level 3 irqbalance off
#!/usr/bin/env python
import socket
import fcntl
import struct
import array
import platform
import os
import sys
BYTES = 4096
buf = 4096
def get_cpu_core_num():
try:
import multiprocessing
return multiprocessing.cpu_count()
except (ImportError, NotImplementedError):
pass
res = open('/proc/cpuinfo').read().count('processort:')
if res > 0:
return res
return 0
def get_iface_list():
arch = platform.architecture()[0]
var1 = -1
var2 = -1
if arch == '32bit':
var1 = 32
var2 = 32
elif arch == '64bit':
var1 = 16
var2 = 40
else:
raise OSError("Unknown architecture: %sn" % arch)
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
names = array.array('B', '