Joshua Young's Avatar

Joshua Young

@joshuay03.bsky.social

Software Engineer at Buildkite, Rubyist, and OSS contributor.

106 Followers  |  113 Following  |  26 Posts  |  Joined: 03.11.2024  |  1.7496

Latest posts by joshuay03.bsky.social on Bluesky

Preview
Allow sending SIGTERM to workers on timeout by schneems ยท Pull Request #157 ยท zombocom/rack-timeout When rack-timeout fires then it can put an application in a "bad" state. This is due to https://www.schneems.com/2017/02/21/the-oldest-bug-in-ruby-why-racktimeout-might-hose-your-server/....

> I believe `Rack::Timeout` does trigger a full process shutdown after killing a thread.

You need to opt in by enabling `term_on_timeout` (github.com/zombocom/rac...).

05.08.2025 10:52 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

TIL ๐Ÿ‘€ Thanks!

26.07.2025 08:53 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0

Yes, just 3-12 bytes:
- github.com/puma/puma/bl...
- github.com/puma/puma/bl...

Good point, mmap + polling + small messages is probably less efficient than using pipes in this case. I'm still going to give it a go to scratch that itch ๐Ÿ˜Š

26.07.2025 08:01 โ€” ๐Ÿ‘ 2    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0

Iโ€™m curious how Puma would perform with mmap instead of pipes, which it relies on heavily for IPC in cluster mode: github.com/puma/puma/bl....

26.07.2025 04:24 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 2    ๐Ÿ“Œ 0

I wrote (or rewrote) some gems to get better at Ruby C extensions and learn about these topics (CAS and mmap):
- github.com/joshuay03/at...
- github.com/joshuay03/mm...

26.07.2025 04:24 โ€” ๐Ÿ‘ 2    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

I'm curious about this too. With YJIT in maintenance mode, bug fixes, UX improvements, etc., are probably welcome (a colleague recently found and fixed one). But with ZJIT being greenfield WIP, I'm not so sure. Completely understandable if that's the case though.

13.06.2025 22:08 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

Young* ๐Ÿ™‚

10.05.2025 11:14 โ€” ๐Ÿ‘ 2    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0
Preview
#rubykaigi | ๐Ÿฏ Joshua Young Ruby friends, old and new, at #RubyKaigi 2025โ€”another amazing edition of the largest and most prestigious Ruby conference. I love this community and this event, and hope to be back every year โค๏ธ Hug...

Had a blast at #RubyKaigi 2025!

www.linkedin.com/posts/joshua...

05.05.2025 04:00 โ€” ๐Ÿ‘ 3    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0

Great talk! Though my favorite is still the one you gave at RailsConf 2022.

As a noob OSS contributor and maintainer, Iโ€™ve learned a lot from your talks about the "duties" and "responsibilities" of both sides in OSS interactionsโ€”Iโ€™m trying to apply those principles in my own work as well.

01.05.2025 16:08 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0
Post image Post image Post image

#RubyKaigi late night with #RubyFriends !

16.04.2025 16:23 โ€” ๐Ÿ‘ 3    ๐Ÿ” 1    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0

It's not perfect but it does the job! Please let me know how you go if you give it a whirl.

So far I've tried it on three Rails monoliths of decent scale (including Buildkite's), and it gives me everything I need to profile requests in a multithreaded development environment - both Ruby and IO.

10.04.2025 13:05 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0
Preview
Add more ActiveSupport notification event markers by joshuay03 ยท Pull Request #119 ยท jhawthorn/vernier WIP New comprehensive list: # ActiveRecord sql.active_record instantiation.active_record start_transaction.active_record (added) transaction.active_record (added) # ActionController start_proces...

My current focus is production support.

I'm also hoping to add support for a few more useful AS notification events: github.com/jhawthorn/ve...

Then, I'd like to start thinking about adding some custom hooks to integrate with other gems.

10.04.2025 13:05 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

With Dial, Vernier does all the heavy lifting, and viewing a request profile is just a click away. The hook into AS notifications is simple yet powerful, giving you a useful timeline of the events that matter.

I've included N+1 detection and VM stat diffs to complement these, open to more ideas.

10.04.2025 13:05 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0
Preview
GitHub - joshuay03/dial: A modern profiler for your Rails application A modern profiler for your Rails application. Contribute to joshuay03/dial development by creating an account on GitHub.

Announcing Dial, a Rails application profiler: github.com/joshuay03/dial

I've longed for a free tool that provides Datadog-like profiles, with accurate GVL and GC activity. Thanks to @jhawthorn.com's amazing work on Vernier, all I needed to do was integrate it with Rails and let it do its thing.

10.04.2025 13:05 โ€” ๐Ÿ‘ 35    ๐Ÿ” 10    ๐Ÿ’ฌ 2    ๐Ÿ“Œ 0

FYI the year on the post is 2022.

09.04.2025 00:29 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

See you at RubyKaigi!

22.03.2025 01:10 โ€” ๐Ÿ‘ 3    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

Makes sense, thank you for clarifying.

10.03.2025 01:22 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0

Sorry, I wasn't clear. If 8/10 threads are ~75% IO bound but with a reasonable spread e.g. query -> serialise, cache -> serialise etc., the CPU bound thread(s) will be interrupted quite often as they interleave. Is that something to be concerned about?

09.03.2025 23:18 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

Interesting. Do you think that could introduce the opposite problem (CPU bound thread starvation in IO heavy workloads)?

09.03.2025 10:18 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

I tried writing a basic Fiber scheduler based on this idea, but I haven't had the time to pick it back up (hit a roadblock with some segfaults with multiple threads). Took a while for it to occur to me that Threads might be able to work this way too...

github.com/joshuay03/fi...

09.03.2025 09:55 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0

Which would hopefully ease CPU bound thread monopolisation?

Obviously there'd be a bunch of other constraints e.g. need at least one other thread releasing the GVL pre-100ms, need to have a sensible lower bound/reasonable context switch overhead. Probably many more I haven't thought of...

09.03.2025 09:48 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

Essentially CPU bound threads would have their priority gradually lowered the more complete slices they're granted:
- slice 1 100ms (priority 0)
- slice 2 100ms (priority 0)
- slice 3 50ms (priority -1) # arbitrary pick
...

Got slice calculation from: github.com/bensheldon/g...

09.03.2025 09:48 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

I wonder what it would look like if Thread#priority was automatically set by the scheduler based on number of complete time slices utilised (100ms). I'm thinking Linux CFS-like scheduling using a red-black tree.

en.wikipedia.org/wiki/Complet... en.wikipedia.org/wiki/Red%E2%...

09.03.2025 09:48 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

Random thought about Ruby thread scheduling fairness that I don't have sufficient knowledge of the VM to answer myselfโ€”without probably banging my head against a wall for a couple of days or weeks ๐Ÿงต

09.03.2025 09:48 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 2    ๐Ÿ“Œ 0
Preview
a puppy is standing on its hind legs on a tiled floor with a ball in its mouth . Alt: A doggy tippy taps excitedly for a treat.
01.03.2025 01:44 โ€” ๐Ÿ‘ 2    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0
Rails Contributors - Date Range Ruby on Rails contributors

#24 of 564 contributors to Rails last yearโ€”not too shabby for mostly working on OSS in my free time! Hoping to keep the momentum going in 2025 ๐Ÿš€

contributors.rubyonrails.org/contributors...

01.01.2025 22:50 โ€” ๐Ÿ‘ 15    ๐Ÿ” 2    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0

Happy Birthday!

17.12.2024 09:59 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0

@joshuay03 is following 20 prominent accounts