Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 11 Next »

Background:

In reference to  MA-2678 - Getting issue details... STATUS ; we have changed forums implementation with following details (for reference; see PR#192):

  1. Changed post/response/comment behaviour to update post's 'last_activity_at' only at time of creation of post and creation of response/comment on a post. Previously post's 'last_activity_at' was being updated for both creation and update.
  2. To calculate 'read' status of a post, used 'last_acitvity_at' instead of 'updated_at'.
  3. To calculate 'unread comment count' for a post, used 'created_at' instead of 'updated_at'.

'unread comment count' was being calculate as:

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

and had a compound index against it
index({_type: 1, comment_thread_id: 1, author_id: 1, updated_at: 1})
 

With new implementation:

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})

 

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

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

New Relic:

Here is the new relic permaLink_new_index and permaLink_old_index

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 = 8.9
Methodsmedian response time95%99%

DELETE_comment

250300480

DELETE_thread

170210230

GET_comment_list

150200320

GET_thread

150190280

GET_thread_list

170360520

PATCH_comment

220320410

PATCH_thread

180360330

POST_comment_comment

290340490

POST_comment_response

250300390

POST_thread

160200370

auto_auth

220230230


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.6
Methodsmedian response time95%99%
DELETE_comment270340360
DELETE_thread170220230
GET_comment_list160210340
GET_thread160200270
GET_thread_list190460600
PATCH_comment220310340
PATCH_thread190260350
POST_comment_comment300370480
POST_comment_response260330420
POST_thread170210340
auto_auth180230230


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.6
Methodsmedian response time95%99%

DELETE_comment

310410590

DELETE_thread

190240250

GET_comment_list

190250380

GET_thread

180250360

GET_thread_list

220530670

PATCH_comment

2603801400

PATCH_thread

220280400

POST_comment_comment

340450540

POST_comment_response

290400510

POST_thread

190240370

auto_auth

210220220


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 = 45.40
Methodsmedian response time95%99%

DELETE_comment

3906501300

DELETE_thread

240370430

GET_comment_list

230350500

GET_thread

230370600

GET_thread_list

270640850

PATCH_comment

3004901200

PATCH_thread

280460640

POST_comment_comment

4106701000

POST_comment_response

360560860

POST_thread

230300500

auto_auth

190220220


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 = 54.3
Methodsmedian response time95%99%

DELETE_comment

1500920012000

DELETE_thread

47041006700

GET_comment_list

51050006800

GET_thread

59065009900

GET_thread_list

58049006800

PATCH_comment

81076001100

PATCH_thread

79054007800

POST_comment_comment

1300930012000

POST_comment_response

1000770010000

POST_thread

47046006400

auto_auth

320320320


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

DELETE_comment

5600980012000

DELETE_thread

370062007900

GET_comment_list

370061008100

GET_thread

5200980013000

GET_thread_list

370068008600

PATCH_comment

480079009500

PATCH_thread

460073009900

POST_comment_comment

5500930011000

POST_comment_response

5000830010000

POST_thread

350060009200

auto_auth

200026002600


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

DELETE_comment

61001000011000

DELETE_thread

350057006400

GET_comment_list

300050005700

GET_thread

420071008700

GET_thread_list

310053006200

PATCH_comment

440078008600

PATCH_thread

410069007600

POST_comment_comment

5700990011000

POST_comment_response

4800850010000

POST_thread

300048005500

auto_auth

170027002700


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

DELETE_comment

77001500027000

DELETE_thread

54001200015000

GET_comment_list

63001400031000

GET_thread

86001900036000

GET_thread_list

64001400032000

PATCH_comment

70001400025000

PATCH_thread

69001600035000

POST_comment_comment

74001500036000

POST_comment_response

70001400026000

POST_thread

60001100032000

auto_auth

290040004400


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

DELETE_comment

76001400019000

DELETE_thread

67001100014000

GET_comment_list

67001100016000

GET_thread

94001600022000

GET_thread_list

70001100017000

PATCH_comment

69001200016000

PATCH_thread

69001200021000

POST_comment_comment

76001400019000

POST_comment_response

72001300018000

POST_thread

67001100015000

auto_auth

240032003300


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

DELETE_comment

95002600032000

DELETE_thread

87002500032000

GET_comment_list

86002200031000

GET_thread

130002700040000

GET_thread_list

86002200032000

PATCH_comment

88002200032000

PATCH_thread

88002000029000

POST_comment_comment

92002400031000

OST_comment_response

93002400032000

POST_thread

83002000032000

auto_auth

360052005500


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

DELETE_comment

91002400032000

DELETE_thread

85002200026000

GET_comment_list

81002200032000

GET_thread

120002600040000

GET_thread_list

83002200032000

PATCH_comment

83002300031000

PATCH_thread

80002300028000

POST_comment_comment

90002400032000

OST_comment_response

85002300032000

POST_thread

83002200032000

auto_auth

410051005400


  • No labels