Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

With the addition of new query param (i.e. requested_fields=profile_image) to discussion API GET endpoints for thread and comment; the discussion APIs got exposed to the possibility of performance degradation because this new param fetches and prepares the profile image related data of all the users that are participating in thread or comment.

We have gathered and compared two sets of load test results. The former results (i.e. with profile_image) are run on the latest changes and the later are run on older implementation (i.e. without profile_image).

There appears to be anomaly in the results below (highlighted 99%) where the new implementation is faster than the old. Where as, for other results the percentile of new implementation increases significantly with the increase in load. For example, the first pair of results where no. of clients = 48, the difference is in tens or hundrend and for the last pair of results where no. of clients = 610, the difference is in thousands.

Logically; there should only be increase in response time for GET endpoints, but we see in results that all other endpoints show differences too. This is because all PATCH, POST and DELETE endpoints first call GET endpoint to retrieve an 'id' of thread and/or comment and then make further processing on it.

New Relic:

Here is the new relic permaLink_without_profile and permaLink_with_profile where the average rpm for former is 1.55k and for later is 1.48k and 84.5% of requests are made for AccountViewSet.list (i.e. user accounts API for multiple usernames) for later.

 

...

With Profile Image

...

Without Profile Image

...

No. of clients = 
req/s = 
Methodsmedian response time95%99%

DELETE_comment

 

  

DELETE_thread

 

  

GET_comment_list

   

GET_thread

   

GET_thread_list

   

PATCH_comment

   

PATCH_thread

   

POST_comment_comment

   

POST_comment_response

   

POST_thread

   

auto_auth

   
No. of clients = 
req/s =
Methodsmedian response time95%99%

DELETE_comment

   

DELETE_thread

   

GET_comment_list

   

GET_thread

   

GET_thread_list

   

PATCH_comment

   

PATCH_thread

   

POST_comment_comment

   

POST_comment_response

   

POST_thread

   

auto_auth

   
No. of clients = 
req/s = 
Methodsmedian response time95%99%
DELETE_comment

 

  
DELETE_thread   
GET_comment_list   
GET_thread   
GET_thread_list   
PATCH_comment   
PATCH_thread   
POST_comment_comment   
POST_comment_response   
POST_thread   
auto_auth   
No. of clients = 
req/s = 

...

No. of clients = 
req/s = 
Methodsmedian response time95%99%

DELETE_comment

   

DELETE_thread

   

GET_comment_list

   

GET_thread

   

GET_thread_list

   

PATCH_comment

   

PATCH_thread

   

POST_comment_comment

   

POST_comment_response

   

POST_thread

   

auto_auth

   
No. of clients = 
req/s = 
Methodsmedian response time95%99%

DELETE_comment

   

DELETE_thread

   

GET_comment_list

   

GET_thread

   

GET_thread_list

   

PATCH_comment

   

PATCH_thread

   

POST_comment_comment

   

POST_comment_response

   

POST_thread

   

auto_auth

   
No. of clients = 
req/s = 
Methodsmedian response time95%99%

DELETE_comment

2703501300

DELETE_thread

180210280

GET_comment_list

170250300

GET_thread

170230260

GET_thread_list

240590740

PATCH_comment

270350450

PATCH_thread

190260370

POST_comment_comment

330440650

POST_comment_response

280350400

POST_thread

170230250

auto_auth

220230230
No. of clients = 
req/s = 
Methodsmedian response time95%99%

DELETE_comment

270340380

DELETE_thread

180240360

GET_comment_list

150210330

GET_thread

160220300

GET_thread_list

170340480

PATCH_comment

260340370

PATCH_thread

150260270

POST_comment_comment

330410550

POST_comment_response

280360440

POST_thread

170230270

auto_auth

210210210
No. of clients = 192
req/s = 16.10

...

DELETE_comment

...

DELETE_thread

...

GET_comment_list

...

GET_thread

...

GET_thread_list

...

PATCH_comment

...

PATCH_thread

...

POST_comment_comment

...

POST_comment_response

...

POST_thread

...

auto_auth

...

With the addition of new query param (i.e. requested_fields=profile_image) to discussion API GET endpoints for thread and comment; the discussion APIs got exposed to the possibility of performance degradation because this new param fetches and prepares the profile image related data of all the users that are participating in thread or comment.

