Move fixLimits function to util
This commit is contained in:
+8
-1
@@ -2,6 +2,7 @@
|
||||
'''Utility functions for Mininet.'''
|
||||
|
||||
from time import sleep
|
||||
from resource import setrlimit, RLIMIT_NPROC, RLIMIT_NOFILE
|
||||
import select
|
||||
from subprocess import call, check_call, Popen, PIPE, STDOUT
|
||||
|
||||
@@ -166,4 +167,10 @@ def createLink(node1, node2):
|
||||
retry(3, MOVEINTF_DELAY, moveIntf, intf2, node2)
|
||||
node1.connection[intf1] = (node2, intf2)
|
||||
node2.connection[intf2] = (node1, intf1)
|
||||
return intf1, intf2
|
||||
return intf1, intf2
|
||||
|
||||
|
||||
def fixLimits():
|
||||
'''Fix ridiculously small resource limits.'''
|
||||
setrlimit( RLIMIT_NPROC, (4096, 8192))
|
||||
setrlimit( RLIMIT_NOFILE, (16384, 32768))
|
||||
Reference in New Issue
Block a user