diff --git a/README.md b/README.md index 8713f9d..00092d5 100644 --- a/README.md +++ b/README.md @@ -224,6 +224,18 @@ Below are listed all the variables you can customize # Sets the ipv4.method of VXLAN connection, defaults to "link-local" openwisp2_wireguard_vxlan_ipv4_method: disabled openwisp2_wireguard_vxlan_ipv6_method: disabled + + # configure the number of processes and threads + openwisp2_wireguard_uwsgi_processes: 2 + openwisp2_wireguard_uwsgi_threads: 2 + + # extra configurations + openwisp2_wireguard_uwsgi_extra_conf: | + single-interpreter=True + log-4xx=True + log-5xx=True + disable-logging=True + auto-procname=True ``` ## Troubleshooting diff --git a/defaults/main.yml b/defaults/main.yml index fdd839b..e00eb87 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -25,6 +25,15 @@ openwisp2_wireguard_crontab: openwisp2_wireguard_vxlan_ipv4_method: link-local openwisp2_wireguard_vxlan_ipv6_method: link-local +openwisp2_wireguard_uwsgi_processes: 2 +openwisp2_wireguard_uwsgi_threads: 2 +openwisp2_wireguard_uwsgi_extra_conf: | + single-interpreter=True + log-4xx=True + log-5xx=True + disable-logging=True + auto-procname=True + openwisp2_wireguard_required_variables: - openwisp2_wireguard_controller_url - openwisp2_wireguard_vpn_uuid diff --git a/templates/flask/uwsgi.ini b/templates/flask/uwsgi.ini index 2cf53fe..1f84dc4 100644 --- a/templates/flask/uwsgi.ini +++ b/templates/flask/uwsgi.ini @@ -5,8 +5,8 @@ callable=app need-app=true lazy-apps=true master=true -processes=2 -threads=2 +processes={{ openwisp2_wireguard_uwsgi_processes }} +threads={{ openwisp2_wireguard_uwsgi_threads }} single-interpreter=false die-on-term=true procname-prefix-spaced=openwisp2_wireguard_flask_app @@ -18,3 +18,4 @@ ssl-verify-depth = 8 https = {{ openwisp2_wireguard_flask_host }}:{{openwisp2_wireguard_flask_port}},{{ openwisp2_wireguard_ssl_cert }},{{ openwisp2_wireguard_ssl_key }},HIGH uid = {{ openwisp_user }} gid = {{ openwisp_group }} +{{ openwisp2_wireguard_uwsgi_extra_conf }}