Versions Compared

Key

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

Background:

In reference to 

Jira Legacy
serverJIRA (openedx.atlassian.net)
serverId13fd1930-5608-3aac-a5dd-21b934d3a4b4
keyMA-2678
; we have changed forums implementation with following details (for reference; see PR#192):

...

unread_comment_count = Comment.collection.find(:comment_thread_id => t._id, :author_id => {"$ne" => user.id}, :created_at => {"$gte" => read_dates[thread_key]}).count

So, we removed index
index({_type: 1, comment_thread_id: 1, author_id: 1, updated_at: 1})

and added a new one

index({comment_thread_id: 1, author_id: 1, created_at: 1})

...

Results:

The load tests were run on 4x c4.2xlarge instances for lms and 3x m4.large instances for forums.

The results of load tests below show difference differences between the old and new implementation.

The load tests were run on 4x c4.2xlarge instances.

 

 

 

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_new_index and permaLink_old_index

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.

 

...

Old Index

...

New Index

...

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

DELETE_comment

250

3101200

DELETE_thread

160

190200

GET_comment_list

150190310

GET_thread

140180220

GET_thread_list

160370520

PATCH_comment

2303601200

PATCH_thread

190240370

POST_comment_comment

290360430

POST_comment_response

250310450

POST_thread

160190200

auto_auth

200250250
No. of clients = 48
req/s = 9.6
Methodsmedian response time95%95%99%99%

DELETE_comment

260310 340 

DELETE_thread

160200 220 

GET_comment_list

160200 290 

GET_thread

150190 260 

GET_thread_list

170370 520 

PATCH_comment

250410 410 

PATCH_thread

190250 1200 

POST_comment_comment

300390 420 

POST_comment_response

260320 410 

POST_thread

160210 310 

auto_auth

190190 190 
No. of clients = 96
req/s = 18.5
Methodsmedian response time95%99%
DELETE_comment

270

340390
DELETE_thread170230330
GET_comment_list170210330
GET_thread160200250
GET_thread_list190440610
PATCH_comment240330360
PATCH_thread200260350
POST_comment_comment310380470
POST_comment_response260330440
POST_thread170210340
auto_auth180220220
No. of clients = 96
req/s = 18.7
Methodsmedian response time95%95%99%99%
DELETE_comment280370 440 
DELETE_thread180220 270 
GET_comment_list170230 350 
GET_thread160220 300 
GET_thread_list210500 640 
PATCH_comment250360 1400 
PATCH_thread200280 380 
POST_comment_comment320400 510 
POST_comment_response270350 430 
POST_thread170220 260 
auto_auth190260 260 
No. of clients = 162
req/s = 31
Methodsmedian response time95%99%

DELETE_comment

320400490

DELETE_thread

190240280

GET_comment_list

190250370

GET_thread

190250340

GET_thread_list

220520660

PATCH_comment

270360390

PATCH_thread

230310370

POST_comment_comment

350450540

POST_comment_response

300400490

POST_thread

190240340

auto_auth

200200200
No. of clients = 162
req/s = 31.5
Methodsmedian response time95%95%99%99%

DELETE_comment

350500 660 

DELETE_thread

210300 390 

GET_comment_list

210350 460 

GET_thread

210320 430 

GET_thread_list

250620 800 

PATCH_comment

290440 570 

PATCH_thread

260430 580 

POST_comment_comment

380560 710 

POST_comment_response

330480 610 

POST_thread

210310 430 

auto_auth

210230 230 
No. of clients = 240
req/s = 44.6
Methodsmedian response time95%99%

DELETE_comment

400600700

DELETE_thread

240320530

GET_comment_list

240350480

GET_thread

240360470

GET_thread_list

270630800

PATCH_comment

330510600

PATCH_thread

290420530

POST_comment_comment

420640820

POST_comment_response

360560730

POST_thread

240310440

auto_auth

210210210
No. of clients = 240
req/s = 44.7
Methodsmedian response time95%95%99%99%

DELETE_comment

5401000 1800 

DELETE_thread

340680 2000 

GET_comment_list

340750 1500 

GET_thread

340710 1500 

GET_thread_list

4101000 1700 

PATCH_comment

420800 1300 

PATCH_thread

400750 1300 

POST_comment_comment

5801100 2500 

POST_comment_response

500940 1600 

POST_thread

340710 1000 

auto_auth

490610 610 
No. of clients = 336
req/s = 53
Methodsmedian response time95%99%

DELETE_comment

250055006500

DELETE_thread

98023002900

GET_comment_list

80021002700

GET_thread

92027003300

GET_thread_list

85024003300

PATCH_comment

150039005000

PATCH_thread

120034004100

POST_comment_comment

230054007000

POST_comment_response

170044005900

POST_thread

74020002700

auto_auth

33013001300
No. of clients = 336
req/s = 48.9
Methodsmedian response time95%95%99%99%

DELETE_comment

23003400 4400 

DELETE_thread

17002600 3200 

GET_comment_list

19002900 3900 

GET_thread

18002800 3700 

GET_thread_list

23005200 6800 

PATCH_comment

22003200 4200 

PATCH_thread

19003200 5500 

POST_comment_comment

24003500 4300 

POST_comment_response

22003200 3900 

POST_thread

18002800 3600 

auto_auth

18002100 2100 

The two set of results looks quite similar except when it reaches "No. of clients = 336"; where there is huge difference between old and new percentiles as well as sudden rise in percentile for both old and new index with respect to "No. of clients = 224". For all the next tests (i.e. No. of clients = 460, No. of clients = 510, No. of clients = 578), the difference between old and new percentile is minimised and the new index results have lower percentile for most of the endpoints.

I have captured new relic charts too; permaLink_old_index with average rpm = 1.86k and permaLink_new_index with average rpm = 1.81k


51032477001500027000540012000150006300140003100086001900036000640014000320007000140002500069001600035000740015000360007000140002600060001100032000290040004400                                                                                                                                                            list                                                                                                                                                                     POST                                 POST         

Old Index

New Index

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

DELETE_comment

5600

250

9800310120001200

DELETE_thread

3700

160

62001907900200

GET_comment_list

370015061001908100310

GET_thread

5200140980018013000220

GET_thread_list

370016068003708600520

PATCH_comment

4800230790036095001200

PATCH_thread

460019073002409900370

POST_comment_comment

5500290930036011000430

POST_comment_response

5000250830031010000450

POST_thread

350016060001909200200

auto_auth

200020026002502600250
No. of clients = 46048
req/s = 328.49
760038000430006700260004100072003800042000100004200047000760040000430007300280004300073002700043000780041000430007800380004200069002800042000430048005400
Methodsmedian response timemedian response time95%95%99%99%

DELETE_comment

250270300 470480 520

DELETE_thread

170160210 300230 310

GET_comment_list

150160200 260320 350

GET_thread

150150190 250280 310

GET_thread_list

170190360 370520 530

PATCH_comment

220240320 400410 460

PATCH_thread

180190360 300330 330

POST_comment_comment

290310340 510490 680

POST_comment_response

250260300 450390 520

POST_thread

160160200 250370 340

auto_auth

220210230 230230 230


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

270

340
390
DELETE_thread
170
230
330
GET_comment_list
170
210
330
GET_thread
160
200
250
GET_thread_list
190
440
610
PATCH_comment
240
330
360
PATCH_thread
200
260
350
POST_comment_comment
310
380
470
POST_comment_response
260
330
440
POST_thread
170
210
340
auto_auth
180
220
220


No. of clients = 96
req/s = 18.6
Methodsmedian response timemedian response time95%95%99%99%
DELETE_comment270
280
340
360
360
980
DELETE_thread170
170
220
230
230
290
GET_comment_list160
160
210
220
340
400
GET_thread160
160
200
210
270
340
GET_thread_list190
190
460
460
600
640
PATCH_comment
220230
310
310
340
460
PATCH_thread190
200
260
280
350
1000
POST_comment_comment300
310
370
410
480
680
POST_comment_response260
260
330
350
420
620
POST_thread170
170
210
210
340
330
auto_auth
180210
230
220
230
220


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

DELETE_comment

 320 400 490

DELETE_thread

 190 240 280

GET_comment_list

 190 250 370

GET_thread

 190 250 340

GET_thread_list

 220 520 660

PATCH_comment

 270 360 390

PATCH_thread

 230 310 370

POST_comment_comment

 350 450 540

OSTPOST_comment_response

 300 400 490

POST_thread

 190 240 340

auto_auth

 200 200 200


No. of clients = 162
req/s = 31.6
                OST      
Methodsmedian response timemedian response time95%95%99%99%

DELETE_comment

310320410 420 590 530

DELETE_thread

190190240 230 250 250

GET_comment_list

190190250 250 380 380

GET_thread

180180250 250 360 340

GET_thread_list

220210530 520 670 660

PATCH_comment

260250380 360 1400 430

PATCH_thread

220230280 310 400 370

POST_comment_comment

340340450 470 540 620

POST_comment_response

290290400 400 510 550

POST_thread

190190240 230 370 360

auto_auth

210200220 200 220 200


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

DELETE_comment

 400 600 700

DELETE_thread

 240 320 530

GET_comment_list

 240 350 480

GET_thread

 240 360 470

GET_thread_list

 270 630 800

PATCH_comment

 330 510 600

PATCH_thread

 290 420 530

POST_comment_comment

 420 640 820

POST_comment_response

 360 560 730

POST_thread

 240 310 440

auto_auth

 210 210 210


No. of clients = 240
req/s = 45.40
_list
Methodsmedian response timemedian response time95%95%99%99%

DELETE_comment

   

39041065069013001100

DELETE_thread

   

240230370280430340

GET_comment_list

   230240350350500480

GET_thread

   

230240370370600520

GET_thread

   

_list

270270640630850790

PATCH_comment

   

3003104904801200610

PATCH_thread

   

280290460470640630

POST_comment_comment

   4104306706601000970

POST_comment_response

   

360360560600860850

POST_thread

   

230230300310500430

auto_auth

   190210220220220220



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

DELETE_comment

560
7900
10000

DELETE_thread

280
620
5200

GET_comment_list

300
3100
4000

GET_thread

310
3400
5000

GET_thread_list

330
3000
4200

PATCH_comment

400
1700
6500

PATCH_thread

380
5100
6300

POST_comment_comment

560
7900
10000

POST_comment_response

470
6100
8200

POST_thread

290
2900
3900
auto_auth
320
320
320

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

DELETE_comment

1600
4600
5900

DELETE_thread

460
1600
2500

GET_comment_list

480
1300
1900

GET_thread

560
2100
2900

GET_thread_list

530
1700
2500

PATCH_comment

800
2800
3500

PATCH_thread

710
2700
3600

POST_comment_comment

1400
4300
5500

POST_comment_response

1000
3600
4800

POST_thread

430
1100
1700
auto_auth
240
250
250
No. of clients = 336
req/s = 53
Methodsmedian response time95%99%

DELETE_comment

2500
5500
6500

DELETE_thread

980
2300
2900

GET_comment_list

800
2100
2700

GET_thread

920
2700
3300

GET_thread_list

850
2400
3300

PATCH_comment

1500
3900
5000

PATCH_thread

1200
3400
4100

POST_comment_comment

2300
5400
7000

POST_comment_response

1700
4400
5900

POST_thread

740
2000
2700

auto_auth

330
1300
1300


No. of clients = 336
req/s = 54.3
Methodsmedian response timemedian response time95%95%99%99%

DELETE_comment

  
15005300920096001200011000

DELETE_thread

  

47023004100460067005100

GET_comment_

  

list

51018005000370068004500

GET_thread

  
59021006500480099005700

GET_thread_list

  

58018004900390068004800

PATCH_comment

  

81035007600640011009700

PATCH_thread

  

79029005400630078007300

POST_comment_comment

  

13004800930093001200011000

POST_comment_response

  
1000370077007800100009600

POST_thread

  

47017004600350064004000

auto_auth

  

320710320830320830


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

DELETE_comment

5600
9800
12000

DELETE_thread

3700
6200
7900

GET_comment_list

3700
6100
8100

GET_thread

5200
9800
13000

GET_thread_list

3700
6800
8600

PATCH_comment

4800
7900
9500

PATCH_thread

4600
7300
9900

POST_comment_comment

5500
9300
11000

POST_comment_response

5000
8300
10000

POST_thread

3500
6000
9200

auto_auth

2000
2600
2600


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

DELETE_comment

6100
10000
11000

DELETE_thread

3500
5700
6400

GET_comment_list

3000
5000
5700

GET_thread

4200
7100
8700

GET_thread_list

3100
5300
6200

PATCH_comment

4400
7800
8600

PATCH_thread

4100
6900
7600

POST_comment_comment

5700
9900
11000

POST_comment_response

4800
8500
10000

POST_thread

3000
4800
5500

auto_auth

1700
2700
2700


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

DELETE_comment

7700
15000
27000

DELETE_thread

5400
12000
15000

GET_comment_list

6300
14000
31000

GET_thread

8600
19000
36000

GET_thread_list

6400
14000
32000

PATCH_comment

7000
14000
25000

PATCH_thread

6900
16000
35000

POST_comment_comment

7400
15000
36000

POST_comment_response

7000
14000
26000

POST_thread

6000
11000
32000

auto_auth

2900
4000
4400


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

DELETE_comment

7600
14000
19000

DELETE_thread

6700
11000
14000

GET_comment_list

6700
11000
16000

GET_thread

9400
16000
22000

GET_thread_list

7000
11000
17000

PATCH_comment

6900
12000
16000

PATCH_thread

6900
12000
21000

POST_comment_comment

7600
14000
19000

POST_comment_response

7200
13000
18000

POST_thread

6700
11000
15000

auto_auth

2400
3200
3300


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

DELETE_comment

9500
26000
32000

DELETE_thread

8700
25000
32000

GET_comment_list

8600
22000
31000

GET_thread

13000
27000
40000

GET_thread_list

8600
22000
32000

PATCH_comment

8800
22000
32000

PATCH_thread

8800
20000
29000

POST_comment_comment

9200
24000
31000

OST_comment_response

9300
24000
32000

POST_thread

8300
20000
32000

auto_auth

3600
5200
5500


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

DELETE_comment

9100
24000
32000

DELETE_thread

8500
22000
26000

GET_comment_list

8100
22000
32000

GET_thread

12000
26000
40000

GET_thread_list

8300
22000
32000

PATCH_comment

8300
23000
31000

PATCH_thread

8000
23000
28000

POST_comment_comment

9000
24000
32000

OST_comment_response

8500
23000
32000

POST_thread

8300
22000
32000

auto_auth

4100
5100
5400