✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
🐍Plotly, Coiled CEOs Discuss Partnering & ML Experts show us how Dash + Dask apps work Register for the Webinar.

My app does not work on Heroku but it works locally, do I need a worker?

https://bio-pam-blosum.herokuapp.com/entrez-parameters

The buttons “Run Needleman-Wunsch” and “Run Smith-Waterman” should give output after following instructions to get two sequences from the NCBI database or uploading them to the Entrez page.

I opened an issue on Biopython Github here: Biopython global and local alignment methods not working on Heroku? · Issue #3607 · biopython/biopython · GitHub

I’m wondering if I need a worker for the alignment methods which are called like this:

alignments = pairwise2.align.globalds(seq1, seq2, self.matrix,
                                              self.gap_open, self.gap_extend,
                                              penalize_end_gaps=False)

and

alignments = pairwise2.align.localds(seq1, seq2, self.matrix,
                                              self.gap_open, self.gap_extend)

They are fairly heavy duty dynamic programming methods for sequence alignments that can take a while depending on complexity and length of sequences involved.

Do I need to allocate a worker on Heroku?

My Heroku logs show it’s timing out on those method calls but why?

2021-06-09T21:34:36.242086+00:00 heroku[router]: at=error code=H12 desc="Request timeout" method=POST path="/_dash-update-component" host=bio-pam-blosum.herokuapp.com request_id=20d65242-8af7-4c54-9b9d-1f3e842385dc fwd="184.151.230.196" dyno=web.1 connect=2ms service=30000ms status=503 bytes=0 protocol=https
2021-06-09T21:34:36.560751+00:00 app[web.1]: [2021-06-09 21:34:36 +0000] [4] [CRITICAL] WORKER TIMEOUT (pid:9)
2021-06-09T21:34:37.592599+00:00 app[web.1]: [2021-06-09 21:34:37 +0000] [39] [INFO] Booting worker with pid: 39
2021-06-09T21:35:26.689465+00:00 heroku[router]: at=error code=H12 desc="Request timeout" method=POST path="/_dash-update-component" host=bio-pam-blosum.herokuapp.com request_id=5312b37f-109d-4efb-8117-a3b6eb873922 fwd="184.151.230.196" dyno=web.1 connect=0ms service=30000ms status=503 bytes=0 protocol=https
2021-06-09T21:35:26.809748+00:00 app[web.1]: [2021-06-09 21:35:26 +0000] [4] [CRITICAL] WORKER TIMEOUT (pid:10)
2021-06-09T21:35:27.864494+00:00 app[web.1]: [2021-06-09 21:35:27 +0000] [54] [INFO] Booting worker with pid: 54

Yes, a worker using Python RQ solved it.

Please refer here GitHub - nyck33/bio_pam_blosum