垃圾收集的冒险:提高我们庞大的单体的GC性能

At the beginning of this year, we ran several experiments aimed at reducing the latency impact of the Ruby garbage collector (GC) in Shopify's monolith. Everything described in this article was a team effort, huge thanks to Jason Hiltz-Laforge for his extended knowledge of our production platform, to Peter Zhu for his deep knowledge of the Ruby garbage collector, as well as to Matt Valentine-House, Étienne Barrié, and Shane Pope for their contributions to this work.

在今年年初,我们做了几个实验,旨在减少Shopify单片机中Ruby垃圾收集器(GC)的延迟影响。这篇文章中所描述的一切都是团队努力的结果,非常感谢Jason Hiltz-Laforge对我们生产平台的广泛了解,感谢Peter Zhu对Ruby垃圾收集器的深入了解,以及Matt Valentine-HouseÉtienne BarriéShane Pope对这项工作的贡献。

In this article we'll talk about the changes we made to improve GC performance, and more importantly, how we got to these changes.

在这篇文章中,我们将谈论我们为提高GC性能所做的改变,更重要的是,我们是如何达到这些改变的。

The work consisted of several rounds of improving logging and metrics, interpreting those to form a hypothesis around a change which would be beneficial, testing and shipping that change, and then evaluating whether it should be kept, tweaked, or reverted.

这项工作包括几轮改进日志和指标的工作,解释这些指标以形成围绕一个有益的变化的假设,测试和发送该变化,然后评估它是否应该被保留、调整或恢复。

While the narrative in this article might make it seem like we went straight from problem to result, there were several dead ends, incorrect assumptions, and experiments which did not produce the expected results. All as you would expect from an optimization exercise on a dynamic and complex system.

虽然这篇文章的叙述可能使人觉得我们直接从问题到结果,但有几个死胡同,不正确的假设,以及没有产生预期结果的实验。所有这些都是你在一个动态和复杂系统的优化练习中所期望的。

A Word of Caution

注意事项

Before we get into what changes we made, I really want to stress that you should never blindly apply GC settings in your apps without first establishing a proper way to measure the impact of such changes. Modifying the GC settings can radically impact the performance of an application, both in a positive and negative way.

在我们讨论我们所做的改变之前,我真的想强调,在没有建立一个适当的方法来衡量这种改变的影响之前,你永远不应该在你的应用程序中盲目地应用GC设置。修改GC设置可以从根本上影响一个应用程序的性能,包括积极和消极的方式。

Ruby’s default GC settings are fairly decent ...

开通本站会员,查看完整译文。

首页 - Wiki
Copyright © 2011-2024 iteam. Current version is 2.123.4. UTC+08:00, 2024-04-20 06:42
浙ICP备14020137号-1 $访客地图$