Subject: [pgAdmin][RM5017] Use cheroot as default production server

From: Aditya Toshniwal <[email-masked]>
Date: Tue, 17 Dec 2019 15:15:05 +0530

Hi Hackers,

Attached is the patch to use https://pypi.org/project/cheroot/ instead of
current flask dev server. cheroot is a stable production ready server.
Plus, flask dev server is not recommended for production.
Code is changed to use cheroot only when DEBUG is False, otherwise you the
default flask server.

Kindly review.

-- 
Thanks and Regards,
Aditya Toshniwal
Sr. Software Engineer | EnterpriseDB India | Pune
"Don't Complain about Heat, Plant a TREE"

---

From: Akshay Joshi <[email-masked]>
Date: Fri, 20 Dec 2019 11:34:07 +0530

Thanks, patch applied.

-- 
*Thanks & Regards*
*Akshay Joshi*

*Sr. Software Architect*
*EnterpriseDB Software India Private Limited*
*Mobile: +91 976-788-8246*

---

From: Ashesh Vashi <[email-masked]>
Date: Fri, 20 Dec 2019 13:34:29 +0530

Have you seen any improvements in performance?

---

From: Aditya Toshniwal <[email-masked]>
Date: Fri, 20 Dec 2019 18:21:39 +0530

Hi Ashesh,

I had tried with - https://newrelic.com/ API to check Flask app
performance. To be honest, there was not a great difference in the
performance.
Per new relic, cheroot used slightly less CPU, with more RPM and, with less
response time.
Anyway, flask is still not recommended and cheroot looks a good option as
it is pure python and supports almost all OS.

On Fri, Dec 20, 2019 at 1:34 PM Ashesh Vashi <[email-masked]>
wrote:

>> Attached is the patch to use https://pypi.org/project/cheroot/ instead
>> of current flask dev server. cheroot is a stable production ready server.
>> Code is changed to use cheroot only when DEBUG is False, otherwise you
>> the default flask server.
>>
>> Kindly review.
>>
>> --
>> Thanks and Regards,
>> Aditya Toshniwal

-- 
Thanks and Regards,
Aditya Toshniwal
pgAdmin Hacker | Sr. Software Engineer | EnterpriseDB India | Pune
"Don't Complain about Heat, Plant a TREE"

---

From: Aditya Toshniwal <[email-masked]>
Date: Tue, 24 Dec 2019 12:49:08 +0530

Hi Hackers,

One of the dependencies of cheroot - jaraco.functools was released on 20th
Dec (v 3.0.0) which removed the support below Python 3.6. So while
installing cheroot (using pgAdmin wheel) on Python 3.5, it is failing.
cheroot works fine with its previous version of jaraco.functools==2.0.0.
I've raised the issue to cheroot -
https://github.com/cherrypy/cheroot/issues/258.
Please note, installers work fine as they are shipped with Python 3.7 venv.
Ref - https://www.postgresql.org/ftp/pgadmin/pgadmin4/snapshots/2019-12-24/
Attached is the patch to pin jaraco.functools to 2.0.0 in requirements so
that it does not fail below Python 3.6.

On Fri, Dec 20, 2019 at 6:21 PM Aditya Toshniwal <
[email-masked]> wrote:

> Per new relic, cheroot used slightly less CPU, with more RPM and, with
> less response time.
> On Fri, Dec 20, 2019 at 1:34 PM Ashesh Vashi <
> [email-masked]> wrote:
>

---

From: Aditya Toshniwal <[email-masked]>
Date: Fri, 27 Dec 2019 11:43:13 +0530

Hi Hackers,

Turned out my pip was of older version. Upgrading pip solved the
jaraco.functools problem. pip downloaded the suitable version
automatically. Kindly ignore the previous patch.

On Tue, Dec 24, 2019 at 12:49 PM Aditya Toshniwal <
[email-masked]> wrote:

> Hi Hackers,
>
> One of the dependencies of cheroot - jaraco.functools was released on
> 20th Dec (v 3.0.0) which removed the support below Python 3.6. So while
> Please note, installers work fine as they are shipped with Python 3.7
> venv. Ref -
> https://www.postgresql.org/ftp/pgadmin/pgadmin4/snapshots/2019-12-24/