Versions Compared

Key

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

...

  • Selecting threads from a smaller pool or selecting the same thread.  Rather than getting the entire list of thread_ids to send requests against, we would just store a random portion of the threads. A test was run to see if matters whether the retrieved thread was random or not, but the sandbox it was run against did not have the correct mongo indexes set up. Regardless, this strategy would not work when trying to DELETE threads as the pool of potential threads would be smaller. Additionally this relies on storing data that must be shared amongst the locust users which could lead to race conditions as a locust user could be trying to GET a thread that another locust user was in the middle of DELETEing. When dealing with much larger file IO operations, it could cause some limitations on the machine that spawns the locusts.
  • Retrieving the list of thread ids when starting locust. This method was effective up until the number of threads in the data set started to increase. As the median number of posts in a course is ~2000, when trying to retrieve 20*(page size max of 100), it would take 20 queries. Additionally, as mentioned in the above strategy, storing data amongst the locust users is not a trivial task. Each locust user would try to generate it's own list of threads which is unacceptable. If a thread was POSTed or DELETEd, only that locust user would have that updated information. Attempts at using the lazy module did not work either as each list of threads was instantiated separately by each locust user. Again, even if the locust users were able to use the same global variables, there would be race conditions. 
  • Calling GET thread_list per DELETE/PATCH/GET_comment. Since the ratio of GET thread_list is significantly higher than any of the other calls, we can achieve the desired distribution of requests for the discussion API.

     

    The table below is a 7 day snapshot on NewRelic for the 

    ActionCount Discussion API Call
    .forum.views:single_thread6759804760GET Thread
    .forum.views:forum_form_discussion2347831653GET Thread List
    .forum.views:inline_discussion1551761093GET Thread List
    create_thread31176220POST Thread
    create_comment27438193POST comment
    create_sub_comment14345101POST comment
    users1382097-
    .forum.views:user_profile1233687-
    .forum.views:followed_threads769854GET Thread List
    vote_for_comment673147PATCH Comment
    vote_for_thread624244PATCH Thread
    upload420830-
    update_comment340324PATCH Comment
    follow_thread387027PATCH Thread
    update_thread282720PATCH Thread
    delete_thread209115DELETE Thread
    endorse_comment12329PATCH Comment
    delete_comment7705DELETE Comment
    flag_abuse_for_comment3733PATCH Comment
    flag_abuse_for_thread1421PATCH Thread
  • Using pre-stored thread_id data. 

Things that were left out:

Moderator actions

  • Pin Thread - Not implemented
  • Open/Close Thread -Not implemented
  • Endorsed - Not Implemented

 Staff vs. Normal User:

    Using users with staff access was thrown into consideration as it would be make some of the permissions a bit more difficult for some discussion forums actions such as editing the body of a thread. Some tests were ran to see if there was a difference. No difference was found the tests that were designed to check for a difference. 

...