Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to safely shutdown mlflow ui?

After running mlflow ui on a remote server, I'm unable to reopen the mlflow ui again.
A workaround is to kill all my processes in the server using pkill -u MyUserName.
Otherwise I get the following error:

[INFO] Starting gunicorn 20.0.4  
[ERROR] Connection in use: ('127.0.0.1', 5000)
[ERROR] Retrying in 1 second.  
...
Running the mlflow server failed. Please see ther logs above for details.

I understand the error but I don't understand:
1. What is the correct way to shutdown mlflow ui
2. How can I identify the mlflow ui process in order to only kill that process and not use the pkill

Currently I close the browser or use ctrl+C

like image 906
skibee Avatar asked Oct 15 '22 05:10

skibee


2 Answers

I also met a similar problem recently when I call mlflow ui in the remote server. The Ctrl + C in the command line to exit usually works. However, When it doesn't, using pkill -f gunicorn solves my problem. Note, you can also use ps -A | grep gunicorn to first find the process and kill [PID] manually. A similar problem seems to have been discussed here once.

like image 110
Moore Avatar answered Nov 01 '22 15:11

Moore


Quick solution:

Simply kill the process

fuser -k 5000/tcp

Command syntax

fuser -k <port>/tcp

Bonus: fuser 5000/tcp will print you PID of process bound on that port.

Note: Works on Linux only. More universal is use of lsof -i4 (or 6 for IPv6).

like image 40
Suhas_Pote Avatar answered Nov 01 '22 13:11

Suhas_Pote