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

Aditya Toshniwal <[email protected]> Tue, 24 Dec 2019 12:49:08 +0530
Newsgroups gmane.comp.db.postgresql.pgadmin.devel
Message-ID <CAM9w-_mmi1gW7cbg0J9wQ9m3AP0_m12GtctmbHY7+vBqDvrbMw@mail.gmail.com>
--000000000000e95de4059a6df76d
Content-Type: multipart/alternative; boundary="000000000000e95de2059a6df76b"

--000000000000e95de2059a6df76b
Content-Type: text/plain; charset="UTF-8"

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 protected]> wrote:

> 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 protected]> wrote:
>
>> Have you seen any improvements in performance?
>>
>> On Tue, 17 Dec 2019, 15:16 Aditya Toshniwal, <
>> [email protected]> wrote:
>>
>>> 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"
>>>
>>
>
> --
> Thanks and Regards,
> Aditya Toshniwal
> pgAdmin Hacker | Sr. Software Engineer | EnterpriseDB India | Pune
> "Don't Complain about Heat, Plant a TREE"
>


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

--000000000000e95de2059a6df76b
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_default" style=3D"font-family:verdana,=
sans-serif">Hi Hackers,</div><div class=3D"gmail_default" style=3D"font-fam=
ily:verdana,sans-serif"><br></div><div class=3D"gmail_default" style=3D""><=
font face=3D"verdana, sans-serif">One of the dependencies of cheroot -=C2=
=A0<span style=3D"color:rgb(36,41,46)">jaraco.functools was released on 20t=
h Dec (v 3.0.0) which=C2=A0removed the support below Python 3.6. So while i=
nstalling cheroot (using pgAdmin wheel) on Python 3.5, it is failing. chero=
ot works fine with its previous version of=C2=A0</span>jaraco.functools=3D=
=3D2.0.0. I&#39;ve raised the issue to cheroot -=C2=A0<a href=3D"https://gi=
thub.com/cherrypy/cheroot/issues/258" style=3D"">https://github.com/cherryp=
y/cheroot/issues/258</a>.</font></div><div class=3D"gmail_default" style=3D=
""><font face=3D"verdana, sans-serif">Please note, installers work fine as =
they are shipped with Python 3.7 venv. Ref -=C2=A0</font><a href=3D"https:/=
/www.postgresql.org/ftp/pgadmin/pgadmin4/snapshots/2019-12-24/">https://www=
.postgresql.org/ftp/pgadmin/pgadmin4/snapshots/2019-12-24/</a></div><div cl=
ass=3D"gmail_default" style=3D""><font face=3D"verdana, sans-serif"><span s=
tyle=3D"color:rgb(36,41,46)">Attached is the patch to pin=C2=A0</span><span=
 style=3D"color:rgb(36,41,46)">jaraco.functools to 2.0.0 in requirements so=
 that it does not fail below Python 3.6.</span></font></div></div><br><div =
class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Fri, Dec 20,=
 2019 at 6:21 PM Aditya Toshniwal &lt;<a href=3D"mailto:aditya.toshniwal@en=
terprisedb.com">[email protected]</a>&gt; wrote:<br></div><=
blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-l=
eft:1px solid rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr"><div clas=
s=3D"gmail_default" style=3D"font-family:verdana,sans-serif">Hi Ashesh,<br>=
</div><div class=3D"gmail_default" style=3D"font-family:verdana,sans-serif"=
><br></div><div class=3D"gmail_default" style=3D"font-family:verdana,sans-s=
erif">I had tried with -=C2=A0<a href=3D"https://newrelic.com/" style=3D"fo=
nt-family:Arial,Helvetica,sans-serif" target=3D"_blank">https://newrelic.co=
m/</a>=C2=A0API to check Flask app performance. To be=C2=A0honest, there wa=
s not a great difference in the performance.=C2=A0</div><div class=3D"gmail=
_default" style=3D"font-family:verdana,sans-serif">Per new relic, cheroot u=
sed slightly less CPU, with more RPM and, with less response time.</div><di=
v class=3D"gmail_default" style=3D"font-family:verdana,sans-serif">Anyway, =
flask is still not recommended=C2=A0and cheroot looks a good option as it i=
s pure python and supports almost all OS.</div></div><br><div class=3D"gmai=
l_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Fri, Dec 20, 2019 at 1:34=
 PM Ashesh Vashi &lt;<a href=3D"mailto:[email protected]" targe=
t=3D"_blank">[email protected]</a>&gt; wrote:<br></div><blockqu=
ote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px=
 solid rgb(204,204,204);padding-left:1ex"><div dir=3D"auto">Have you seen a=
ny improvements in performance?=C2=A0</div><br><div class=3D"gmail_quote"><=
div dir=3D"ltr" class=3D"gmail_attr">On Tue, 17 Dec 2019, 15:16 Aditya Tosh=
niwal, &lt;<a href=3D"mailto:[email protected]" target=3D"_=
blank">[email protected]</a>&gt; wrote:<br></div><blockquot=
e class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px s=
olid rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr"><div class=3D"gmai=
l_default" style=3D"font-family:verdana,sans-serif">Hi Hackers,</div><div c=
lass=3D"gmail_default" style=3D"font-family:verdana,sans-serif"><br></div><=
div class=3D"gmail_default" style=3D"font-family:verdana,sans-serif">Attach=
ed is the patch to use=C2=A0<a href=3D"https://pypi.org/project/cheroot/" s=
tyle=3D"font-family:Arial,Helvetica,sans-serif" rel=3D"noreferrer" target=
=3D"_blank">https://pypi.org/project/cheroot/</a>=C2=A0instead of current f=
lask dev server. cheroot is a stable production ready server. Plus, flask d=
ev server is not recommended for production.</div><div class=3D"gmail_defau=
lt" style=3D"font-family:verdana,sans-serif">Code is changed to use cheroot=
 only when DEBUG is False, otherwise=C2=A0you the default flask server.</di=
