Hello,
I have a streamlit app deployed on a Ubuntu VM, using NGINX and managed by PM2.
The problem i am facing because of the PM2 is that i have multiple processes running and managed by it. When i interract with a button, widget, or something that refreshes the script, there is a chance that i am moved to another process of the PM2(this is random, the user is dropped on any available process)
Because the processes do not share memory, the session state becomes unusable.
I detected this when the chatbot created a pdf for the user to download it. By clicking the download pdf button, i assume the script reruns, so there is a chance i am being moved to another process, where the PDF data is non existent, thus getting a 404 error. If i click enough times on the download button, there is a chance i land on the same process i already was, making downloading available.
How can someone manage the session state in Streamlit with PM2? I have multiple important data there that is unique for each user. Thank you!