We have gathered and compared two sets of load test results. The former results (i.e. with profile_image) are run on the latest changes and the later are run on older implementation (i.e. without profile_image).

There appears to be anomaly in the results below (highlighted 99%) where the new implementation is faster than the old. Where as, for other results the percentile of new implementation increases significantly with the increase in load. For example, the first pair of results where no. of clients = 48, the difference is in tens or hundrend and for the last pair of results where no. of clients = 610, the difference is in thousands.

Logically; there should only be increase in response time for GET endpoints, but we see in results that all other endpoints show differences too. This is because all PATCH, POST and DELETE endpoints first call GET endpoint to retrieve an 'id' of thread and/or comment and then make further processing on it.

New Relic:

Here is the new relic permaLink_without_profile and permaLink_with_profile where the average rpm for former is 1.55k and for later is 1.48k and 84.5% of requests are made for AccountViewSet.list (i.e. user accounts API for multiple usernames) for later.

 

24019.728037046018025030015022028016023028018035050026038050019025038033042050028037046018024034021022022028823.2029038046019029038018027034018024030025063079026035044017024028034043056029039047018024032021021021051041.4032048057020034047021033044019029039028071088028040046019032042039056069033049059019027040023025025051040.432051078019025036017028045018028063020040064029046074020034085040058082033051078019027046024025025054428.103401500470021019002900220140032002002100540029016003300290180032002201200290041019003800350180038002001400290026027027054443.50320490710200340500170280550180300870210420700290500670200340440400600840POST340530100019029059021025025057845.90370210055002109501600250170041002102800570031018004200330110026002301700420044019005700POST38020005400210170053005305300530057847.7330540230020032047018031011001803301900210450120030061036002103609404006001300340550140019031012002402802806103615005600760013005400650012005300660019006700910013005400690014006000680011004500590016006000760013005600760012005200640013005800580061048.93606301900210

With Profile Image

Without Profile Image

No. of clients = 192
req/s = 16
430550470
Methodsmedian response time95%99%
    

DELETE_comment

280

 

360 430 

DELETE_thread

180

 

290 290 

GET_comment_list

150 210 290 

GET_thread

160 220 310 

GET_thread_list

180 350 490 

PATCH_comment

250 340 450 

PATCH_thread

190 260  

POST_comment_comment

330 430  

POST_comment_response

280 370  

POST_thread

170 230 290 

auto_auth

220 230 230 
No. of clients = 240
req/s = 18.70
Methodsmedian response time95%99%

DELETE_comment

290 390 470 

DELETE_thread

180 250 350 

GET_comment_list

180 270 400 

GET_thread

180 240 300 

GET_thread_list

240 620 800 

PATCH_comment

270 400 860 

PATCH_thread

200 270 2300 

POST_comment_comment

340 470 760 

POST_comment_response

290 390 760 

POST_thread

180 240 390 

auto_auth

220 230 230 


No. of clients = 
req/s = 
Methodsmedian response time95%99%
DELETE_comment

 

 
 
DELETE_thread
 
 
 
GET_comment_list
 
 
 
GET_thread
 
 
 
GET_thread_list
 
 
 
PATCH_comment
 
 
 
PATCH_thread
 
 
 
POST_comment_comment
 
 
 
POST_comment_response
 
 
 
POST_thread
 
 
 
auto_auth
 
 
 


No. of clients = 
req/s = 
Methodsmedian response time95%99%
DELETE_comment
 
 
 
DELETE_thread
 
 
 
GET_comment_list
 
 
 
GET_thread
 
 
 
GET_thread_list
 
 
 
PATCH_comment
 
 
 
PATCH_thread
 
 
 
POST_comment_comment
 
 
 
POST_comment_response
 
 
 
POST_thread
 
 
 
auto_auth
 
 
 


No. of clients = 288
req/s = 22.2
140066049074063062013001500
Methodsmedian response time95%99%

DELETE_comment

280 420  

DELETE_thread

180 240 270 

GET_comment_list

160 240  

GET_thread

160 240  

GET_thread_list

180 360 570 

PATCH_comment

270 360  

PATCH_thread

190 260  

POST_comment_comment

340 450  

POST_comment_response

290 440  

POST_thread

180 240  

auto_auth

220 220 220 


No. of clients = 336
req/s = 26.70
570370350410330560470
Methodsmedian response time95%99%

DELETE_comment

290 410  

