davideisinger.com

My personal website
Log | Files | Refs | README

evilmartians-com-yestli.txt (11858B)


      1 If you are an AI agent, LLM, or automated tool, a clean Markdown version of
      2 this page is available at: https://evilmartians.com/chronicles/
      3 introducing-overmind-and-hivemind.md?ref=hint
      4 [1] 
      5 Evil Martians logo
      6 [2]Brand guidelines
      7 [3]Hire Martians
      8 [4](Menu)
      9 [5] 
     10 Services
     11 [6] 
     12 Clients
     13 [7] 
     14 Products
     15 [8] 
     16 Open Source
     17 [9] 
     18 Blog
     19 [10] 
     20 Events
     21 [11] 
     22 Podcast
     23 [12] 
     24 Careers
     25 [13] 
     26 Agent Skills
     27 [14][aHR0cHM6Ly9ldmlsbWFydGlhbnMuY29tL2l]SF Ruby Conf 2026
     28 [15](Search)
     29 [16] 
     30 [17] 
     31 [18] 
     32 [19] 
     33 [20] 
     34 Evil Martians logo
     35 [21]Brand guidelines
     36 [22]Hire Martians
     37 [23] 
     38 Services
     39 [24] 
     40 Clients
     41 [25] 
     42 Products
     43 [26] 
     44 Open Source
     45 [27] 
     46 Blog
     47 [28] 
     48 Events
     49 [29] 
     50 Podcast
     51 [30] 
     52 Careers
     53 [31] 
     54 Agent Skills
     55 [32][aHR0cHM6Ly9ldmlsbWFydGlhbnMuY29tL2l]SF Ruby Conf 2026
     56 [33](Search)
     57 [34] 
     58 [35] 
     59 [36] 
     60 [37] 
     61 [38] 
     62 10-
     63 Nov
     64 12
     65 Join us for SF Ruby Conf 2026!
     66 [39]Hire Martians
     67 [40](Search)
     68 [41] 
     69 [42] 
     70 [43] 
     71 [44] 
     72 
     73 Introducing Overmind and Hivemind
     74 
     75 August 7, 2017
     76 
     77 [svg]
     78 Cover for Introducing Overmind and Hivemind
     79 
     80 Blog post by Andy Barnov and Sergey Alexandrovich
     81 
     82 Topics
     83 
     84   • [45]Product development
     85   • [46]Go & performance infrastructure
     86   • [47]Frontend & real-time
     87   • [48]Go
     88 
     89 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
     90 
     91   • [49] 
     92 
     93     [svg]
     94     Andy Barnov
     95 
     96 
     97     Andy Barnov
     98 
     99     Writer. SRE at Le Wagon
    100 
    101 
    102   • [50] 
    103 
    104     [svg]
    105     Sergey Alexandrovich
    106 
    107 
    108     Sergey Alexandrovich
    109 
    110     Author of imgproxy
    111 
    112 
    113 
    114 Never mind your usual Procfile manager, here’s Overmind—and its little brother
    115 Hivemind. Evil Martians use these tools, built by [51]Sergey Alexandrovich, to
    116 manage Procfile-based applications for development. You may want to consider a
    117 switch too.
    118 
    119 [52] First, some history
    120 
    121 First, there was rails s, and then there was sidekiq, and then gulp, or
    122 webpack-dev-server, or whatever else needed to use your app in the development
    123 environment. Rarely in the jungle of the modern web can a programmer get away
    124 by running one single process in the shell.
    125 
    126 Next came the Procfile—a format to specify the types of processes an
    127 application provides and the commands to run those services. It became a
    128 standard for Heroku and other Platforms-as-a-Service.
    129 
    130 After that came [53]Foreman. It allowed developers to launch all these
    131 processes with a single command. Everyone rejoiced, and David Dollar, who
    132 created it, got over 4k stars at GitHub. More similar tools would soon appear,
    133 and with it, a freedom of choice.
    134 
    135 Sergey Aleksandrovich noticed something wrong with these options. Here’s how he
    136 [54]explains it:
    137 
    138     The problem with most of those tools is that the processes you want to
    139     manage start to think they are logging their output into a file, and that
    140     can lead to all sorts of problems: severe lag, losing or breaking colored
    141     output. Tools can also add vanity information (unneeded timestamps in
    142     logs).
    143 
    144 [svg]
    145 Hivemind preserving Sidekiq ASCII-art
    146 
    147 
    148 Sidekiq logging to Terminal on a Mac directly (left), Foreman clipping the
    149 output (middle), Hivemind preserving the beauty of ASCII-art (right)
    150 
    151 
    152 In an attempt to solve this problem (that might have been bugging you, too)
    153 Sergey turned his attention towards pseudoterminals.
    154 
    155 [55] TLC for the PTY
    156 
    157 [56]Pseudoterminals (pseudotty, or PTY) have been around since 1967. They’ve
    158 existed in the UNIX world since the 80’s and 2010’s [57]The Linux Programming
    159 Interface contains an entire chapter explaining them.
    160 
    161 [svg]
    162 Hivemind logo
    163 
    164 [58]Hivemind uses pty to preserve everything your processes want to output.
    165 
    166 An excellent breakdown of the concept was [59]written by French programmer
    167 Rachid Koucha. Here’s an excerpt:
    168 
    169     A pseudoterminal is mainly used to make a process believe that it interacts
    170     with a terminal although it actually interacts with one or more processes.
    171 
    172 That’s exactly what’s needed to make the process manager behave in the terminal
    173 window! You don’t want processes to believe they’ve output to a file, you want
    174 them to print neatly to the shell so that sidekiq’s karate guy can keep on
    175 kicking.
    176 
    177 [60]Hivemind, written in Go, harnesses the power of pty entirely. So, whenever
    178 you have a Procfile in your working directory, that looks something like this:
    179 
    180 web: bundle exec rails server -p $PORT -b 0.0.0.0
    181 worker: bundle exec sidekiq -C config/sidekiq.yml
    182 assets: gulp watch
    183 
    184 You can now run all the processes specified within simply by typing hivemind in
    185 your console. If you need to specify a path to a file located somewhere else,
    186 just follow your hivemind command with the path to the Procfile you need.
    187 
    188 [61] Overmind goes up to eleven
    189 
    190 Hivemind has won a lot of Evil Martians’ hearts, but after collecting some
    191 feedback, Sergey decided to up the ante. What if processes were still bundled
    192 together, but a developer could control them separately?
    193 
    194 [svg]
    195 Hivemind logo
    196 
    197 [62]Overmind gives you everything Hivemind has to offer and much more.
    198 
    199 One idea led to another, and a few weeks later (in somewhat of a chronological
    200 paradox) Hivemind’s big brother was born: [63]Overmind. Here are some of its
    201 special powers:
    202 
    203   • Overmind starts processes in a tmux session, so you can easily connect to
    204     any process and gain control over it.
    205   • Overmind can restart a single process on the fly—you don’t need to restart
    206     the whole stack.
    207   • Overmind allows a specified process to die without interrupting all of the
    208     other processes.
    209   • Overmind can read environment variables from a file and use them as
    210     parameters so that you can configure Overmind behavior globally and/or per
    211     directory.
    212 
    213 To do its magic, Overmind uses [64]tmux, a terminal multiplexer. You’ll need to
    214 install it on your system first (with homebrew on a Mac, or apt-get on Ubuntu),
    215 this will allow you to switch between several programs in one terminal, detach
    216 them while they are running in the background, and reattach them to a different
    217 terminal. Don’t worry, you don’t have to learn a new tool from scratch to use
    218 tmux here, Overmind will do all the talking for you.
    219 
    220 Let’s take a concrete case as an example. Let’s say you’ve developed a Rails
    221 app that uses Sidekiq for background jobs and a frontend builder to compile
    222 assets on the fly. You run all the processes you need with Foreman or a similar
    223 tool. Until recently, Sidekiq could not be hot reloaded, this means that if all
    224 your processes are bundled together, and you’re using an older version of
    225 Rails, the only way to restart Sidekiq is to interrupt and relaunch your entire
    226 Foreman session. With Overmind, you can quickly open a new tab in your shell
    227 and run overmind restart worker: Sidekiq will restart, but the other processes
    228 will continue without interruption.
    229 
    230 [65] Now, how about some debugging?
    231 
    232 Overmind allows us to connect to any running process in a new shell window and
    233 interact with it on the fly. You often need to put byebug in your Rails code
    234 and do some live debugging. A standard Procfile-manager does not allow you to
    235 do that, but with Overmind, it’s as easy as opening a new tab and running the
    236 following:
    237 
    238 overmind connect [process_name]
    239 
    240 Here’s how that looks:
    241 
    242 [svg]
    243 Hivemind preserving Sidekiq ASCII-art
    244 
    245 
    246 One of the processes waits for the input. You can interact with it in a new tab
    247 without interrupting its neighbours.
    248 
    249 
    250 You can also let select processes die gracefully by putting their names in the
    251 environment variable before launching Overmind:
    252 
    253 OVERMIND_CAN_DIE=assets,npm_install overmind start
    254 
    255 Alternatively, you can set any environment variables that configure Overmind
    256 inside .overmind.env file in your project’s root.
    257 
    258 Radio wave representing wind sounds on Mars
    259 
    260 For now, both tools only make sense during the development, but Sergey is
    261 already thinking about adding some features that may come handy in the
    262 production environment. Stay tuned!
    263 
    264 You can grab them both on GitHub: [66]Overmind and [67]Hivemind.
    265 
    266 Join our email newsletter
    267 
    268 Get all the new posts delivered directly to your inbox. Unsubscribe anytime.
    269 
    270 [68][                    ]Your email[69][                    ]
    271 [70]Subscribe
    272 Or [71]subscribe to a feed
    273 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
    274 
    275   • [72]Contact us
    276   • [73]Brand
    277   • [74]日本語版
    278   • [75]llms.txt
    279 
    280 [76]Privacy policy
    281 [77]Cookie & privacy preferences
    282 [78]Notice at collection
    283 
    284 Designed and developed by Evil Martians
    285 
    286 
    287 References:
    288 
    289 [1] https://evilmartians.com/
    290 [2] https://evilmartians.com/brand
    291 [5] https://evilmartians.com/services
    292 [6] https://evilmartians.com/clients
    293 [7] https://evilmartians.com/products
    294 [8] https://evilmartians.com/opensource
    295 [9] https://evilmartians.com/chronicles
    296 [10] https://evilmartians.com/events
    297 [11] https://evilmartians.com/devpropulsionlabs
    298 [12] https://evilmartians.com/careers
    299 [13] https://evilmartians.com/agent-skills
    300 [14] https://evilmartians.com/events/sf-ruby-conference-2026
    301 [16] https://x.com/evilmartians
    302 [17] https://linkedin.com/company/evil-martians
    303 [18] https://github.com/evilmartians
    304 [19] https://youtube.com/@evil.martians
    305 [20] https://evilmartians.com/
    306 [21] https://evilmartians.com/brand
    307 [23] https://evilmartians.com/services
    308 [24] https://evilmartians.com/clients
    309 [25] https://evilmartians.com/products
    310 [26] https://evilmartians.com/opensource
    311 [27] https://evilmartians.com/chronicles
    312 [28] https://evilmartians.com/events
    313 [29] https://evilmartians.com/devpropulsionlabs
    314 [30] https://evilmartians.com/careers
    315 [31] https://evilmartians.com/agent-skills
    316 [32] https://evilmartians.com/events/sf-ruby-conference-2026
    317 [34] https://x.com/evilmartians
    318 [35] https://linkedin.com/company/evil-martians
    319 [36] https://github.com/evilmartians
    320 [37] https://youtube.com/@evil.martians
    321 [38] https://evilmartians.com/events/sf-ruby-conference-2026
    322 [41] https://x.com/evilmartians
    323 [42] https://linkedin.com/company/evil-martians
    324 [43] https://github.com/evilmartians
    325 [44] https://youtube.com/@evil.martians
    326 [45] https://evilmartians.com/chronicles?services=product-development
    327 [46] https://evilmartians.com/chronicles?services=go-development
    328 [47] https://evilmartians.com/chronicles?services=real-time
    329 [48] https://evilmartians.com/chronicles?skills=go
    330 [49] https://evilmartians.com/martians/andy-barnov
    331 [50] https://evilmartians.com/martians/sergey-alexandrovich
    332 [51] https://github.com/DarthSim
    333 [52] https://evilmartians.com/chronicles/introducing-overmind-and-hivemind#first-some-history
    334 [53] https://github.com/ddollar/foreman
    335 [54] https://github.com/DarthSim/hivemind
    336 [55] https://evilmartians.com/chronicles/introducing-overmind-and-hivemind#tlc-for-the-pty
    337 [56] https://en.wikipedia.org/wiki/Pseudoterminal
    338 [57] https://en.wikipedia.org/wiki/The_Linux_Programming_Interface
    339 [58] https://github.com/DarthSim/hivemind
    340 [59] http://www.rkoucha.fr/tech_corner/pty_pdip.html
    341 [60] https://github.com/DarthSim/hivemind
    342 [61] https://evilmartians.com/chronicles/introducing-overmind-and-hivemind#overmind-goes-up-to-eleven
    343 [62] https://github.com/DarthSim/overmind
    344 [63] https://github.com/DarthSim/overmind
    345 [64] https://github.com/tmux/tmux
    346 [65] https://evilmartians.com/chronicles/introducing-overmind-and-hivemind#now-how-about-some-debugging
    347 [66] https://github.com/DarthSim/overmind
    348 [67] https://github.com/DarthSim/hivemind
    349 [71] https://evilmartians.com/chronicles.atom
    350 [72] https://evilmartians.com/contact-us
    351 [73] https://evilmartians.com/brand
    352 [74] https://evilmartians.jp/
    353 [75] https://evilmartians.com/llms.txt
    354 [76] https://evilmartians.com/privacy
    355 [77] https://evilmartians.com/cookies
    356 [78] https://evilmartians.com/privacy#notice_at_collection