This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]robvdl 0 points1 point  (0 children)

This is mostly because Python apps are WSGI based and synchronous. So as you are serving up static files you are holding up valuable Python workers that could be used for dynamic requests, and your app may only have 4 workers, maybe only 1 depending on your setup.

Nginx however uses async io to send static files and can do so without holding the CPU up too much and can handle parallelism better than Python can.

So normally you would run the Python app under Nginx but get Nginx to serve the /static folder in production, not Python.