Your mercy for graceful operations on workers is 60 seconds Your server socket listen backlog is limited to 100 connections Python main interpreter initialized at 0x562fb447cb40 i i i You can enable it with -enable-threads *** Thunder lock: disabled (you can enable it with -thunder-lock ) uwsgi socket 0 bound to UNIX address /tmp/uwsgi.socket fd 3 Python version: 3.6.3 (default, Oct 3 2017, 21:45:48 ) *** Python threads support is disabled. Your processes number limit is 63569 your memory page size is 4096 bytesĭetected max file descriptor number: 1024 lock engine: pthread robust mutexes !!! no internal routing support, rebuild with pcre support !!! Os: Linux-4.13.0-46-generic #51-Ubuntu SMP Tue Jun 12 12:36: nodename: ubuntuvmĭetected number of CPU cores: 4 current working directory: /home/as/Desktop/blogĭetected binary path: /home/as/.virtualenvs/blog/bin/uwsgi getting INI configuration from uwsgi.ini This is the output you should see when running uwsgi command and provide with uwsgi.ini ( uwsgi -ini uwsgi.ini): Requests above that level will be dropped by uwsgi, but we will eventually have nginx in front of it with it’s own backlog. There is also a backlog for uwsgi meaning that if all workers (uwsgi processes) are busy with requests, excessive requests will be put in a queue of size 100 by default. By increasing this number you will increase the number if simultaneous requests to Flask app, but that will require more RAM and there will be more processes with Python interpreter running. Development server runs only 1 process thus allowing only 1 request at a time. So running uwsgi app with uwsgi -ini uwsgi.ini will give long output indicating that uwsgi started 5 processes (see processes=5 in the config). For that to happen let’s create a uwsgi configuration file named uwsgi.ini uwsgiĪs suggested by the warning we should use uwsgi to run it. Naming this file as hello.py and running it with FLASK_APP=test.py flask run -port 5555 will yield a warning that development server is used in a production environment like above. I’ll take a basic Flask app from it’s official docs from flask import Flask I’d like to make a tutorial on how to run it with uwsgi in Docker using common Docker images. WARNING: Do not use the development server in a production environment. That what logs look like when Flask is in development mode: * Serving Flask app "app" (lazy loading) Google top for running Flask with Docker is full of posts where Flask runs in debug mode.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |