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):
- 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.
- To calculate 'read' status of a post, used 'last_acitvity_at' instead of 'updated_at'.
- 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
| |
---|
No. of clients = 48 req/s = 9.4 Methods | median response time | 95% | 99% |
---|
DELETE_comment | 250 | 310 | 1200 | DELETE_thread | 160 | 190 | 200 | GET_comment_list | 150 | 190 | 310 | GET_thread | 140 | 180 | 220 | GET_thread_list | 160 | 370 | 520 | PATCH_comment | 230 | 360 | 1200 | PATCH_thread | 190 | 240 | 370 | POST_comment_comment | 290 | 360 | 430 | POST_comment_response | 250 | 310 | 450 | POST_thread | 160 | 190 | 200 | auto_auth | 200 | 250 | 250 |
| No. of clients = 48 req/s = 8.9 Methods | median response time | 95% | 99% |
---|
DELETE_comment | 250 | 300 | 480 | DELETE_thread | 170 | 210 | 230 | GET_comment_list | 150 | 200 | 320 | GET_thread | 150 | 190 | 280 | GET_thread_list | 170 | 360 | 520 | PATCH_comment | 220 | 320 | 410 | PATCH_thread | 180 | 360 | 330 | POST_comment_comment | 290 | 340 | 490 | POST_comment_response | 250 | 300 | 390 | POST_thread | 160 | 200 | 370 | auto_auth | 220 | 230 | 230 |
|
No. of clients = 96 req/s = 18.5 Methods | median response time | 95% | 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 Methods | median response time | 95% | 99% |
---|
DELETE_comment | 270 | 340 | 360 | DELETE_thread | 170 | 220 | 230 | GET_comment_list | 160 | 210 | 340 | GET_thread | 160 | 200 | 270 | GET_thread_list | 190 | 460 | 600 | PATCH_comment | 220 | 310 | 340 | PATCH_thread | 190 | 260 | 350 | POST_comment_comment | 300 | 370 | 480 | POST_comment_response | 260 | 330 | 420 | POST_thread | 170 | 210 | 340 | auto_auth | 180 | 230 | 230 |
|
No. of clients = 162 req/s = 31 Methods | median response time | 95% | 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 | POST_comment_response | 300 | 400 | 490 | POST_thread | 190 | 240 | 340 | auto_auth | 200 | 200 | 200 |
| No. of clients = 162 req/s = 31.6 Methods | median response time | 95% | 99% |
---|
DELETE_comment | 310 | 410 | 590 | DELETE_thread | 190 | 240 | 250 | GET_comment_list | 190 | 250 | 380 | GET_thread | 180 | 250 | 360 | GET_thread_list | 220 | 530 | 670 | PATCH_comment | 260 | 380 | 1400 | PATCH_thread | 220 | 280 | 400 | POST_comment_comment | 340 | 450 | 540 | POST_comment_response | 290 | 400 | 510 | POST_thread | 190 | 240 | 370 | auto_auth | 210 | 220 | 220 |
|
No. of clients = 240 req/s = 44.6 Methods | median response time | 95% | 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 Methods | median response time | 95% | 99% |
---|
DELETE_comment | 390 | 650 | 1300 | DELETE_thread | 240 | 370 | 430 | GET_comment_list | 230 | 350 | 500 | GET_thread | 230 | 370 | 600 | GET_thread_list | 270 | 640 | 850 | PATCH_comment | 300 | 490 | 1200 | PATCH_thread | 280 | 460 | 640 | POST_comment_comment | 410 | 670 | 1000 | POST_comment_response | 360 | 560 | 860 | POST_thread | 230 | 300 | 500 | auto_auth | 190 | 220 | 220 |
|
No. of clients = 336 req/s = 53 Methods | median response time | 95% | 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 Methods | median response time | 95% | 99% |
---|
DELETE_comment | 1500 | 9200 | 12000 | DELETE_thread | 470 | 4100 | 6700 | GET_comment_list | 510 | 5000 | 6800 | GET_thread | 590 | 6500 | 9900 | GET_thread_list | 580 | 4900 | 6800 | PATCH_comment | 810 | 7600 | 1100 | PATCH_thread | 790 | 5400 | 7800 | POST_comment_comment | 1300 | 9300 | 12000 | POST_comment_response | 1000 | 7700 | 10000 | POST_thread | 470 | 4600 | 6400 | auto_auth | 320 | 320 | 320 |
|
No. of clients = 460 req/s = 44.5 Methods | median response time | 95% | 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 Methods | median response time | 95% | 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 Methods | median response time | 95% | 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 Methods | median response time | 95% | 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 Methods | median response time | 95% | 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 Methods | median response time | 95% | 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 |
|