Mike Perham
mikeperham.com · Personal blog · on HN since 2010
Mike Perham, creator of Sidekiq, writes about Ruby, Redis, running an open-source business, and keeping dependencies low.
What HN saysHN commenters link his posts on charging for open source and on killing dependencies, and discuss his advice on Redis use and Ruby memory allocation.
94HN people shared it
22linked it in comments
108stories submitted
2.2Kstory points
8 months agolast shared
2010people per year2026
Most-shared posts
- 1How to Charge for Your Open Source7 people · 19 points · first shared 2015 · 1 comments on HN
- 2Kill Your Dependencies5 people · 422 points · first shared 2016 · 226 comments on HN
- 3How to make $100k in Open Source by working hard5 people · 319 points · first shared 2013 · 93 comments on HN
- 4Use Runit5 people · 17 points · first shared 2014 · discussion on HN
- 5Happy 10th Birthday, Sidekiq4 people · 227 points · first shared 2022 · 41 comments on HN
- 6A Path to Full-time Open Source3 people · 129 points · first shared 2014 · 51 comments on HN
- 7Ruby’s GIL and transactional memory3 people · 82 points · first shared 2014 · 20 comments on HN
- 8CGI: Ruby's Bare Metal3 people · 66 points · first shared 2015 · 14 comments on HN
- 9Sidekiq for Crystal, 3x faster, 3x smaller3 people · 6 points · first shared 2016 · discussion on HN
- 10Taming Rails memory bloat3 people · 3 points · first shared 2018 · discussion on HN
- 11Sidekiq in the Terminal3 people · 3 points · first shared 2026 · discussion on HN
- 12Serving your own Commercial Rubygems3 people · 2 points · first shared 2016 · discussion on HN
- 13Five Common Rails Mistakes2 people · 78 points · first shared 2012 · 29 comments on HN
- 14The Ruby Stdlib is a Ghetto2 people · 76 points · first shared 2010 · 47 comments on HN
- 15Timeout: Ruby's Most Dangerous API2 people · 69 points · first shared 2015 · 4 comments on HN
What HN people wrote when they linked it
mberning · 2025-01-24
I agree. Here is a similar post from another amazing developer.
https://www.mikeperham.com/2016/02/09/kill-your-dependencies/
mperham · 2020-05-18
I blog regularly but typically not about business topics, see my blog home page at https://www.mikeperham.com
I appear on various podcasts, e.g. The Changelog, regularly and talk about things there too. I'll be on FounderQuest in the next week or two.
ksec · 2018-07-05
There has been lots of discussion lately about Ruby and malloc. jemalloc gives the best results for Server Performance and memory usage [1], but is slightly slower in low memory usage scenario i.e Non Server usage which is popular in Japan. But jemalloc sometimes ( Not sure if this is still the case ) doesn't work well with muslc, used in Alpine Linux.
The Ruby Core team has decided against [2] shipping jemalloc by default, but will use it when it is available. Which ultimately led to some work on SleepyGC [3] and Transient heap [4].
[1] https://www.mikeperham.com/2018/04/25/taming-rails-memory-bloat/
[2] https://bugs.ruby-lang.org/issues/14718
[3] https://bugs.ruby-lang.org/issues/14723
[4] https://bugs.ruby-lang.org/issues/14858
nathan_f77 · 2018-04-05
It's not a good idea to use a single Redis instance for both caching and persisted/transactional data (background jobs). For background jobs, you need real-time persistence with AOF. For caching, you want everything in memory, and you need an LRU cache that evicts any old data. This means you should run two Redis instances with different configurations. But in that case, it can be a good idea to use Memcached, which is recommended by Mike Perham [1].
[1] http://www.mikeperham.com/2015/09/24/storing-data-with-redis/
mslate · 2014-04-13
Great talk! The last question you received about how the python memcache client handles distributing keys after adding a node (rather than removing one) would've been interesting to know, but no sweat. Looks like somebody explains how this is handled for the ruby client: https://www.mikeperham.com/2009/01/14/consistent-hashing-in-memcache-c…
sudhirj · 2018-01-10
On the subject of OSS projects on the side, I'm really interested in the dual licensing model - I'd like to have my code licensed under a strict copyleft license so people can see the code, but a more permissive license so businesses can use it.
Based on articles like http://www.mikeperham.com/2015/11/23/how-to-charge-for-your-open-sourc… I've figured out the following:
OSS license - AGPL - I'm building web services distributed as docker containers, so AGPL makes sense because it forces businesses to buy a license even if thy just deploy an instance of the service without modification.
Commercial license - this is where I'm stuck. MIT / BSD isn't a good fit because the business is then free to make and sell their own version of the service. What license will allow a business to run my service, and customize it for their own needs if necessary, but not re-license or redistribute it? Based on https://choosealicense.com/appendix/ it seems like the Mozilla Public License comes close, but it forces businesses to disclose the changes they've made - which I doubt they'd want to do.
I don't want to write my own license - anyone know of a good existing license or template? Don't mind buying it if it's less than $100, but getting a lawyer to write one is much more expensive.
jrpt · 2015-11-11
Companies are more than willing to pay for software, but there's little incentive when they would otherwise get it for free and you're asking for a charity handout. I'm sorry but that's just reality. If I were you, I'd figure out a way to earn money off of your project, perhaps by going open core and making a premium version with business-friendly features.
I found these blog posts valuable:
http://www.mikeperham.com/2014/10/01/the-path-to-full-time-open-source…
http://www.mikeperham.com/2013/10/01/how-to-make-100k-in-oss-by-workin…
Relatedly, this is why I intentionally didn't make my newest project open source. The project is DataDuck ETL (http://dataducketl.com/) - if it were open source, companies would have used it for free and I'd be stuck maintaining and supporting them for free. Instead, I've already made five figures off of it, and it has only been out for a few months. I'm calling this "Supported Source" (http://supportedsource.org/) and I encourage anyone to follow this same business model. In short, the code is publicly available online, and I'm open to collaborating or receiving commits, but companies need to buy a license to use it beyond a free trial. This is not open source, I agree, but it's similar to open source in many ways, and ultimately more sustainable than open source for certain types of projects.
It's probably too late for your project but if you want to make money sustainably from it, I think you're going to have to move away from the…
simonw · 2026-01-28
Sidekiq credits BackgrounDRb and Delayed::Job and Resque as inspiration here: https://www.mikeperham.com/2022/01/17/happy-10th-birthday-sidekiq/#pre…
ezekg · 2023-08-18
Mike from Sidekiq kind of does this with his Pro [0] version -- offering a "more reliable" job queue via Redis' RPOPLPUSH among other features. He uses license keys and a custom gem server to distribute the premium features, afaiaa [1].
[0]: https://sidekiq.org/products/pro.html
[1]: https://www.mikeperham.com/2016/05/17/commercial-gems/
tra3 · 2022-05-05
Sidekiq in the Ruby on Rails community is a success. Sidekiq itself is free, but support and some enterprise features require a yearly subscription.
The author just posted a 10 year summary [0]:
> 1 employee (me!)
> 1850 customers
> 3.0m HTTP requests to the commercial gem server per day
> $13.5 million in total gross sales
It's a success in my book.
0: https://www.mikeperham.com/2022/01/17/happy-10th-birthday-sidekiq/
Terretta · 2021-09-26
Tell the horde OSS != FOSS and also get off their entitlement horse.
By opening your source you’re already in the minority contributing to common good, openly sharing your understanding of how to solve problems with code (aka IP). Making IP free is a big deal — you’re making it free to learn, understand, and advance shared knowledge. You don’t owe anyone making it free to run a business on.
To head off an AWS vs. Elastic situation, where someone else offers your code as a paid service w/o compensating you and w/o releasing their in-house patches (https://www.theregister.com/2021/01/22/aws_elastic_fork/), consider AGPLv3: https://choosealicense.com/licenses/agpl-3.0/
See top comment on that here on HN about 8 months ago: https://news.ycombinator.com/item?id=25834523
---
TL;DR: “How to charge for OSS”: https://www.mikeperham.com/2015/11/23/how-to-charge-for-your-open-sour…
mhw · 2020-05-05
Related: Railsconf 2020 Virtual Hallway - https://www.mikeperham.com/2020/04/29/railsconf-2020-virtual-hallway/
rurounijones · 2020-01-16
Please re-read what I said. I never claimed it was easy to port in every situation.
I merely pointed out that "depending on what you are doing they (semantic differences) are minor considerations." and then gave an example where that was the case with a simple application I was working.
If you want a more complicted library that was ported from Ruby to Crystal then you can also look at Sidekiq ( https://www.mikeperham.com/2016/05/25/sidekiq-for-crystal/ )
evadne · 2018-07-06
Sidekiq moved from Celluloid to Concurrent Ruby as well.
https://github.com/mperham/sidekiq/issues/2583
http://www.mikeperham.com/2015/10/14/optimizing-sidekiq/
Celluloid uses 1 thread per actor.
dopamean · 2017-03-10
Mike Perham ported some of Sidekiq to Crystal and did brief writeup about it [0]. It'll be interesting to see if this thing really goes somewhere.
[0] http://www.mikeperham.com/2016/05/25/sidekiq-for-crystal/
zrail · 2014-11-25
On a smaller scale it can definitely be done. See Mike Perham's success with Sidekiq Pro[1], for example. I'm trying out this model[2] as well.
It's definitely not an easy road, but then again neither is starting a funded startup.
[1]: http://mikeperham.com/2014/10/01/the-path-to-full-time-open-source/
[2]: https://www.payola.io/pro
dakull · 2014-08-13
Yours also sounds like a "non-statement statement" e.g.:
https://www.mikeperham.com/2013/12/31/rubys-gil-and-transactional-memo…
petercooper · 2013-10-19
chubot · 2011-02-25
How about just using consistent hashing? http://en.wikipedia.org/wiki/Consistent_hashing
In this scheme, you can add and remove servers without mving all your data.
There is apparently a memcached plugin to do this: http://www.mikeperham.com/2009/01/14/consistent-hashing-in-memcache-cl…
jplewicke · 2010-04-08
I haven't used it myself, but you may want to take a look at Mike Perham's Phat. It modifies Rails to use asynchronous I/O and several cooperating Fibers per-thread/process to speed up Rails significantly.
http://www.mikeperham.com/2010/04/03/introducing-phat-an-asynchronous-…
http://news.ycombinator.com/item?id=1240609
It
larkinrichards · 2016-03-23
I wanted to write this post after the left-pad debacle but I've been beaten to it.
I think we got to this state because everyone was optimizing js code for load time-- include only what you need, use closure compiler when it matters, etc. For front end development, this makes perfect sense.
Somewhere along the line, front end developers forgot about closure compiler, decided lodash was too big, and decided to do manual tree shaking by breaking code into modules. The close-contact between nodejs and front end javascript resulted in this silly idea transiting out of front-end land and into back-end land.
Long time developers easily recognize the stupidity of this, but since they don't typically work in nodejs projects they weren't around to prevent it from happening.
New developers: listen to your elders. Don't get all defensive about how this promised land of function-as-a-module is hyper-efficient and the be-all end-all of programming efficiency. It's not. Often times, you already know you're handing a string, you don't need to vary the character that you're using for padding and you know how many characters to pad. Write a for loop; it's easy.
Note that this is exactly the sort of question I ask in coding interviews: I expect a candidate to demonstrate their ability to solve a simple problems in a simple manner; I'm not going to ask for a binary search. Separately, I'll ask a candidate to break down a bigger problem into smaller problems. In my experience, a…