Skip to content

Commit

Permalink
Set server process to run with highest system priority
Browse files Browse the repository at this point in the history
  • Loading branch information
openhands-agent committed Nov 22, 2024
1 parent 135a62c commit d3a6aa2
Showing 1 changed file with 7 additions and 18 deletions.
25 changes: 7 additions & 18 deletions openhands/runtime/utils/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,13 @@ def get_remote_startup_command(
plugin_args: list[str],
browsergym_args: list[str],
):
cmd = f'/openhands/micromamba/bin/micromamba run -n openhands poetry run python -u -m openhands.runtime.action_execution_server {port} --working-dir {sandbox_workspace_dir} {" ".join(plugin_args)} --username {username} --user-id {user_id} {" ".join(browsergym_args)}'
return [
'/openhands/micromamba/bin/micromamba',
'run',
'sudo', # Needed for nice -20
'nice',
'-n',
'openhands',
'poetry',
'run',
'python',
'-u',
'-m',
'openhands.runtime.action_execution_server',
str(port),
'--working-dir',
sandbox_workspace_dir,
*plugin_args,
'--username',
username,
'--user-id',
str(user_id),
*browsergym_args,
'-20', # Highest priority
'sh',
'-c',
f'echo -1000 > /proc/self/oom_score_adj && exec {cmd}'
]

0 comments on commit d3a6aa2

Please sign in to comment.