Gunicorn vs Waitress

Using Gunicorn for frontends with database connections - like ERPNext - can be a deal breaker for enterprise level uses where entries can have hundreds or thousands of items which are uploaded using data imports.

One can experience this when you use purely Werkzeug (development level), or you use bench to do data imports, you do not experience time out problems. However, you experience this with Gunicorn. You can use async workers like those provided by gevent, it may look good with one slow connection, but if several slow connections connect simultaneously, these would send all these long running requests in parallel to the database server.

Waitress is also a WSGI server like Gunicorn, but it uses async master process to cache the items which are contained in the client body before sending in to a sync worker that connects to the database.

To be sure Gunicorn is more popular than Waitress, but Waitress has been found to be more resilient in production environments that can have long running transactions and slow connections, especially those web apps that are front ends for database connections - like ERPNext.