Jump to content

Data Platform/Systems/AQS/Scaling/2020/Cluster Expansion

From Wikitech

Goals

Expand the current AQS Restbase cluster with more hosts to grow available storage space. Main reason for growth are first to make sure the currently served data can continue to be handled, and second to extend the service to serve historical pagecounts.

Current cluster

  • aqs100[456789].eqiad.wmnet
  • Two Cassandra instances per node.
  • Cassandra 2.2.6

https://phabricator.wikimedia.org/T173720

https://phabricator.wikimedia.org/T193759

Storage considerations

Current State (2020-03-06)

The 6 current hosts handle about 19Tb of data representing bout 55% of the available space. Most (99.7%) of the storage is used by three tables (see this graph):

tablestorage taken (Tb)storage taken (%)Description
local_group_default_T_pageviews_per_article_flat.data11.8960.4%4 years and 8 month of pageviews per-article daily
local_group_default_T_mediarequest_per_file.data6.7234.1%5 years and 2 month of mediarequest per-file daily
local_group_default_T_top_pageviews.data0.1035.2%4 years and 8 month of pageviews top-articles daily and monthly

Based on those those number, an approximate growing rate for our current datasets is an additional 4Tb per year.

Adding pagecounts

We would like to add the historical per-article daily pagecounts dataset to the api (see related task above). This data being similar to the currently existing pageviews per-article daily, we use the later as a basis for the capacity planning of the former.

Pagecounts data is available from 2008 onward, and will stop at 2015-06 when pageviews starts. this represent 7 years and six month of data. In order to represent growth over time (the number of pageviews was lower in 2008), we have computed the number of rows (distinct wiki, page_title and day) to be loaded in cassandra for every Januray month, both for pagecounts (2008 to 2015) and pageviews (2016 to 2020). We have taken the average linear growth between years as a basis for monthly-rows to be loaded for every month of the given year: Rows-Jan-Y * 12 + (Rows Jan Y+1 - Rows-Jan-Y), and based of the storage taken for pageviews, we have computed expected storage taken by by pagecounts (we have used the same method for incomplete years by mulitplying by the number of month instead of 12, and didn't apply any variation to the 2020 year as it only represents 2 month).

With the method described, we end up with every row stored for pageview per-article daily weighting on average 96 bytes, leading to an additional storage of ~14.7Tb (123% of currently stored pageviews) to add the historical pagecounts per-article daily.

Without going into similar details, we can assume that the top-pagecounts for the same period should weight a similar ratio of top-pageviews, therefore approximately 130Gb.

Pageviews

datemonthsrowsrows for the periodstorage for the period (Tb)
2020-012247207907649441581520.47
2019-01122433335897292387739432.81
2018-01122115357738257022710152.47
2017-01122154755423258176673912.48
2016-01122214377022265129026652.50
2015-0661858931075115090323971.10

Pagecounts

datemonthsrowsrows dfor the periodstorage for the period (Tb)
2015-0162354563064141273783841.36
2014-01122285656148274967806922.64
2013-01122227853445267920440432.57
2012-01121980345650240116555952.31
2011-01121445012922178754877921.72
2010-01121475652637176771919291.70
2009-01121269606634154413256111.48
2008-011273301482793327697310.90


Remarks

Note on sizing

The number presented above are approximations. It makes no sense to try to represent cassandra storage in bytes-per-row as there compaction and compression at stake. However given the similarity of the datasets we worked with the approach feels reasonably correct.

Ops thoughts

  • We probably want to take advantage of the expansion to move to cassandra 3.x
  • Moving the ~20Tb total of data needs to be carefully planned and thought of.