从 Linux 上的 Ruby 和 Resque 捕获分段错误回溯

发布于 2024-09-28 16:07:18 字数 539 浏览 0 评论 0原文

我们使用 Resque 在大量机器上运行 Ruby 工作线程。每隔一段时间,我们就会在 Resque 工作进程中看到分段错误。调试它们很困难,因为它们相当罕见,而且我们必须运行数以万计的分布式作业才能触发崩溃。

理想情况下,我们希望在每次崩溃后捕获回溯和核心文件,并自动将它们上传到中央服务器。换句话说,我们正在寻找类似 Gnome 的“Bug Buddy”的东西,但完全自动化,并且能够在 Ruby 解释器转储核心时捕获错误。 (类似的基于 GUI 的产品包括 MacOS X Crash Reporter、Windows Error Reporting、KDE ​​的 Dr. Konqi 和 Mozilla 的 Breakpad。但我们需要在无头、无人值守的服务器上运行的东西。)

到目前为止,最有前途的选择似乎是 Ubuntu 的Apport,它可以拦截服务器进程中的崩溃并将其保存到磁盘。 Apport 通常会将崩溃上传到 Ubuntu 的 Launchpad,但它也附带了一个 Python 库。

有人对使用这些库有任何建议或第一手经验吗?我在这里问而不是服务器故障,因为解决方案可能涉及编程或代码更改。

We're running Ruby workers across a large number of machines using Resque. Every once in a while, we see segmentation faults in our Resque worker processes. It's hard to debug these, because they're fairly rare, and we must run tens of thousands of distributed jobs to trigger a crash.

Ideally, we'd like to capture backtraces and core files after each crash, and automatically upload them to a central server. In other words, we're looking for something like Gnome's "Bug Buddy", but completely automated and able to catch faults when the Ruby interpreter dumps core. (Similar GUI-based products include MacOS X Crash Reporter, Windows Error Reporting, KDE's Dr. Konqi, and Mozilla's Breakpad. But we need something which runs on a headless, unattended server.)

So far, the most promising option appears to be Ubuntu's Apport, which can intercept crashes in server processes and save them to disk. Apport normally uploads crashes to Ubuntu's Launchpad, but it also comes with a Python library.

Does anyone have any recommendations or first-hand experience using these libraries? I'm asking here rather than on Server Fault because the solutions are likely to involve programming or code changes.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

拍不死你 2024-10-05 16:07:18

查看 Hoptoad getExceptional新遗物。所有这些都是 SaaS 选项,可以为您执行此操作(New Relic 还将跟踪性能)。如果您想自己动手,请尝试 exception_notification gem。

Check out Hoptoad, getExceptional, and New Relic. All are SaaS options that will do this for you (New Relic will also track performance). If you want to roll your own, try the exception_notification gem.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文