Jupyter Lab running plotly dash - how to switch off excessive number of server instances?

Viewed 310

I'm running dash version 1.14.0, jupyter_dash version 0.3.0 and plotly version 4.9.0 in Jupyter Lab 2 on Ubuntu 20.04. If I run this code (partial example):

data_canada = px.data.gapminder().query("country == 'Canada'")

@app.callback(
    Output('graph', 'figure'),
    [Input("colorscale-dropdown", "value")]
)
def update_figure(colorscale):
    return px.bar(data_canada, x='year', y='pop', color='year', color_continuous_scale=colorscale)
        
app.run_server(mode='inline') 

than, whenever I make a small change to the code, Jupyter Lab spawns new process which look like this:

Dash is running on http://127.0.0.1:8050/

Dash is running on http://127.0.0.1:8050/

Dash is running on http://127.0.0.1:8050/

Dash is running on http://127.0.0.1:8050/

Dash is running on http://127.0.0.1:8050/

Dash is running on http://127.0.0.1:8050/

Dash is running on http://127.0.0.1:8050/

Dash is running on http://127.0.0.1:8050/

Dash is running on http://127.0.0.1:8050/

Dash is running on http://127.0.0.1:8050/

....

in production, use a production WSGI server like gunicorn instead.

in production, use a production WSGI server like gunicorn instead.

in production, use a production WSGI server like gunicorn instead.

in production, use a production WSGI server like gunicorn instead.

in production, use a production WSGI server like gunicorn instead.

in production, use a production WSGI server like gunicorn instead.

in production, use a production WSGI server like gunicorn instead.

In addition, I get new processes when running netstat -tulpn command in terminal emulator.

Question: Is there a way to avoid this mess and use a single server instance every time I make a change to the code? Or am I getting the Jupyter Dash concept wrong?

BTW: I know about 'external' and 'jupyterlab' modes.

Also: Ctrl c doesn't work.

0 Answers
Related