Skip to content

Commit

Permalink
Merge pull request #599 from sennetconsortium/maxsibilla/uwsgi-update
Browse files Browse the repository at this point in the history
Updating uwsgi and default log level
  • Loading branch information
maxsibilla authored Dec 11, 2024
2 parents 3711fa6 + 3c01aab commit 003f81b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
# Log rotation is handled via logrotate on the host system with a configuration file
# Do NOT handle log file and rotation via the Python logging to avoid issues with multi-worker processes
logging.basicConfig(format='[%(asctime)s] %(levelname)s in %(module)s: %(message)s',
level=logging.DEBUG,
level=logging.INFO,
datefmt='%Y-%m-%d %H:%M:%S')
logger = logging.getLogger(__name__)

Expand Down
18 changes: 9 additions & 9 deletions src/uwsgi.ini
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
[uwsgi]
# Need this plugin since uwsgi and uwsgi python plugin are installed with yum
# If uwsgi installed with pip, no need this
plugin = python36

# So uwsgi knows where to mount the app
chdir = /usr/src/app/src

# Application's callbale
# Application's callable
module = wsgi:application

# Location of uwsgi log file
Expand All @@ -16,12 +12,14 @@ logto = /usr/src/app/log/uwsgi-ingest-api.log
# By default uWSGI allocates a very small buffer (4096 bytes) for the headers of each request
buffer-size = 32768

# Master with 2 worker process (based on CPU number)
# Master with 16 worker processes (based on CPU number)
master = true
processes = 2
processes = 16

# Enable multithreading for ingest-api
enable-threads = true
# Enable the multithreading within uWSGI
# Launch the application across multiple threads inside each process
enable-threads = True
threads = 16

# Use http socket for integration with nginx
# 127.0.0.1:5000 or localhost:5000 won't work with Docker
Expand All @@ -33,3 +31,5 @@ vacuum = true

# Ensure compatibility with init system
die-on-term = true

attach-daemon = python worker.py

0 comments on commit 003f81b

Please sign in to comment.