Versions Compared

Key

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

...

Another test was to be run against a small course, without any thread creation. 

Anchor
ramping_course
ramping_course

Expand
titleTests for smaller course which gradually grew

The next course used was BerkeleyX/CS.CS169.1x/3T2013 (783 threads, 3385 comments at the time). Unlike the loadtest with the very large course "BerkeleyX/ColWri2.2x/1T2014", the server was able to handle the requests without returning 500s. These numbers seem more reasonable. The test ran for 1 hour.

 

Name
reqs
#
fails
Avg
Min
Max
Median
req/s
95%
GETGET_comment_list17180(0.00%)45916317834100.1950
GETGET_thread1062530(0.00%)195153230218010.3270
GETGET_thread_list610090(0.00%)59515540644606.81700
PATCHPATCH_comment17190(0.00%)59320821225200.11100
PATCHPATCH_thread188319(1.00%)40316622833600.3810
POSTPOST_comment_comment13730(0.00%)96659142619000.11600
POSTPOST_comment_response41350(0.00%)92854641948600.51600
POSTPOST_thread46880(0.00%)49242441024600.4610

As the loadtest continued, the 95th and 50th percentile gradually became slower and slower. The throughput was very high compared to that of production (~100rpm for a similar call /django_comment_client.forum.views:single_thread) so the test will be rerun with less load.

After analyzing this data, it was realized that the number of posts in this course had actually altered the response times of the http requests. The course had increased about 2-3 times. In a week, about 20,000 threads, 20,000 responses, and 10,000 comments are created in ALL COURSES. In this 1 hour test, we have created a fifth of that value against a single course. Take note that the following tests were against the same course, but with the new increased post count.

 

The test below was against the same course but at half the throughput. As shown on the graph, the response times were slower. This test ran for 30 minutes. Again, we see that the response times increases slowly as the RPMs decreases appropriately.

Namereqs#failsAvgMinMaxMedianreq/s95%
GETGET_comment_list3060(0.00%)51717912274900.1910
GETGET_thread196020(0.00%)19815024031804.2320
GETGET_thread_list111501(0.01%)91515640267703.81900
PATCHPATCH_comment3060(0.00%)768423200769001200
PATCHPATCH_thread3702(0.54%)50825320434800890
POSTPOST_comment_comment2680(0.00%)1139775255611000.11500
POSTPOST_comment_response7350(0.00%)1108715257310000.11500
POSTPOST_thread8330(0.00%)47841619254500600

 



...

Expand
titleRerun of mixed courses test after first index was added

This is before adding the "asc" index and after adding the "last_activity_at" index. The major difference is the lack of spikes, consistent RPM, better response times especially for the large course and no 500s.

This test was run for 3 minutes with a small course vs large course on a 20:1 ratio. The large course used is BerkeleyX/ColWri2.2x/1T2014 (~38,000 threads, ~40,000 comments) , while the small course is SMES/ASLCx/1T2015 (1700 Threads, 3047 comments). 

Namereqs#failsAvgMinMaxMedianreq/s95%
LargeGET_comment_list460(0.00%)44320711553700840
 GET_thread24040(0.00%)22516812752100.7290
 GET_thread_list12960(0.00%)48918111044800.6830
 PATCH_comment450(0.00%)49022120604500780
 PATCH_thread530(0.00%)48917419124100.11100
SmallGET_comment_list8770(0.00%)21115410722000.3300
 GET_thread557102(0.00%)198141156219028.2260
 GET_thread_list296940(0.00%)449147391943013.2810
 PATCH_comment8754(0.46%)34018415843200.2560
 PATCH_thread10389(0.86%)25915010552400.5420

Page size vs. Response time: 
Anchor
psvrt
psvrt

    In a new test, it was found that SMES/ASLCx/1T2015 (1700 Threads, 3047 comments) was slowing down over time. To identify what was happening, a new course was seeded which we will call DAPI (1000 Threads, 500 comments). In the analysis of the forums, we saw that the median body size was 250 characters. Our PATCH operations can be 4, 250, 1000, 5000, or 10000 characters. This test was run over 10 hours. The decrease in response time needed to be addressed.

Expand
titlepage size vs response time

Over time DAPI (1000 threads, 500 comments) slowed down over time.

Namereqs#failsAvgMinMaxMedianreq/s95%
GETGET_comment_list157930(0.00%)22016231162000.2340
GETGET_thread9550971(0.00%)214-8450920023.8290
GETGET_thread_list5109210(0.00%)44515559542011.6810
PATCHPATCH_comment157920(0.00%)33718738513200.2490
PATCHPATCH_thread17333164(0.94%)27316130192500.5400

When running a similar test with a more verbose output, we clearly saw that the page size had an effect on the response time. Although not shown here, larger content size was somewhat correlated to slower response times, but page_size had the better correlation.

