mirror of
https://github.com/xcat2/confluent.git
synced 2025-02-14 09:39:51 +00:00
Automatically increase limits
Knowing ahead of time that confluent is the sort of app that, despite best efforts, is filehandle heavy, auto-attempt to raise soft to be equal to hard limit. A sufficiently large cluster (i.e. more than 2000 nodes) would still need to have limit adjusted at system level for now.
This commit is contained in:
parent
16c7429900
commit
96670784f9
@ -164,7 +164,19 @@ def _initsecurity(config):
|
||||
configmanager.ConfigManager.wait_for_sync()
|
||||
|
||||
|
||||
def setlimits():
|
||||
try:
|
||||
import resource
|
||||
currlimit = resource.getrlimit(resource.RLIMIT_NOFILE)
|
||||
if currlimit[0] < currlimit[1]:
|
||||
resource.setrlimit(
|
||||
resource.RLIMIT_NOFILE, (currlimit[1], currlimit[1]))
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
|
||||
def run():
|
||||
setlimits()
|
||||
signal.signal(signal.SIGUSR1, dumptrace)
|
||||
if havefcntl:
|
||||
_checkpidfile()
|
||||
|
Loading…
x
Reference in New Issue
Block a user