Skip to content
HomeVideosBooksBlogs
AllTop postsTopics
Podcasts
HistoryListsWatch laterLiked videosFollowing

The videos, books, blogs and podcasts Hacker News keeps recommending, all in one place.

VideosBooksBlogsPodcastsAboutPrivacySettings

Data from Hacker News, HackerTube, HackerBooks, HackerBlogs and Open Library. Credits · Not affiliated with Y Combinator.

HomeVideosBooksBlogsPodcasts
Ctrl K
    J

    Joyful Bikeshedding

    joyfulbikeshedding.com · Personal blog · on HN since 2018

    Hongli Lai, a developer who writes about Ruby memory use, Linux tracing with eBPF, distributed locking, packaging and server monitoring.

    Visit blogRSSHN submissions
    Systems & PerformanceProgrammingDevOps & Cloud
    What HN says

    HN commenters cite it as an interesting, detailed resource, especially the Ruby memory bloat post, the eBPF explainer and the Google Cloud Storage locking algorithm.

    Stats for nerds
    20HN people shared it
    33linked in comments
    389story points
    May 2023last shared
    2019people per year2023

    Top posts on HN

    1. 1
      What causes Ruby memory bloat?
      5 people · 187 points · first shared 2019 · 70 comments on HN
    2. 2
      Full-system dynamic tracing on Linux using eBPF and bpftrace
      4 people · 141 points · first shared 2019 · 11 comments on HN
    3. 3
      The status of Ruby memory trimming and how you can help with testing (2019)
      3 people · 7 points · first shared 2019 · Discussion on HN
    4. 4
      How Debian Packaging Works
      1 person · 6 points · first shared 2020 · 2 comments on HN
    5. 5
      A robust distributed locking algorithm based on Google Cloud Storage
      3 people · 5 points · first shared 2021 · Discussion on HN
    6. 6
      Why I avoid Prometheus+Grafana and choose Netdata for simple server monitoring
      1 person · 4 points · first shared 2018 · 2 comments on HN
    7. 7
      Studying the Kubernetes Ingress system
      1 person · 4 points · first shared 2018 · Discussion on HN
    8. 8
      Should non-EU websites ban EU visitors under the GDPR?
      1 person · 4 points · first shared 2018 · Discussion on HN
    9. 9
      Why Fullstaq Ruby? – Joyful Bikeshedding
      2 people · 3 points · first shared 2020 · Discussion on HN
    10. 10
      The Future of Traveling Ruby
      2 people · 3 points · first shared 2021 · Discussion on HN

    What HN people wrote when they linked it

    • FooBarWidgetMay 2023

      I also wrote about distributed locking a while ago, particularly about implementing one on Google Cloud Storage. https://www.joyfulbikeshedding.com/blog/2021-05-19-robust-distributed-locking-algorithm-based-on-google-cloud-storage.html

      This is useful because cloud storage is very cheap and serverless. It certainly beats running a Redis or PostgreSQL instance.

      In my research and implementation I took care of the problems described in this article (as well as the problems I encountered in other distributed lock implementations).

      Clients either freezing or outright crashing or disappearing is definitely a major problem. So timeouts are a must. But you can't just have a timeout because you don't know whether a client is arbitrarily delayed or whether it has disappeared. Furthermore, some workloads have an unknown completion time so you can't pick any sensible timeout.

      I address this by encouraging clients to behave as follows:

      1. Make the timeout relatively short, but regularly refresh your lease to let others know that you're still alive.

      2. Your lease may at any time be taken over by another client that thinks you've disappeared. So you must regularly check whether your lease on the lock is still valid. This checking must be done way, way before your timeout expires, in order to account for the possibility that you can be arbitarily delayed at any moment (GC pauses, scheduling pauses, network delays, etc). I recommend checking in an interval at most 1/8 of the timeout.…

    • masklinnFeb 2019

      > Naturally I wanted to get my hands on this stuff to try it out for myself. Is it really as good as they say? Normally I stick to Linux, but it (generally) doesn’t have these Sun technologies.

      Since then, bpftrace[0] has been released, supposedly it's actually better than dtrace, in the sense that it's even more capable[1].

      See https://www.joyfulbikeshedding.com/blog/2019-01-31-full-system-dynamic-tracing-on-linux-using-ebpf-and-bpftrace.html for a recent basic ebpf/bpftrace tutorial. Brendan Gregg also has a primer on eBPF: http://www.brendangregg.com/blog/2019-01-01/learn-ebpf-tracing.html

      [0] http://www.brendangregg.com/blog/2018-10-08/dtrace-for-linux-2018.html

      [1] that's Brendan Gregg saying it: http://www.brendangregg.com/blog/2018-10-08/dtrace-for-linux-2018.html — having contributed to it and being one of the leading dtrace experts

    • yxhuvudNov 2020

      One thing that has been known for a while is that there are allocation patterns where LibC malloc doesn't give back a sufficient amount of pages even when the pages are clean.

      See for example https://www.joyfulbikeshedding.com/blog/2019-03-14-what-causes-ruby-memory-bloat.html#a-magic-trick-trimming . In the end I think the consensus was that jemalloc was just better than invocing malloc_trim, but invoking malloc_trim now and then can certainly be a lot better than using neither malloc_trim or jemalloc.

    • vthrillerApr 2019

      > At this point jemalloc is so good

      Some folks disagree:

      > [Ruby's] memory usage only reduces when using jemalloc 3; memory usage is still high when using jemalloc 5. Nobody knows why, so that makes the choice of defaulting to jemalloc very dodgy.

      via https://www.joyfulbikeshedding.com/blog/2019-03-29-the-status-of-ruby-memory-trimming-and-how-you-can-help-with-testing.html

    • docfortJan 2023

      It’s definitely surprising that macOS does this, but it makes me also wonder if the authors considered just modifying the binary so that the dynamic linker could find the library: https://www.joyfulbikeshedding.com/blog/2021-01-13-alternative-to-macos-dyld-library-path.html

    • detaroDec 2020

      Not sure if this is jargon-free enough, but maybe it helps: https://www.joyfulbikeshedding.com/blog/2019-01-31-full-system-dynamic-tracing-on-linux-using-ebpf-and-bpftrace.html

    Related

    Omniref Blogomniref.com25 people

    Algorithms Every Programmer Should Know: Reservoir Sampling

    Omniref Blog
    Company · last shared 2016
    LShift Bloglshift.net41 people

    Python quirks

    LShift Blog
    Company · last shared 2016
    Joe Damatotimetobleed.com39 people

    American Express fails miserably at basic security

    Joe Damato
    Personal · last shared 2022
    Delphix Blogblog.delphix.com17 people

    OpenZFS: Reducing ARC Lock Contention

    Delphix Blog
    Company · last shared 2016
    packagecloud Blogblog.packagecloud.io46 people

    How setting the TZ environment variable avoids thousands of system calls

    packagecloud Blog
    Company · last shared 2024
    ScyllaDB Blogscylladb.com167 people

    How io_uring and eBPF Will Revolutionize Programming in Linux

    ScyllaDB Blog
    Company · last shared 2026
    Datadog Blogdatadoghq.com262 people

    Husky, Datadog's Third-Generation Event Store

    Datadog Blog
    Company · last shared 2026
    Codeship Blogblog.codeship.com138 people

    Crystal: Fast as C, Slick as Ruby

    Codeship Blog
    Company · last shared 2020