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 --> 18min = 8.9
Methodsmedian response timemedian response time95%95%99%99%

DELETE_comment

260250310300340480

DELETE_thread

160170200210220230

GET_comment_list

160150200200290320

GET_thread

150150190190260280

GET_thread_list

170170370360520520

PATCH_comment

250220410320410410

PATCH_thread

1901802503601200330

POST_comment_comment

300290390340420490

POST_comment_response

260250320300410390

POST_thread

160160210200310370

auto_auth

190220190230190230
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  27min = 18.6
Methodsmedian response timemedian response time95%95%99%99%
DELETE_comment280270370340440360
DELETE_thread180170220220270230
GET_comment_list170160230210350340
GET_thread160160220200300270
GET_thread_list210190500460640600
PATCH_comment2502203603101400340
PATCH_thread200190280260380350
POST_comment_comment320300400370510480
POST_comment_response270260350330430420
POST_thread170170220210260340
auto_auth190180260230260230
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    31.6
Methodsmedian response timemedian response time95%95%99%99%

DELETE_comment

350310500410660590

DELETE_thread

210190300240390250

GET_comment_list

210190350250460380

GET_thread

210180320250430360

GET_thread_list

250220620530800670

PATCH_comment

2902604403805701400

PATCH_thread

260220430280580400

POST_comment_comment

380340560450710540

POST_comment_response

330290480400610510

POST_thread

210190310240430370

auto_auth

210210230220230220
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   45.40
Methodsmedian response timemedian response time95%95%99%99%

DELETE_comment

540390100065018001300

DELETE_thread

3402406803702000430

GET_comment_list

3402307503501500500

GET_thread

3402307103701500600

GET_thread_list

41027010006401700850

PATCH_comment

42030080049013001200

PATCH_thread

4002807504601300640

POST_comment_comment

580410110067025001000

POST_comment_response

5003609405601600860

POST_thread

3402307103001000500

auto_auth

490190610220610220
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  54.3
Methodsmedian response timemedian response time95%95%99%99%

DELETE_comment

2300150034009200440012000

DELETE_thread

17004702600410032006700

GET_comment_list

19005102900500039006800

GET_thread

18005902800650037009900

GET_thread_list

23005805200490068006800

PATCH_comment

22008103200760042001100

PATCH_thread

19007903200540055007800

POST_comment_comment

2400130035009300430012000

POST_comment_response

2200100032007700390010000

POST_thread

18004702800460036006400

auto_auth

180032021003202100320

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


51032477001500027000540012000150006300140003100086001900036000640014000320007000140002500069001600035000740015000360007000140002600060001100032000290040004400510 30min = 33.9 7600 14000 19000 6700 11000 14000 6700 11000 16000 9400 16000 22000 7000 11000 17000 6900 12000 16000 6900 12000 21000 7600 14000 19000 7200 13000 18000 6700 11000 15000 2400 3200 3300                                                                                                                                                                                                                                                                         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 = 32.4   21min = 49.18.9
760038000430006700260004100072003800042000100004200047000760040000430007300280004300073002700043000780041000430007800380004200069002800042000430048005400
Methodsmedian response timemedian response time95%95%99%99%

DELETE_comment

25061002703001000047048011000520

DELETE_thread

170350016021057003002306400310

GET_comment_list

150300016020050002603205700350

GET_thread

150420015019071002502808700310

GET_thread_list

170310019036053003705206200530

PATCH_comment

220440024032078004004108600460

PATCH_thread

180410019036069003003307600330

POST_comment_comment

2905700310340990051049011000680

POST_comment_response

2504800260300850045039010000520

POST_thread

160300016020048002503705500340

auto_auth

220170021023027002302302700230


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_comment
270
280
340
360
360
980
DELETE_thread
170
170
220
230
230
290
GET_comment_list
160
160
210
220
340
400
GET_thread
160
160
200
210
270
340
GET_thread_list
190
190
460
460
600
640
PATCH_comment
220
230
310
310
340
460
PATCH_thread
190
200
260
280
350
1000
POST_comment_comment
300
310
370
410
480
680
POST_comment_response
260
260
330
350
420
620
POST_thread
170
170
210
210
340
330
auto_auth
180
210
230
220
230
220


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

DELETE_comment

95003202600040032000490

DELETE_thread

87001902500024032000280

GET_comment_list

86001902200025031000370

GET_thread

130001902700025040000340

GET_thread_list

86002202200052032000660

PATCH_comment

88002702200036032000390

PATCH_thread

88002302000031029000370

POST_comment_comment

92003502400045031000540

OSTPOST_comment_response

93003002400040032000490

POST_thread

83001902000024032000340

auto_auth

360020052002005500200


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

DELETE_comment

310910032041024000420 59032000530

DELETE_thread

190850019024022000230 25026000250

GET_comment_list

190810019025022000250 38032000380

GET_thread

1801200018025026000250 36040000340

GET_thread_list

220830021053022000520 67032000660

PATCH_comment

260830025038023000360 140031000430

PATCH_thread

220800023028023000310 40028000370

POST_comment_comment

340900034045024000470 54032000620

POST_comment_response

290850029040023000400 51032000550

POST_thread

190830019024022000230 37032000360

auto_auth

21041002002205100200 2205400200


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
Methodsmedian response timemedian response time95%95%99%99%

DELETE_comment

   

39041065069013001100

DELETE_thread

   240230370280430340

GET_comment_list

   GET_thread   

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

   

POST_comment_comment

  

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