v><div><br></div><div><div class=3D"gmail_default" style=3D"font-family:ver=
dana,sans-serif">Kindly review.</div><br></div>-- <br><div dir=3D"ltr"><div=
 dir=3D"ltr"><div><div dir=3D"ltr"><div><div dir=3D"ltr"><div><div dir=3D"l=
tr"><font size=3D"2" color=3D"#000000" face=3D"verdana, sans-serif">Thanks =
and Regards,</font><div><span style=3D"background-color:rgb(255,255,255)"><=
font size=3D"2" color=3D"#000000" face=3D"verdana, sans-serif">Aditya Toshn=
iwal</font></span></div><div><font face=3D"verdana, sans-serif"><span style=
=3D"background-color:rgb(255,255,255)"><font size=3D"2" color=3D"#000000">S=
r. Software Engineer |=C2=A0EnterpriseDB India |=C2=A0</font></span><span s=
tyle=3D"color:rgb(0,0,0)">Pune</span></font></div><div><font color=3D"#3876=
1d" face=3D"verdana, sans-serif" size=3D"1">&quot;Don&#39;t Complain about =
Heat, Plant a TREE&quot;</font></div></div></div></div></div></div></div></=
div></div></div>
</blockquote></div>
</blockquote></div><br clear=3D"all"><div><br></div>-- <br><div dir=3D"ltr"=
><div dir=3D"ltr"><div><div dir=3D"ltr"><div><div dir=3D"ltr"><div><div dir=
=3D"ltr"><div><div dir=3D"ltr"><font size=3D"2" color=3D"#000000" face=3D"v=
erdana, sans-serif">Thanks and Regards,</font><div><span style=3D"backgroun=
d-color:rgb(255,255,255)"><font size=3D"2" color=3D"#000000" face=3D"verdan=
a, sans-serif">Aditya Toshniwal</font></span></div><div><font face=3D"verda=
na, sans-serif"><span style=3D"background-color:rgb(255,255,255)"><font siz=
e=3D"2" color=3D"#000000">pgAdmin Hacker | Sr. Software Engineer |=C2=A0Ent=
erpriseDB India |=C2=A0</font></span><span style=3D"color:rgb(0,0,0)">Pune<=
/span></font></div><div><font color=3D"#38761d" face=3D"verdana, sans-serif=
" size=3D"1">&quot;Don&#39;t Complain about Heat, Plant a TREE&quot;</font>=
</div></div></div></div></div></div></div></div></div></div></div>
</blockquote></div><br clear=3D"all"><div><br></div>-- <br><div dir=3D"ltr"=
 class=3D"gmail_signature"><div dir=3D"ltr"><div><div dir=3D"ltr"><div><div=
 dir=3D"ltr"><div><div dir=3D"ltr"><div><div dir=3D"ltr"><font size=3D"2" c=
olor=3D"#000000" face=3D"verdana, sans-serif">Thanks and Regards,</font><di=
v><span style=3D"background-color:rgb(255,255,255)"><font size=3D"2" color=
=3D"#000000" face=3D"verdana, sans-serif">Aditya Toshniwal</font></span></d=
iv><div><font face=3D"verdana, sans-serif"><span style=3D"background-color:=
rgb(255,255,255)"><font size=3D"2" color=3D"#000000">pgAdmin Hacker | Sr. S=
oftware Engineer |=C2=A0EnterpriseDB India |=C2=A0</font></span><span style=
=3D"color:rgb(0,0,0)">Pune</span></font></div><div><font color=3D"#38761d" =
face=3D"verdana, sans-serif" size=3D"1">&quot;Don&#39;t Complain about Heat=
, Plant a TREE&quot;</font></div></div></div></div></div></div></div></div>=
</div></div></div>

--000000000000e95de2059a6df76b--
--000000000000e95de4059a6df76d
Content-Type: application/octet-stream; name="RM5017.part2.patch"
Content-Disposition: attachment; filename="RM5017.part2.patch"
Content-Transfer-Encoding: base64
Content-ID: <f_k4jjgatw0>
X-Attachment-Id: f_k4jjgatw0

ZGlmZiAtLWdpdCBhL3JlcXVpcmVtZW50cy50eHQgYi9yZXF1aXJlbWVudHMudHh0CmluZGV4IGIy
ZTAwZDYxMC4uNTQ4NTY1MmMzIDEwMDY0NAotLS0gYS9yZXF1aXJlbWVudHMudHh0CisrKyBiL3Jl
cXVpcmVtZW50cy50eHQKQEAgLTE1LDYgKzE1LDcgQEAKICMgICAgICAgaWdub3JlZCB3aGVuIGJ1
aWxkaW5nIGEgUElQIFdoZWVsLgogIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMj
IyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjCiBibGlua2VyPT0xLjQK
K2phcmFjby5mdW5jdG9vbHM9PTIuMC4wCiBjaGVyb290PT04LjIuMQogRmxhc2s9PTEuMC4yCiBX
ZXJremV1Zz49MC4xNS4wCg==
--000000000000e95de4059a6df76d--