Namereqs#failsAvgMinMaxMedianreq/s95%
GETpage=1&page_size=1002380(0.00%)79165519907500.4960
GETpage=2&page_size=1002820(0.00%)76265915267300.4910
GETpage=1&page_size=752400(0.00%)65154410386200.2830
GETpage=2&page_size=752550(0.00%)67757316286500820
GETpage=7&page_size=1002600(0.00%)56846126375200.4710
GETpage=6&page_size=1002320(0.00%)5594668435200.1710
GETpage=9&page_size=1002220(0.00%)56846019075300.5700
GETpage=3&page_size=1002620(0.00%)55646218075200.2700
GETpage=5&page_size=1002590(0.00%)55646313755100.3700
GETpage=4&page_size=1002760(0.00%)5554568405200.2690
GETpage=8&page_size=1002360(0.00%)5484689035200.1680
GETpage=3&page_size=752510(0.00%)54344513485100.3670
GETpage=2&page_size=502780(0.00%)50741511414800.5670
GETpage=1&page_size=502510(0.00%)51242510434900.1660
GETpage=8&page_size=752370(0.00%)48139716444400.1650
GETpage=3&page_size=502470(0.00%)5234519035000.4640
GETpage=6&page_size=752380(0.00%)49239816344500.3640
GETpage=4&page_size=752180(0.00%)4803958864400.2630
GETpage=7&page_size=752270(0.00%)4743917954400.5620
GETpage=5&page_size=752390(0.00%)46638813944400.2610
GETpage=4&page_size=502370(0.00%)45337110104200.2610
GETpage=9&page_size=752160(0.00%)4673979964300.4600
GETpage=6&page_size=502520(0.00%)39132110653600.4540
GETpage=5&page_size=252490(0.00%)39232313673700.4530
GETpage=7&page_size=502430(0.00%)3923199973600.4530
GETpage=9&page_size=502210(0.00%)3913306583600520
GETpage=8&page_size=502410(0.00%)38831713003600.4520
GETpage=5&page_size=502040(0.00%)3863227233600.1520
GETpage=2&page_size=252590(0.00%)36329911243400.4520
GETpage=1&page_size=252420(0.00%)37329611423500.4510
GETpage=4&page_size=252380(0.00%)36129211713400.3500
GETpage=6&page_size=252560(0.00%)3653126873500.3480
GETpage=3&page_size=252320(0.00%)3563027523400.9480
GETpage=7&page_size=252610(0.00%)3623105903500.1470
GETpage=9&page_size=252740(0.00%)3042547972800.3430
GETpage=8&page_size=252320(0.00%)3002536442800420
GETpage=8&page_size=12350(0.00%)22819110252100320
GETpage=3&page_size=12550(0.00%)23518511062200.2310
GETpage=9&page_size=12480(0.00%)23418411472100.3310
GETpage=5&page_size=12470(0.00%)2331868512200.5300
GETpage=7&page_size=12310(0.00%)23418821042200.3290
GETpage=2&page_size=12510(0.00%)2261879722200.4290
GETpage=1&page_size=12550(0.00%)2231864612100.3290
GETpage=4&page_size=12600(0.00%)2221884002100.3290
GETpage=6&page_size=12660(0.00%)2211873732200.1280

Pagination: GETting a single threads vs comment_count 
Anchor
pagination
pagination

    This tests takes the course BerkeleyX/ColWri2.2x/1T2014 (~38,000 threads, ~40,000 comments) and then retrieves a single thread. This thread is then grouped by its comment_count. This test was run for 1 hour. As expected, because of pagination issues, threads with more comments are taking longer to return. 

Expand
titleGET thread vs comment_count

Note that the slow transactions are the same thread. Comment_count is also linearly correlated. There is a case where the comment_count was ~4000. The approximate formula to calculate the response time for this context is (comment_count*1.4+360). A thread with ~4000 comments would take approximately 8200ms.

Image Added

Namereqs#failsAvgMinMaxMedianreq/s95%
GETComment_Range:0-25215670(0.00%)33026320503205.7420
GETComment_Range:25-5036480(0.00%)3582809323401.1460
GETComment_Range:50-758020(0.00%)3913089193700.7510
GETComment_Range:75-1004460(0.00%)4243258594000.1570
GETComment_Range:100-12511140(0.00%)44434916134200.2590
GETComment_Range:125-150560(0.00%)4863917624700700
GETComment_Range:150-17517450(0.00%)51840310295000.3720
GETComment_Range:175-20016100(0.00%)53240014875100.5730
GETComment_Range:225-2508530(0.00%)59545613895700.2830
GETComment_Range:350-3758500(0.00%)74056018537000.11000
GETComment_Range:375-4008280(0.00%)77257319267200.31100
GETComment_Range:1575-16008790(0.00%)21941740473121000.23100

...