Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uses gunicorn to serve firefly #9

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

palnabarun
Copy link

Solves #6

  • Uses gunicorn to run the firefly functions
  • Uses nproc to populate the number of workers for gunicorn

@anandology
Copy link
Member

Where is nprocs defined?

Did you try this on a server and made sure everything is working as expected? If not, could you please create a digital ocean server and try deploying an app?

I remember seeing an issue with installing gunicorn. It was already installed system wide, so it was using the system python instead of python in the virtualenv. Could you please check and confirm if it is indeed the case still?

@palnabarun
Copy link
Author

palnabarun commented Feb 24, 2018

nproc is a Linux utility. https://linux.die.net/man/1/nproc

Let me try on a server.

@palnabarun
Copy link
Author

palnabarun commented Feb 24, 2018

@anandology It works.

The function was run with two worker process using gunicorn on a droplet with 2 vCPU's.
image

@anandology
Copy link
Member

Did you try with a third-party dependency? Try adding a library (say beautifulsoup4) and try importing it your app. I remember seeing an issue with that.

Also, the recommended workers is 2x to 4x the num procs.
http://docs.gunicorn.org/en/stable/settings.html#worker-processes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants