The cache hit ratio should be as high as possible.When designing tables, or adding new database queries, consider that every query must use an index (including write queries!). Only cache data if your code can also performantly respond when the cached data is missing otherwise, use stronger persistence for your data. Choose the right persistence layer for your needs.A slow database query behind Memcached, is still a slow query! Hitting memcached first means we need fewer database servers. However, our caching exists primarily to increase capacity, not speed. Wikimedia heavily depends on its caching layers to survive.Perform long-running tasks on a dedicated server instead, e.g. SQL query may be automatically stopped after 30s. Your code can become a high-traffic workload in Wikimedia production! Each web request has a strict HTTP timeout. Treat the infrastructure as one that we share with others.Consider documenting your latency metrics, and review them on a monthly or quarterly basis to prioritise maintenance as-needed to uphold the quality of service. Monitoring their latency will let you know when an experience becomes slower and/or when there are capacity problems. As developers you know best how your code is exercised and what high-level actions are meaning to your product. Identify relevant latency metrics, and take responsibility for them.See also: How to measure backend performance. Results can be surprising and may change over time. When making choices in the interest of performance, measure instead of relying on intuition. monthly) verifying and measuring your code's performance in production. The team should maintain awareness of these hot spots by regularly (e.g. Which parts of your code take the most time to execute? These may deserve extra care during code review in the future. These guidelines focus both on individually perceived performance (your code runs relatively fast) and scalability (your code can run fast, even on a large wikis and when run many times concurrently). Use the below guidelines together with the Architecture guidelines and Security guidelines. These are the performance guidelines for MediaWiki backend development aimed at being deployed to Wikimedia Foundation wikis.
0 Comments
Leave a Reply. |