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

Deploying Guardrails Doc #884

Merged
merged 5 commits into from
Jul 16, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
--workers=4 is more resource friendly.
  • Loading branch information
JosephCatrambone committed Jul 10, 2024
commit d3d2ffd9431daa4d0afe3dc238a6edb5206c419d
2 changes: 1 addition & 1 deletion docs/deploying-guardrails.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ As previously mentioned, the Guardrails API is currently a simple Flask applicat

Previously we showed how to start the Guardrails API as a dev server using the `guardrails start` command. When launching the Guardrails API with a WSGI server, you will reference the underlying `guardrails_api` module instead. For example, when we Dockerize the Guardrails API for internal use, our final line is:
```Dockerfile
CMD gunicorn --bind 0.0.0.0:8000 --timeout=90 --workers=10 'guardrails_api.app:create_app(None, "config.py")'
CMD gunicorn --bind 0.0.0.0:8000 --timeout=90 --workers=4 'guardrails_api.app:create_app(None, "config.py")'
```

This line starts the Guardrails API Flask application with a gunicorn WSGI server. It specifies what port to bind the server to, as well as the timeout for workers and the maximum number of worker threads for handling requests. We typically use the `gthread` worker class with gunicorn because of compatibility issues between how some async workers try to monkeypatch dependencies and how some libraries specify optional imports.
Expand Down