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

perf: performance tweaks #16

Merged
merged 8 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
9 changes: 7 additions & 2 deletions conf/nginx.conf.tpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
worker_processes 1;
worker_processes 2;
pcre_jit on;

# expose env vars to lua code
env BENTO_DEBUG;
Expand All @@ -7,7 +8,8 @@ env BENTO_AUTHZ_SERVICE_URL;
error_log stderr info;

events {
worker_connections 1024;
worker_connections 2048;
use epoll; # Should be default on Linux, but explicitly use it
}

# tpl__tls_yes__start
Expand Down Expand Up @@ -49,6 +51,9 @@ http {
# Allow SNI-based proxying
proxy_ssl_server_name on;

# Allow sendfile() for sending small files directly
sendfile on;

# Set up log format
log_format compression '$remote_addr - $remote_user [$time_local] '
'"$request" $status $body_bytes_sent '
Expand Down
2 changes: 2 additions & 0 deletions src/proxy_auth_v2.lua
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ local uri = ngx.var.uri -- post-rewrite URI

if req_method == "GET" and (
uri == "/service-info" or -- any service-info endpoint; rewritten from original /api/.../service-info
uri == "/workflows" or -- any workflow-providing endpoint; rewritten from original /api/.../workflows
uri:sub(1, 11) == "/workflows/" or -- "
req_uri_no_qp == "/api/metadata/api/projects" or
req_uri_no_qp == "/api/metadata/api/public" or
req_uri_no_qp == "/api/metadata/api/public_overview" or
Expand Down