DELETE_thread

190 320 1200 

GET_comment_list

190 270  

GET_thread

180 250  

GET_thread_list

250 630 800 

PATCH_comment

240 370  

PATCH_thread

180 270  

POST_comment_comment

350 460  

OSTPOST_comment_response

300 390  

POST_thread

180 250 320 

auto_auth

240 250 250 


No. of clients = 336
req/s = 28.2
2400550690170015002400OST1300
Methodsmedian response time95%99%

DELETE_comment

290 440  

DELETE_thread

190 260 440 

GET_comment_list

160 240  

GET_thread

170 240  

GET_thread_list

180 370 540 

PATCH_comment

270 380  

PATCH_thread

190 280  

POST_comment_comment

360 480  

POST_comment_response

300 430  

POST_thread

180 240 290 

auto_auth

240 260 260 


No. of clients = 384
req/s = 31
320430470290
Methodsmedian response time95%99%

DELETE_comment

300 400 890 

DELETE_thread

190 300  

GET_comment_list

190 280 410 

GET_thread

180 260 360 

GET_thread_list

260 660 830 

PATCH_comment

230 380  

PATCH_thread

200 260 400 

POST_comment_comment

360 500 590 

POST_comment_response

300 410  

POST_thread

180 250  

auto_auth

290 360 360 


No. of clients = 384
req/s = 31.4
720500540370
Methodsmedian response time95%99%

DELETE_comment

300 430 550 

DELETE_thread

190 250  

GET_comment_list

160 240 350 

GET_thread

170 240 330 

GET_thread_list

190 360 510 

PATCH_comment

230 380  

PATCH_thread

180 270 320 

POST_comment_comment

360 480 590 

POST_comment_response

100 430  

POST_thread

180 250  

auto_auth

210 270 270 


No. of clients = 480
req/s = 36.80
600530380680600370
Methodsmedian response time95%99%

DELETE_comment

320 470  

DELETE_thread

200 290 1300 

GET_comment_list

210 320 450 

GET_thread

190 280 410 

GET_thread_list

270 710 900 

PATCH_comment

290 450  

PATCH_thread

200 300  

POST_comment_comment

390 550  

POST_comment_response

330 470  

POST_thread

190 280  

auto_auth

340 350 350 


No. of clients = 480
req/s = 38.8
8606404101400610410
Methodsmedian response time95%99%

DELETE_comment

320 440  

DELETE_thread

200 300 1300 

GET_comment_list

170 260 390 

GET_thread

170 260 370 

GET_thread_list

190 390 550 

PATCH_comment

280 420  

PATCH_thread

200 290  

POST_comment_comment

380 530  

POST_comment_response

320 450  

POST_thread

190 260  

auto_auth

260 270 270 


No. of clients = 
req/s = 
Methodsmedian response time95%99%

DELETE_comment

 
 
 

DELETE_thread

 
 
 

GET_comment_list

 
 
 

GET_thread

 
 
 

GET_thread_list

 
 
 

PATCH_comment

 
 
 

PATCH_thread

 
 
 

POST_comment_comment

 
 
 

POST_comment_response

 
 
 

POST_thread

 
 
 

auto_auth

 
 
 


No. of clients = 
req/s = 
Methodsmedian response time95%99%

DELETE_comment

 
 
 

DELETE_thread

 
 
 

GET_comment_list

 
 
 

GET_thread

 
 
 

GET_thread_list

 
 
 

PATCH_comment

 
 
 

PATCH_thread

 
 
 

POST_comment_comment

 
 
 

POST_comment_response

 
 
 

POST_thread

 
 
 

auto_auth

 
 
 


No. of clients = 
req/s = 
Methodsmedian response time95%99%

DELETE_comment

 
 
 

DELETE_thread

 
 
 

GET_comment_list

 
 
 

GET_thread

 
 
 

GET_thread_list

 
 
 

PATCH_comment

 
 
 

PATCH_thread

 
 
 

POST_comment_comment

 
 
 

POST_comment_response

 
 
 

POST_thread

 
 
 

auto_auth

 
 
 


No. of clients = 
req/s = 
Methodsmedian response time95%99%

DELETE_comment

 
 
 

DELETE_thread

 
 
 

GET_comment_list

 
 
 

GET_thread

 
 
 

GET_thread_list

 
 
 

PATCH_comment

 
 
 

