FOR LOOP PERFORMANCE

abhishek <[email protected]> Fri, 28 Sep 2018 09:43:48 -0700 (PDT)
Newsgroups gmane.comp.python.cherrypy
Message-ID <[email protected]>
------=_Part_350_484555098.1538153028999
Content-Type: multipart/alternative; 
	boundary="----=_Part_351_74278530.1538153028999"

------=_Part_351_74278530.1538153028999
Content-Type: text/plain; charset="UTF-8"

Hello Group members, 

I have been using cherrypy + tubogears framework for around 4 years front 
ending a product.
Recently, I have been assigned with the task for cloud migration & load 
testing.

I have noticed that sometimes main URL which returns 200 topmost records 
from MySQL DB performs inconsistently.
URL performs following steps:
Step 1: DB Query for 200 records. (~0.1 sec)
Step 2: FOR loop over 200 records from STEP 1 & do some changes to the data 
for presentation.
             Performance of this step is inconsistent. As user load picks 
up, the performance degrades.

Application stack: Turbogears, cherrypy, SQLAlchemy, MySQL


Please refer to timings which were captured in application logs.

2018-09-26 09:57:08,657-[CRITICAL] 
<<071b00a89eca7e090ddf15081c14ead17b851d9110.199.123.53>>* FOR LOOP TOOK 
13.0 sec*.
2018-09-26 09:57:08,660-[CRITICAL] 
<<071b00a89eca7e090ddf15081c14ead17b851d9110.199.123.53>> *DISPLAYING 62 
RESULTS TOOK 13.1690001488 sec.*

2018-09-26 10:01:52,174-[CRITICAL]  
<<76ef224e3c054020a1fbaa258f2dec20c4be3ae610.199.120.100>>* FOR LOOP TOOK 
17.4279999733 sec*.
2018-09-26 10:01:52,176-[CRITICAL]  
<<76ef224e3c054020a1fbaa258f2dec20c4be3ae610.199.120.100>> *DISPLAYING 200 
RESULTS TOOK 17.628000021 sec*.

2018-09-26 10:06:15,165-[CRITICAL] 
<<e3251a737eaf0128e6cb0321a3f51a91038bdfaf10.199.140.69>> *FOR LOOP TOOK 
5.58699989319 sec*. 
2018-09-26 10:06:15,167-[CRITICAL] 
<<e3251a737eaf0128e6cb0321a3f51a91038bdfaf10.199.140.69>> *DISPLAYING 57 
RESULTS TOOK 5.65600013733 sec*.

2018-09-26 10:26:31,381-[CRITICAL] 
<<e3251a737eaf0128e6cb0321a3f51a91038bdfaf10.199.140.69>> *FOR LOOP TOOK 
5.21700000763 sec*.
2018-09-26 10:26:31,381-[CRITICAL]  
<<e3251a737eaf0128e6cb0321a3f51a91038bdfaf10.199.140.69>> *DISPLAYING 38 
RESULTS TOOK 5.29600000381 sec*.

2018-09-26 10:01:09,368-[CRITICAL] 
<<169ef276f8f79c3728f90b8439ed1007f13337d5192.168.47.69>> *FOR LOOP TOOK 
6.16900014877 sec*. 
2018-09-26 10:01:09,368-[CRITICAL] 
<<169ef276f8f79c3728f90b8439ed1007f13337d5192.168.47.69>> *DISPLAYING 20 
RESULTS TOOK 6.39199995995 sec*.





    

-- 
You received this message because you are subscribed to the Google Groups "cherrypy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cherrypy-users+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
To post to this group, send email to cherrypy-users-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
Visit this group at https://groups.google.com/group/cherrypy-users.
For more options, visit https://groups.google.com/d/optout.

------=_Part_351_74278530.1538153028999
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hello Group members,=C2=A0<div><br></div><div>I have been =
using cherrypy + tubogears framework for around 4 years front ending a prod=
uct.</div><div>Recently, I have been assigned with the task for cloud migra=
tion &amp; load testing.</div><div><br></div><div>I have noticed that somet=
imes main URL which returns 200 topmost records from MySQL DB performs inco=
nsistently.</div><div>URL performs following steps:</div><div>Step 1: DB Qu=
ery for 200 records. (~0.1 sec)</div><div>Step 2: FOR loop over 200 records=
 from STEP 1 &amp; do some changes to the data for presentation.</div><div>=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Performance of this step is=
 inconsistent. As user load picks up, the performance degrades.</div><div><=
