Skip to content

Commit

Permalink
Tiny performance improvments (#685)
Browse files Browse the repository at this point in the history
### TL;DR

This PR decreases the `LOGGING_WAIT_TIME` to .5 from 1 and increases `max_concurrency` from 1000 to 10,000 in both `get_cluster_servlet` and `get_env_servlet` functions at `obj_store.py`.

### What changed?

- The `LOGGING_WAIT_TIME` constant in the `constants.py` file has been decreased to .5 from 1.
- The `max_concurrency` parameter in both `get_cluster_servlet` and `get_env_servlet` functions in the `obj_store.py` file has been increased from 1000 to 10,000.
- The logging of GET call parameters in the `get_call` function in `http_server.py` file has been removed.

### Why make this change?

This change is made to increase the server's concurrent handling capacity and to make the logging output more efficient by reducing the wait time. It also removes redundant logging.

---
  • Loading branch information
dongreenberg committed Apr 2, 2024
1 parent d26cb04 commit 6e23f92
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion runhouse/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

DEFAULT_SERVER_HOST = "0.0.0.0"

LOGGING_WAIT_TIME = 1
LOGGING_WAIT_TIME = 0.5

# Commands
SERVER_START_CMD = f"{sys.executable} -m runhouse.servers.http.http_server"
Expand Down
1 change: 0 additions & 1 deletion runhouse/servers/http/http_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,6 @@ async def get_call(
}
params.data = serialize_data(data, serialization)

logger.info(f"GET call with params: {dict(params)}")
return await HTTPServer._call(key, method_name, params)
except Exception as e:
logger.exception(e)
Expand Down
4 changes: 2 additions & 2 deletions runhouse/servers/obj_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def get_cluster_servlet(create_if_not_exists: bool = False):
get_if_exists=True,
lifetime="detached",
namespace="runhouse",
max_concurrency=1000,
max_concurrency=10000,
resources={f"node:{current_ip}": 0.001},
)
.remote()
Expand Down Expand Up @@ -316,7 +316,7 @@ def get_env_servlet(
resources=resources,
lifetime="detached",
namespace="runhouse",
max_concurrency=1000,
max_concurrency=10000,
)
.remote(env_name=env_name)
)
Expand Down

0 comments on commit 6e23f92

Please sign in to comment.