The author, a developer, shares how he improved the speed of his Nginx + Gunicorn setup for his Django app on a CentOS 9 EC2 Server.
Initially facing a 3x speed difference between Nginx routing to the Django server versus Gunicorn, he debugged and found a misconfiguration in the binding address in Gunicorn.
The solution involved creating a Gunicorn socket service, updating Gunicorn to use the socket instead of a network address, and then updating Nginx to communicate via the Unix socket.
After restarting the services, the unnecessary network overhead was removed, resulting in a significant speed improvement with Gunicorn responding now ~3X faster.