Will upgrading my Heroku fix the problems I am running into running my Flask app?

Viewed 523

My Flask is running on my localhost so I went to deploy it to Heroku and I run into errors. Everything adds and pushed in fine but when I look at the tail logs I get the following error:

2021-04-17T14:50:44.852070+00:00 heroku[web.1]: State changed from starting to up 2021-04-17T14:51:00.524741+00:00 heroku[web.1]: Process running mem=720M(140.6%) 2021-04-17T14:51:00.526543+00:00 heroku[web.1]: Error R14 (Memory quota exceeded) 2021-04-17T14:51:14.539596+00:00 app[web.1]: [2021-04-17 14:51:14 +0000] [4] [CRITICAL] WORKER TIMEOUT (pid:7) 2021-04-17T14:51:14.542728+00:00 app[web.1]: [2021-04-17 14:51:14 +0000] [4] [CRITICAL] WORKER TIMEOUT (pid:8) 2021-04-17T14:51:14.626410+00:00 app[web.1]: [2021-04-17 14:51:14 +0000] [8] [ERROR] Exception in worker process 2021-04-17T14:51:14.626414+00:00 app[web.1]: Traceback (most recent call last): 2021-04-17T14:51:14.626415+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/arbiter.py", line 589, in spawn_worker 2021-04-17T14:51:14.626417+00:00 app[web.1]: worker.init_process() 2021-04-17T14:51:14.626417+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/workers/base.py", line 134, in init_process 2021-04-17T14:51:14.626433+00:00 app[web.1]: File "pandas/_libs/parsers.pyx", line 814, in pandas._libs.parsers.TextReader._tokenize_rows 2021-04-17T14:51:14.626433+00:00 app[web.1]: File "pandas/_libs/parsers.pyx", line 1943, in pandas._libs.parsers.raise_parser_error 2021-04-17T14:51:14.626434+00:00 app[web.1]: TypeError: raise: exception class must be a subclass of BaseException 2021-04-17T14:51:14.627481+00:00 app[web.1]: [2021-04-17 14:51:14 +0000] [8] [INFO] Worker exiting (pid: 8) 2021-04-17T14:51:14.630222+00:00 app[web.1]: [2021-04-17 14:51:14 +0000] [7] [INFO] Worker exiting (pid: 7) 2021-04-17T14:51:15.585222+00:00 app[web.1]: [2021-04-17 14:51:15 +0000] [4] [WARNING] Worker with pid 8 was terminated due to signal 9

So what I got is that I need more memory which is confusing because my .py files are only 2kb and 4kb but maybe pandas, scikit, dropbox, and flask imports increase it that much? I also get the critical worker timout which is what id be most concerned about. My code takes a long time to run sometimes, over 30 seconds, so it hits a timeout. Would upgrading from the free heroku fix that? Just don't want to spend like $50 to upgrade and then still not have it work. In the tail logs the memory also keeps going up, just got running memory 1113 and got the memory quota vastly exceeded error.

0 Answers
Related