PumaWorkerKiller: Out of memory firing on fresh GDK install on Apple silicon
Overview
On a new Apple M1 16GB RAM, I see the following issue with in the rails-web
service:
$ gdk tail rails-web
--snip--
2021-02-10_03:33:26.89728 rails-web : {"timestamp":"2021-02-10T03:33:26.897Z","pid":53501,"message":"Puma starting in cluster mode..."}
2021-02-10_03:33:26.89825 rails-web : {"timestamp":"2021-02-10T03:33:26.897Z","pid":53501,"message":"* Puma version: 5.1.1 (ruby 2.7.2-p137) (\"At Your Service\")"}
2021-02-10_03:33:26.89826 rails-web : {"timestamp":"2021-02-10T03:33:26.897Z","pid":53501,"message":"* Min threads: 1"}
2021-02-10_03:33:26.89827 rails-web : {"timestamp":"2021-02-10T03:33:26.897Z","pid":53501,"message":"* Max threads: 4"}
2021-02-10_03:33:26.89828 rails-web : {"timestamp":"2021-02-10T03:33:26.897Z","pid":53501,"message":"* Environment: development"}
2021-02-10_03:33:26.89829 rails-web : {"timestamp":"2021-02-10T03:33:26.897Z","pid":53501,"message":"* Master PID: 53501"}
2021-02-10_03:33:26.89830 rails-web : {"timestamp":"2021-02-10T03:33:26.897Z","pid":53501,"message":"* Workers: 2"}
2021-02-10_03:33:26.89830 rails-web : {"timestamp":"2021-02-10T03:33:26.897Z","pid":53501,"message":"* Restarts: (✔) hot (✖) phased"}
2021-02-10_03:33:26.89831 rails-web : {"timestamp":"2021-02-10T03:33:26.897Z","pid":53501,"message":"* Preloading application"}
2021-02-10_03:33:41.13955 rails-web : {"timestamp":"2021-02-10T03:33:41.139Z","pid":53501,"message":"* Listening on unix:///Users/ash/src/gitlab/gdks/gdk2/gitlab.socket"}
2021-02-10_03:33:41.13986 rails-web : {"timestamp":"2021-02-10T03:33:41.139Z","pid":53501,"message":"! WARNING: Detected 1 Thread(s) started in app boot:"}
2021-02-10_03:33:41.13988 rails-web : {"timestamp":"2021-02-10T03:33:41.139Z","pid":53501,"message":"! #\u003cThread:0x00007f981e10caa8 /Users/ash/.asdf/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/gems/activerecord-6.0.3.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:334 sleep\u003e - /Users/ash/.asdf/installs/ruby/2.7.2/lib/ruby/gems/2.7.0/gems/activerecord-6.0.3.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:337:in `sleep'"}
2021-02-10_03:33:41.13989 rails-web : {"timestamp":"2021-02-10T03:33:41.139Z","pid":53501,"message":"Use Ctrl-C to stop"}
2021-02-10_03:33:41.43953 rails-web : {"timestamp":"2021-02-10T03:33:41.439Z","pid":53501,"message":"! Promoting existing objects to old generation..."}
2021-02-10_03:33:41.54729 rails-web : {"timestamp":"2021-02-10T03:33:41.547Z","pid":53501,"message":"! Compacting..."}
2021-02-10_03:33:41.96601 rails-web : {"timestamp":"2021-02-10T03:33:41.965Z","pid":53501,"message":"! Friendly fork preparation complete."}
2021-02-10_03:33:42.15214 rails-web : {"timestamp":"2021-02-10T03:33:42.151Z","pid":53501,"message":"- Worker 1 (PID: 54598) booted, phase: 0"}
2021-02-10_03:33:42.15230 rails-web : {"timestamp":"2021-02-10T03:33:42.152Z","pid":53501,"message":"- Worker 0 (PID: 54597) booted, phase: 0"}
2021-02-10_03:34:01.25879 rails-web : {"timestamp":"2021-02-10T03:34:01.258Z","pid":53501,"message":"PumaWorkerKiller: Out of memory. 2 workers consuming total: 5881.78125 mb out of max: 3379.04 mb. Sending TERM to pid 54598 consuming 1960.59375 mb."}
2021-02-10_03:34:01.74539 rails-web : {"timestamp":"2021-02-10T03:34:01.744Z","pid":53501,"message":"- Worker 1 (PID: 54720) booted, phase: 0"}
2021-02-10_03:34:21.26545 rails-web : {"timestamp":"2021-02-10T03:34:21.264Z","pid":53501,"message":"PumaWorkerKiller: Out of memory. 2 workers consuming total: 5881.78125 mb out of max: 3379.04 mb. Sending TERM to pid 54720 consuming 1960.59375 mb."}
2021-02-10_03:34:21.61394 rails-web : {"timestamp":"2021-02-10T03:34:21.613Z","pid":53501,"message":"- Worker 1 (PID: 54897) booted, phase: 0"}
2021-02-10_03:34:41.27195 rails-web : {"timestamp":"2021-02-10T03:34:41.271Z","pid":53501,"message":"PumaWorkerKiller: Out of memory. 2 workers consuming total: 5881.78125 mb out of max: 3379.04 mb. Sending TERM to pid 54897 consuming 1960.59375 mb."}
2021-02-10_03:34:41.60852 rails-web : {"timestamp":"2021-02-10T03:34:41.608Z","pid":53501,"message":"- Worker 1 (PID: 54970) booted, phase: 0"}
2021-02-10_03:35:01.28299 rails-web : {"timestamp":"2021-02-10T03:35:01.281Z","pid":53501,"message":"PumaWorkerKiller: Out of memory. 2 workers consuming total: 5881.78125 mb out of max: 3379.04 mb. Sending TERM to pid 54970 consuming 1960.59375 mb."}
2021-02-10_03:35:01.79813 rails-web : {"timestamp":"2021-02-10T03:35:01.797Z","pid":53501,"message":"- Worker 1 (PID: 55083) booted, phase: 0"}
--snip--
and just keeps repeating. I don't believe this is happening on standard Intel Apple machines.
cc @alipniagov
Edited by Ash McKenzie