br></div><div>Application stack: Turbogears, cherrypy, SQLAlchemy, MySQL</d=
iv><div><br></div><div><br></div><div>Please refer to timings which were ca=
ptured in application logs.</div><div><br></div><div><div style=3D"font-siz=
e: small;">2018-09-26 09:57:08,657-[CRITICAL] &lt;&lt;<wbr>071b00a89eca7e09=
0ddf15081c14ea<wbr>d17b851d9110.199.123.53&gt;&gt;<b>=C2=A0FOR LOOP TOOK 13=
.0 sec</b>.</div><div style=3D"font-size: small;">2018-09-26 09:57:08,660-[=
CRITICAL] &lt;&lt;<wbr>071b00a89eca7e090ddf15081c14ea<wbr>d17b851d9110.199.=
123.53&gt;&gt;=C2=A0<b>DISPLAYING 62 RESULTS TOOK 13.1690001488 sec.</b></d=
iv></div><div><br></div><div><div style=3D"font-size: small;">2018-09-26 10=
:01:52,174-[CRITICAL]=C2=A0 &lt;&lt;<wbr>76ef224e3c054020a1fbaa258f2dec<wbr=
>20c4be3ae610.199.120.100&gt;&gt;<b>=C2=A0FOR LOOP TOOK 17.4279999733 sec</=
b>.<br></div><div style=3D"font-size: small;">2018-09-26 10:01:52,176-[CRIT=
ICAL]=C2=A0 &lt;&lt;<wbr>76ef224e3c054020a1fbaa258f2dec<wbr>20c4be3ae610.19=
9.120.100&gt;&gt;=C2=A0<b>DISPLAYING 200 RESULTS TOOK 17.628000021 sec</b>.=
</div><div style=3D"font-size: small;"><br></div><div style=3D"font-size: s=
mall;"><div>2018-09-26 10:06:15,165-[CRITICAL] &lt;&lt;<wbr>e3251a737eaf012=
8e6cb0321a3f51a<wbr>91038bdfaf10.199.140.69&gt;&gt;=C2=A0<b>FOR LOOP TOOK 5=
.58699989319 sec</b>.=C2=A0</div><div>2018-09-26 10:06:15,167-[CRITICAL] &l=
t;&lt;<wbr>e3251a737eaf0128e6cb0321a3f51a<wbr>91038bdfaf10.199.140.69&gt;&g=
t;=C2=A0<b>DISPLAYING 57 RESULTS TOOK 5.65600013733 sec</b>.</div></div><di=
v style=3D"font-size: small;"><br></div><div style=3D"font-size: small;"><d=
iv>2018-09-26 10:26:31,381-[CRITICAL] &lt;&lt;<wbr>e3251a737eaf0128e6cb0321=
a3f51a<wbr>91038bdfaf10.199.140.69&gt;&gt;=C2=A0<b>FOR LOOP TOOK 5.21700000=
763 sec</b>.</div><div>2018-09-26 10:26:31,381-[CRITICAL]=C2=A0 &lt;&lt;<wb=
r>e3251a737eaf0128e6cb0321a3f51a<wbr>91038bdfaf10.199.140.69&gt;&gt;=C2=A0<=
b>DISPLAYING 38 RESULTS TOOK 5.29600000381 sec</b>.</div></div><div style=
=3D"font-size: small;"><br></div><div style=3D"font-size: small;"><div>2018=
-09-26 10:01:09,368-[CRITICAL] &lt;&lt;<wbr>169ef276f8f79c3728f90b8439ed10<=
wbr>07f13337d5192.168.47.69&gt;&gt;=C2=A0<b>FOR LOOP TOOK 6.16900014877 sec=
</b>.=C2=A0</div><div>2018-09-26 10:01:09,368-[CRITICAL] &lt;&lt;<wbr>169ef=
276f8f79c3728f90b8439ed10<wbr>07f13337d5192.168.47.69&gt;&gt;=C2=A0<b>DISPL=
AYING 20 RESULTS TOOK 6.39199995995 sec</b>.</div><div><br></div></div></di=
v><div><br></div><div><br></div><div><br></div><div><br></div><div>=C2=A0 =
=C2=A0=C2=A0</div></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;cherrypy-users&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:cherrypy-users+unsubscribe-/[email protected]">cher=
rypy-users+unsubscribe-/[email protected]</a>.<br />
To post to this group, send email to <a href=3D"mailto:cherrypy-users@googl=
egroups.com">cherrypy-users-/[email protected]</a>.<br />
Visit this group at <a href=3D"https://groups.google.com/group/cherrypy-use=
rs">https://groups.google.com/group/cherrypy-users</a>.<br />
For more options, visit <a href=3D"https://groups.google.com/d/optout">http=
s://groups.google.com/d/optout</a>.<br />

------=_Part_351_74278530.1538153028999--

------=_Part_350_484555098.1538153028999--