Skip to content

Commit eedb475

Browse files
authored
feat: Increase maximum concurrent requests for the server to 1000 (#138)
* increase threads to 1000
1 parent d1df3a4 commit eedb475

File tree

4 files changed

+16
-4
lines changed

4 files changed

+16
-4
lines changed

.github/workflows/conformance.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,22 @@ jobs:
2727
- name: Bundle install
2828
run: 'bundle install'
2929
- name: Run HTTP conformance tests
30-
uses: GoogleCloudPlatform/functions-framework-conformance/action@v1.4.1
30+
uses: GoogleCloudPlatform/functions-framework-conformance/action@v1.6.0
3131
with:
3232
functionType: 'http'
3333
useBuildpacks: false
3434
cmd: "'bundle exec functions-framework-ruby --source test/conformance/app.rb --target http_func --signature-type http'"
3535
- name: Run CloudEvent conformance tests
36-
uses: GoogleCloudPlatform/functions-framework-conformance/action@v1.4.1
36+
uses: GoogleCloudPlatform/functions-framework-conformance/action@v1.6.0
3737
with:
3838
functionType: 'cloudevent'
3939
useBuildpacks: false
4040
validateMapping: true
4141
cmd: "'bundle exec functions-framework-ruby --source test/conformance/app.rb --target cloudevent_func --signature-type cloudevent'"
42+
- name: Run HTTP concurrency tests
43+
uses: GoogleCloudPlatform/functions-framework-conformance/[email protected]
44+
with:
45+
functionType: 'http'
46+
useBuildpacks: false
47+
validateConcurrency: true
48+
cmd: "'bundle exec functions-framework-ruby --source test/conformance/app.rb --target concurrent_http_func --signature-type http'"

.github/workflows/unit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
- name: Checkout repo
5050
uses: actions/checkout@v2
5151
- name: Install Ruby ${{ matrix.ruby }}
52-
uses: ruby/setup-ruby@v1
52+
uses: ruby/setup-ruby@v1.112.0
5353
with:
5454
ruby-version: "${{ matrix.ruby }}"
5555
- name: Install dependencies

lib/functions_framework/server.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ def min_threads
306306
# @return [Integer]
307307
#
308308
def max_threads
309-
@max_threads || 8
309+
@max_threads || 1024
310310
end
311311

312312
##

test/conformance/app.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,8 @@
2121
result = json_format.encode_event event: event
2222
File.write OUTPUT_FILE, result[:content]
2323
end
24+
25+
FunctionsFramework.http "concurrent_http_func" do
26+
sleep 1
27+
"ok"
28+
end

0 commit comments

Comments
 (0)