How does FileInput work when a bokeh app is deployed online (e.g. AWS)?

Hi, I’ve worked on a Bokeh app that relies on the FileInput widget to upload .csv data files before visualising them with Bokeh. I’ve tested my app locally on my computer, and I have succeeded in uploading .csv files and performing subsequent Python computations and visualising the data.

Sorry if this is kind of an amateur question but would the FileInput widget also work the same way if I eventually deploy the bokeh app online, say, on AWS EBS? How exactly does the file uploading to an online server work? Do I need to make any code adjustments if I want to deploy the app as such?

Many thanks.

Hi @hopefullyconvex5

JavaScript code running in the browser (of a client that connects to your server) is what passes the data to the bokeh server.

You should not need any modifications to your code for things to behave the same functionally on a deployed service or locally hosted system.

There might be some architectural considerations for your code, for example, if you’re moving around large amounts of data. It generally will take longer pushing things over the internet rather than via your personal computer’s loopback address.

The bokeh server is blocking, so if its busy servicing an action from one user – such as uploading a very big file – that will possibly cause unresponsiveness for other concurrent users. But you can get around such things by embedding the bokeh server in gunicorn, running with nginx or some other load balancing mechanism, using worker threads for time consuming tasks, etc.

1 Like

Hi @_jm, thank you very much for the very lucid explanation. Very helpful for me as someone who does not really understand networking.

1 Like