Provide flag for setting redis maxclients. (#1257)

* Add flag for attempting to increase ulimit -n and the redis maxclients.

* Don't bother trying to set ulimit -n.

* Fix linting.

* Add basic test.
This commit is contained in:
Robert Nishihara
2017-11-26 18:25:55 -08:00
committed by Philipp Moritz
parent 7fc2ddbaf7
commit 0b4961b161
4 changed files with 50 additions and 6 deletions
+11 -1
View File
@@ -1165,6 +1165,7 @@ def _init(address_info=None,
num_gpus=None,
num_custom_resource=None,
num_redis_shards=None,
redis_max_clients=None,
plasma_directory=None,
huge_pages=False):
"""Helper method to connect to an existing Ray cluster or start a new one.
@@ -1210,6 +1211,8 @@ def _init(address_info=None,
with.
num_redis_shards: The number of Redis shards to start in addition to
the primary Redis shard.
redis_max_clients: If provided, attempt to configure Redis with this
maxclients number.
plasma_directory: A directory where the Plasma memory mapped files will
be created.
huge_pages: Boolean flag indicating whether to start the Object
@@ -1273,6 +1276,7 @@ def _init(address_info=None,
num_gpus=num_gpus,
num_custom_resource=num_custom_resource,
num_redis_shards=num_redis_shards,
redis_max_clients=redis_max_clients,
plasma_directory=plasma_directory,
huge_pages=huge_pages)
else:
@@ -1293,6 +1297,9 @@ def _init(address_info=None,
if num_redis_shards is not None:
raise Exception("When connecting to an existing cluster, "
"num_redis_shards must not be provided.")
if redis_max_clients is not None:
raise Exception("When connecting to an existing cluster, "
"redis_max_clients must not be provided.")
if object_store_memory is not None:
raise Exception("When connecting to an existing cluster, "
"object_store_memory must not be provided.")
@@ -1334,7 +1341,7 @@ def _init(address_info=None,
def init(redis_address=None, node_ip_address=None, object_id_seed=None,
num_workers=None, driver_mode=SCRIPT_MODE, redirect_output=False,
num_cpus=None, num_gpus=None, num_custom_resource=None,
num_redis_shards=None,
num_redis_shards=None, redis_max_clients=None,
plasma_directory=None, huge_pages=False):
"""Connect to an existing Ray cluster or start one and connect to it.
@@ -1368,6 +1375,8 @@ def init(redis_address=None, node_ip_address=None, object_id_seed=None,
flag is experimental and is subject to changes in the future.
num_redis_shards: The number of Redis shards to start in addition to
the primary Redis shard.
redis_max_clients: If provided, attempt to configure Redis with this
maxclients number.
plasma_directory: A directory where the Plasma memory mapped files will
be created.
huge_pages: Boolean flag indicating whether to start the Object
@@ -1393,6 +1402,7 @@ def init(redis_address=None, node_ip_address=None, object_id_seed=None,
redirect_output=redirect_output, num_cpus=num_cpus,
num_gpus=num_gpus, num_custom_resource=num_custom_resource,
num_redis_shards=num_redis_shards,
redis_max_clients=redis_max_clients,
plasma_directory=plasma_directory,
huge_pages=huge_pages)