Affects Version/s: 0.9.179
Fix Version/s: 0.9.187
Current when under high load the systems takes a long time to post new works, this is really only apparent when multiple people are posting works which share the same tag.
Currently posting takes a long time as the following query takes around 2 minutes:
UPDATE `tags` SET `taggings_count` = COALESCE(`taggings_count`, 0) + 1 WHERE `tags`.`type` IN ('Rating') AND `tags`.`id` = 11
So my plan is to remove taggings_count as a field in the db and make it a method with some smart caching.
- Tags with less than 999 uses are small and should not be cached
- Tags with 1,000-39,999 uses are medium and should be cached for a variable period of time (3-40 minutes)
- Tags with 40,000 uses or more are large and should be cached for 30 minutes
You will want to find a tag in each of these categories, and then go to the edit page for that tag (http://test.archiveofourown.org/tags/Tag%A/edit) before you post. Note the number listed in "Taggings Count (#)" in the sidebar.
Now post the work.
Then reload the edit page. The "Taggings Count (#)" should change immediately for the small tag, but it should not change for the medium and large tags until the caching period (3-40 minutes) is up.
Also check that you can access the pages linked in the sidebar on http://test.archiveofourown.org/tag_wranglings:
- Fandoms by media (#) http://test.archiveofourown.org/tag_wranglings?show=fandoms
- Characters by fandom (#) http://test.archiveofourown.org/tag_wranglings?show=characters
- Relationships by fandom (#) http://test.archiveofourown.org/tag_wranglings?show=relationships
- Freeforms by fandom (#) http://test.archiveofourown.org/tag_wranglings?show=freeforms
- Unsorted Tags (#) http://test.archiveofourown.org/unsorted_tags
On each of those pages, make sure you can sort tags by their taggings count. Click the "↓ Taggings" link at the top of the table (between the Canonical and Manage columns) to sort.