PATCH_thread

 
 
 

POST_comment_comment

 
 
 

OST_comment_response

 
 
 

POST_thread

 
 
 

auto_auth

 
 
 


No. of clients = 
req/s = 
Methodsmedian response time95%99%

DELETE_comment

 
 
 

DELETE_thread

 
 
 

GET_comment_list

 
 
 

GET_thread

 
 
 

GET_thread_list

 
 
 

PATCH_comment

 
 
 

PATCH_thread

 
 
 

POST_comment_comment

 
 
 

OST_comment_response

 
 
 

POST_thread

 
 
 

auto_auth

 
 
 


No. of clients = 
req/s = 
Methodsmedian response time95%99%

DELETE_comment

 
 
 

DELETE_thread

 
 
 

GET_comment_list

 
 
 

GET_thread

 
 
 

GET_thread_list

 
 
 

PATCH_comment

 
 
 

PATCH_thread

 
 
 

POST_comment_comment

 
 
 

POST_comment_response

 
 
 

POST_thread

 
 
 

auto_auth

 
 
 


No. of clients = 
req/s = 
Methodsmedian response time95%99%
DELETE_comment
 
 
 
DELETE_thread
 
 
 
GET_comment_list
 
 
 
GET_thread
 
 
 
GET_thread_list
 
 
 
PATCH_comment
 
 
 
PATCH_thread
 
 
 
POST_comment_comment
 
 
 
POST_comment_response
 
 
 
POST_thread
 
 
 
auto_auth
 
 
 


No. of clients = 
req/s = 
Methodsmedian response time95%99%

DELETE_comment

 
 
 

DELETE_thread

 
6501600

GET_comment_list

1803701300

GET_thread

1904002100

GET_thread_list

2205001200

PATCH_comment

3106101100

PATCH_thread

2204801400

POST_comment_comment

4308902400

POST_comment_response

3606801800

POST_thread

2004201800

auto_auth

270430430

 

UPDATE:

To narrow down the behaviour of feature endpoints on high traffic and huge data, I have conducted some more tests and here are the results.

Case 1:

I ran a few tests with a fresh new course for each run and initial data of 100 threads, 10 responses each thread and 7 comments to each response in each course. The percentile shows acceptable numbers as opposed to above results where data was increasing in a single course with each run (see above "with profile image" column). Hence we know the increasing data in any course has directly proportional effect to response percentile.

...

  

GET_comment_list

   

GET_thread

   

GET_thread_list

   

PATCH_comment

   

PATCH_thread

   

POST_comment_comment

   

POST_comment_response

   

POST_thread

   

auto_auth

   


No. of clients = 
req/s = 
Methodsmedian response time95%99%
DELETE_comment
320
 
460
 
530
 
DELETE_thread
200
 
270
 
300
 
GET_comment_list
200300380
   
GET_thread   
GET_thread
190270360
GET_thread_list270680850
PATCH_comment220400500
PATCH_thread210290330
POST_comment_comment380520590
POST_comment_response330460540
POST_thread190260300
auto_auth240320320

No. of clients = 510: (error rate = 560 (1.61%) )

...

 No. of clients = 544: (error rate = 364 (1.57%) )

...

Case 2:

I had created a new fresh course populated in it a huge number of threads, responses and comments (in thousands) and then run GET thread and comment endpoints for both with profile image and without (as these are the only endpoints this changes is reflected in). 

Comparing the two set of results; we can see the difference in 99% for with profile image but I believe the numbers are acceptable, only the last two cases that I have highlighted shows anomaly.

  • For profile image: when no. of clients = 510 shows greater response time than no. of clients = 544. Its reason that I could assume is the users involved in thread and comments for later test are less in number possibly.
  • For without profile image: 
    • 99% for no. of clients = 544 is greater than that of with profile image which is weird.
    • there is an instant rise for clients=544 than for clients=510; to see if its a valid increase I used no. of clients somewhere between the two numbers i.e. 522, but the 99% was even higher than for 544, again weird.
Without Profile Image484.10

error rate = 1(0.03%)

99%210290370170230260250650780autoauth210220
No. of clients = 48
req/s = 4

error rate = 0

480 210 220 22014412

error rate = 0

99% 210290360170 240 270 250 690 830 autoauth230 230 
No. of clients = 144
req/s = 11.4

error rate = 0

