gunicorn will check which process isn't busy running a callback and send the new callback request to that process
a few processes can balance the requests of 10s or 100s of concurrent user
import dash
import dash_html_components as html
import dash_core_components as dcc
external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']
app = dash.Dash(__name__, external_stylesheets=external_stylesheets)
server = app.server
app.layout = html.Div([
html.Div(dcc.Input(id='input-on-submit', type='text')),
html.Button('Submit', id='submit-val', n_clicks=0),
html.Div(id='container-button-basic',
children='Enter a value and press submit')
])
@app.callback(
dash.dependencies.Output('container-button-basic', 'children'),
[dash.dependencies.Input('submit-val', 'n_clicks')],
[dash.dependencies.State('input-on-submit', 'value')])
def update_output(c, v):
return 'The input value was "{}" and the button has been clicked {} times'.format(
v,
c
)
if __name__ == '__main__':
app.run_server(debug=True)