python - Performance of wsgi file important? -
i've built website using (awesome) python flask framework, i'm deploying on aws. create wsgi file looks this:
import sys sys.path.insert(0, '/var/www/myawesomewebsite') app import app application
since try avoid hardcoding strings code changed following:
import sys, os sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) app import app application
what wonder whether performance of wsgi file matters (with respect additional overhead of os.path.dirname(os.path.abspath(__file__))
).
is wsgi file parsed , executed every web-request, or loaded once when apache started? tips welcome!
the wsgi file executed when application server loads app.
using apache, happen once in while when apache recycles worker thread / process. same goes other application servers (e.g. gunicorn run wsgi file once per worker).
you're fine.
Comments
Post a Comment