500 220 290 29028823.9error rate = 0 220310420180 240 280 260 710 870 autoauth220 230 
No. of clients = 288
req/s = 23.3

error rate = 0

510 230 230 23051042.3error rate = 1(0.00%) 240410 1900190 360 2600 
No. of clients = 510
req/s = 40.8

error rate = 0

640 320 1300 130054444.40

error rate = 0

250 360 480 200 290 390 290 810 
No. of clients = 544
req/s = 45.4

error rate = 0

2500 280 290
With Profile Image
_list   
PATCH_comment   
PATCH_thread   
POST_comment_comment   
POST_comment_response   
POST_thread   
auto_auth   


No. of clients = 
req/s = 
Methodsmedian response time95%99%

DELETE_comment

   

DELETE_thread

   

GET_comment_list

   

GET_thread

   

GET_thread_list

   

PATCH_comment

   

PATCH_thread

   

POST_comment_comment

   

POST_comment_response

   

POST_thread

   

auto_auth

   
No. of clients = 
req/s = 
Methodsmedian response time95%99%

DELETE_comment

   

DELETE_thread

   

GET_comment_list

   

GET_thread

   

GET_thread_list

   

PATCH_comment

   

PATCH_thread

   

POST_comment_comment

   

POST_comment_response

   

POST_thread

   

auto_auth

   
No. of clients = 
req/s = 
Methodsmedian response time95%99%

DELETE_comment

   

DELETE_thread

   

GET_comment_list

   

GET_thread

   

GET_thread_list

   

PATCH_comment

   

PATCH_thread

   

POST_comment_comment

   

POST_comment_response

   

POST_thread

   

auto_auth

   
No. of clients = 
req/s = 
Methodsmedian response time95%
Methodsmedian response time95%99%

DELETE_comment

   

DELETE_thread

   

GET_comment_list

 
 
 

GET_thread

 
 
 

GET_thread_list

 
 
 

PATCH_

comment

 
 
220
Methodsmedian response time95%99%
GET_comment_list 170220250
GET_thread170 230 250 
GET_thread_list180 360 
 

PATCH_thread

   

POST_comment_comment

   

POST_comment_response

   

POST_thread

   

auto_auth

 
 
 
No. of clients = 
req/s = 
Methodsmedian response time
95%
95%99%

DELETE_comment

   

DELETE_thread

   

GET_comment_list

 
 
 

GET_thread

 
 
 

GET_thread_list

 
 
 

PATCH_

comment

 
 
230
Methodsmedian response time95%99%
GET_comment_list160230280
GET_thread170 240 260 
GET_thread_list180 360 
 

PATCH_thread

   

POST_comment_comment

   

POST_comment_response

   

POST_thread

   

auto_auth

 
 
 
No. of clients = 
req/s = 
Methodsmedian response time95%99%

DELETE_comment

   

DELETE_thread

   

GET_comment_list

 
 
 

GET_thread

 
 
 

GET_thread_list

 
 
 

PATCH_

comment

 
 
230
Methodsmedian response time95%99%
GET_comment_list 170230310 
GET_thread180 240 280 
GET_thread_list190 370 
 

PATCH_thread

   

POST_comment_comment

   

POST_comment_response

   

POST_thread

   

auto_auth

 
 
 
No. of clients = 
req/s = 
Methodsmedian response time95%99%

DELETE_comment

   

DELETE_thread

   

GET_comment_list

 
 
 

GET_thread

 
 
 

GET_thread_list

290 880 2000 
auto_auth300 390 390
Methodsmedian response time95%99%
GET_comment_list 180 270580
GET_thread190 290 860 
GET_thread_list200 420 
   

PATCH_comment

   

PATCH_thread

   

POST_comment_comment

   

POST_comment_response

   

POST_thread

   

auto_auth

 
 
 
No. of clients = 
req/s = 
Methodsmedian response time95%99%

DELETE_comment

   

DELETE_thread

   

GET_comment_list

 
 
 

GET_thread

 
 
 

GET_thread_list

 
 
970 
auto_auth280 310 310
Methodsmedian response time95%99%
GET_comment_list 190 4202500
GET_thread200 480 4500 
GET_thread_list210 550 
 

PATCH_comment

   

PATCH_thread

   

POST_comment_comment

   

POST_comment_response

   

POST_thread

   

auto_auth

 
290