diff --git a/.github/workflows/conformance.yml b/.github/workflows/conformance.yml index 940bdf58..09752c94 100644 --- a/.github/workflows/conformance.yml +++ b/.github/workflows/conformance.yml @@ -24,46 +24,55 @@ jobs: go-version: '1.16' - name: Run HTTP conformance tests - uses: GoogleCloudPlatform/functions-framework-conformance/action@v1.1.0 + uses: GoogleCloudPlatform/functions-framework-conformance/action@v1.6.0 with: - version: 'v1.1.0' + version: 'v1.6.0' functionType: 'http' useBuildpacks: false validateMapping: false cmd: "'functions-framework --source tests/conformance/main.py --target write_http --signature-type http'" - name: Run event conformance tests - uses: GoogleCloudPlatform/functions-framework-conformance/action@v1.1.0 + uses: GoogleCloudPlatform/functions-framework-conformance/action@v1.6.0 with: - version: 'v1.1.0' + version: 'v1.6.0' functionType: 'legacyevent' useBuildpacks: false validateMapping: true cmd: "'functions-framework --source tests/conformance/main.py --target write_legacy_event --signature-type event'" - name: Run CloudEvents conformance tests - uses: GoogleCloudPlatform/functions-framework-conformance/action@v1.1.0 + uses: GoogleCloudPlatform/functions-framework-conformance/action@v1.6.0 with: - version: 'v1.1.0' + version: 'v1.6.0' functionType: 'cloudevent' useBuildpacks: false validateMapping: true cmd: "'functions-framework --source tests/conformance/main.py --target write_cloud_event --signature-type cloudevent'" - name: Run HTTP conformance tests declarative - uses: GoogleCloudPlatform/functions-framework-conformance/action@v1.1.0 + uses: GoogleCloudPlatform/functions-framework-conformance/action@v1.6.0 with: - version: 'v1.1.0' + version: 'v1.6.0' functionType: 'http' useBuildpacks: false validateMapping: false cmd: "'functions-framework --source tests/conformance/main.py --target write_http_declarative'" - name: Run CloudEvents conformance tests declarative - uses: GoogleCloudPlatform/functions-framework-conformance/action@v1.1.0 + uses: GoogleCloudPlatform/functions-framework-conformance/action@v1.6.0 with: - version: 'v1.1.0' + version: 'v1.6.0' functionType: 'cloudevent' useBuildpacks: false validateMapping: true cmd: "'functions-framework --source tests/conformance/main.py --target write_cloud_event_declarative'" + + - name: Run HTTP concurrency tests declarative + uses: GoogleCloudPlatform/functions-framework-conformance/action@v1.6.0 + with: + version: 'v1.6.0' + functionType: 'http' + useBuildpacks: false + validateConcurrency: true + cmd: "'functions-framework --source tests/conformance/main.py --target write_http_declarative_concurrent'" \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index e03a9b4f..bd7431cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [3.2.0](https://github.com/GoogleCloudPlatform/functions-framework-python/compare/v3.1.0...v3.2.0) (2022-08-11) + + +### Features + +* Scale gunicorn server to serve 1000 concurrent requests ([#195](https://github.com/GoogleCloudPlatform/functions-framework-python/issues/195)) ([91e2efa](https://github.com/GoogleCloudPlatform/functions-framework-python/commit/91e2efa9356b120a07906023119219d99a6a0791)) + ## [3.1.0](https://github.com/GoogleCloudPlatform/functions-framework-python/compare/v3.0.0...v3.1.0) (2022-06-09) diff --git a/setup.py b/setup.py index ed14b251..48b140dc 100644 --- a/setup.py +++ b/setup.py @@ -25,7 +25,7 @@ setup( name="functions-framework", - version="3.1.0", + version="3.2.0", description="An open source FaaS (Function as a service) framework for writing portable Python functions -- brought to you by the Google Cloud Functions team.", long_description=long_description, long_description_content_type="text/markdown", diff --git a/src/functions_framework/_http/gunicorn.py b/src/functions_framework/_http/gunicorn.py index 25fdb790..f522b67f 100644 --- a/src/functions_framework/_http/gunicorn.py +++ b/src/functions_framework/_http/gunicorn.py @@ -20,7 +20,7 @@ def __init__(self, app, host, port, debug, **options): self.options = { "bind": "%s:%s" % (host, port), "workers": 1, - "threads": 8, + "threads": 1024, "timeout": 0, "loglevel": "error", "limit_request_line": 0, diff --git a/tests/conformance/main.py b/tests/conformance/main.py index e790f626..67926ff6 100644 --- a/tests/conformance/main.py +++ b/tests/conformance/main.py @@ -1,4 +1,5 @@ import json +import time from cloudevents.http import to_json @@ -46,3 +47,9 @@ def write_http_declarative(request): @functions_framework.cloud_event def write_cloud_event_declarative(cloud_event): _write_output(to_json(cloud_event).decode()) + + +@functions_framework.http +def write_http_declarative_concurrent(request): + time.sleep(1) + return "OK", 200 diff --git a/tests/test_http.py b/tests/test_http.py index bd301c91..3414aaf6 100644 --- a/tests/test_http.py +++ b/tests/test_http.py @@ -97,7 +97,7 @@ def test_gunicorn_application(debug): assert gunicorn_app.options == { "bind": "%s:%s" % (host, port), "workers": 1, - "threads": 8, + "threads": 1024, "timeout": 0, "loglevel": "error", "limit_request_line": 0, @@ -105,7 +105,7 @@ def test_gunicorn_application(debug): assert gunicorn_app.cfg.bind == ["1.2.3.4:1234"] assert gunicorn_app.cfg.workers == 1 - assert gunicorn_app.cfg.threads == 8 + assert gunicorn_app.cfg.threads == 1024 assert gunicorn_app.cfg.timeout == 0 assert gunicorn_app.load() == app