Skip to content

Commit

Permalink
mod_wsgi variables , based on cpu[s]/cores number
Browse files Browse the repository at this point in the history
Signed-off-by: Fabian Arrotin <[email protected]>
  • Loading branch information
arrfab committed Sep 9, 2022
1 parent 4c28798 commit 20fb6a8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,14 @@ pagure_repospanner_cluster: False
# Ensuring that httpd/pagure worker can open multiple files (to avoid "Too many open files")
pagure_httpd_limit_nofile: 65536
sysctl_fs_inotify_max_user_watches: '1524288'

# httpd TimeOut setting (default '60' is too small for wsgi)
pagure_httpd_timeout: 120
# mod_wsgi settings, read https://modwsgi.readthedocs.io/en/master/configuration-directives/WSGIDaemonProcess.html
# default to number of cores/vcpus but can be set through inventory
pagure_httpd_wsgi_processes: "{{ ansible_processor_nproc }}"
pagure_httpd_wsgi_threads: "{{ ansible_processor_nproc }}"
pagure_httpd_wsgi_inactivity_timeout: 300

# If we want repospanner integration, we need the instances details
# see repospanner defaults
Expand Down
2 changes: 1 addition & 1 deletion templates/httpd-pagure.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ WSGIRestrictStdout Off
WSGIRestrictSignal Off
WSGIPythonOptimize 1
WSGIPassAuthorization On
WSGIDaemonProcess pagure user=git group=git maximum-requests=1000 display-name=pagure processes=4 threads=4 inactivity-timeout=300
WSGIDaemonProcess pagure user=git group=git maximum-requests=1000 display-name=pagure processes={{ pagure_httpd_wsgi_processes }} threads={{ pagure_httpd_wsgi_threads }} inactivity-timeout={{ pagure_httpd_wsgi_inactivity_timeout }}
WSGIApplicationGroup %{GLOBAL}

WSGIScriptAlias / /usr/share/pagure/pagure.wsgi
Expand Down

0 comments on commit 20fb6a8

Please sign in to comment.