App killed

I am trying to deploy my streamlit app using amazon ec2. The app is loading fine. But when I try to predict, the app is getting killed
image

Hi @shena-cloud ,

this can have different reasons.
Actually, I had the same issue some weeks ago. In my case, the problem was that I used a very small EC2 + I had several tabs/browser opened with the app at the same time.

So what happened?
When I started the streamlit app, I had a big dataframe being loaded at the beginning. When I only had one browser with one streamlit instance running, everything worked as expected.
But since I had several tabs loading the same dataframe at exactly the same time - this caused issues due to the small EC2.

So maybe this might also be the case for you?

In any case to get more information, you should add more logs/print statements in your python script to identify exactly, at which point the app is crashing (I assume it’s always at the same step?).

Best,
Alex

Hello,

I am having the exact same issue, deployed a Chinese Segmenter Webapp on a micro ec2 and it keeps getting killed.
Could you share your solution, have you moved your app to a bigger tier ec2?

Thanks a lot for your help !

Stéphane

Hi @StephaneB ,

I’m having the same issue. Using TfidfVectorizer and on fit_transform() it’s using probably 4GB+ of memory. It works locally on streamlit. But when deployed on streamlit community cloud or AWS EC2 with 8GB of memory it just says “Killed” with no explanation. Any ideas welcome.

Thanks!
Clg

Hey Clg,
It has been a while since I coded the app, if I remember correctly I migrated to Aliyun (Alibaba Cloud) and hosted it on a slightly bigger RAM ECS and it solved it. Also make sure to use caching in your app to avoid running huge ram consuming functions too many times, I used to store a massive dataframe in RAM which was far from ideal.

Hope that helps!