Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Dec 01 09:39
    jdelStrother commented #2756
  • Dec 01 09:39
    jdelStrother commented #2756
  • Dec 01 09:39
    jdelStrother commented #2756
  • Dec 01 09:38
    jdelStrother commented #2756
  • Dec 01 09:38
    jdelStrother commented #2756
  • Nov 25 18:19
    jacobherrington opened #2761
  • Nov 24 17:39

    MSP-Greg on master

    [CI] OpenSSL 3.0 - Fix error me… (compare)

  • Nov 24 17:39
    MSP-Greg closed #2760
  • Nov 24 17:06
    MSP-Greg labeled #2760
  • Nov 24 17:06
    MSP-Greg labeled #2760
  • Nov 24 17:04
    lucaskanashiro commented #2760
  • Nov 24 17:03
    lucaskanashiro synchronize #2760
  • Nov 24 16:09
    MSP-Greg ready_for_review #2751
  • Nov 24 16:07
    MSP-Greg commented #2760
  • Nov 24 15:59
    lucaskanashiro commented #2760
  • Nov 24 15:58
    lucaskanashiro synchronize #2760
  • Nov 24 14:46
    MSP-Greg commented #2760
  • Nov 24 14:40
    brauliobo commented #1280
  • Nov 24 14:40
    lucaskanashiro commented #2760
  • Nov 24 14:38
    brauliobo commented #1280
Michael Graf
@m-graf
Hey all, If I'm understanding correctly puma has no default timeout, and should only be explicitly set under config/puma.rb if we want to have a shorter timeout than infinity ?
Nate Berkopec
@nateberkopec
@m-graf No, Puma doesn't have the kind of timeout you're looking for. You need the rack-timeout gem.
Cassidy K
@cassidycodes
Hey All, I know it's a long weekend in the US, but hoping I can get a reply here. I have puma in my gemfile, and I'm using Mina (similar to capistrano) to handle deployment. We're keeping 5 releases on the server. Every 6th release, puma fails to restart and says that it can't find the puma executable. When this happens, it's looking for the executable in the most-recently-deleted release. It's like when Puma daemonizes, it links itself to the executable in the releases path, rather than the current path. I've tried this both using an init.d script. I've also set the directory in my config file, to no avail. Any help here would be greatly appreciated.
It's worth noting that this behaviour is new since we upgraded from 2.10.2 to 3.10.0.
Cassidy K
@cassidycodes
Strangely, when I took a closer look at the error when I was restarting the app, it said it couldn't load the puma binary, but it was referencing a releases directory that still existed.
Cassidy K
@cassidycodes
Just to clarify, when I was using init.d to restart the app, it was referencing a directory that still existed. When I was starting the app on my own with pumactl, it would work 5 times then fail on the 6th when the directory had been deleted.
Marco Colli
@collimarco_twitter
Hello! Currently I use HAProxy to load balance 10 servers. Each server has both nginx (as a reverse proxy) and Puma (as application server). I wonder if nginx is required, or if it would be more performant to use Puma directly (behind HAProxy). The reasons why I have nginx are: 1. serve static assets (like css, js, etc.) faster 2. protect Puma from slow clients
Cameron Seebach
@cseebach-lh
@collimarco_twitter I think you'd want to keep nginx for reason 1. Otherwise, your framework will need to handle those. I'm fairly confident that Rails is much slower at this, and plus with Nginx it's a config file change to start gzipping assets or doing other stuff with them if needed. I'm not convinced it offers any benefits for reason 2, but the best way to know for sure is to run your own test with slow clients.
Cameron Seebach
@cseebach-lh
@collimarco_twitter If you're okay with HAProxy helping out with slow clients, there appears to be some configuration you can do there: https://www.haproxy.com/blog/what-is-a-slow-post-attack-and-how-turn-haproxy-into-your-first-line-of-defense/
Cameron Seebach
@cseebach-lh
@evanphx Is there a channel for puma-dev issues? I'm experiencing problems that are almost certainly related to the configuration of my machine and not to puma-dev, so I'm reluctant to file an issue on GitHub
Brian Purgert
@BrianPurgert
Does puma create a seperate process for each request,
Blane Dabney
@raelik
@BrianPurgert No, it has a set number of threads and/or workers that field the requests
Chris
@ipatch

@raelik just curious but what advantage is there to setting the worker # to something other than 0

when I deploy a rails app using cap & puma I have the below line in my deploy.rb

set :puma_workers,    0
Brian Purgert
@BrianPurgert
@raelik
Blane Dabney
@raelik
@ipatch If you're using jRuby, there isn't one, and in fact, you can't.
If you're using MRI, you can better utilize multiple cores, since MRI doesn't have truly native threads
But, since ruby 1.9 (2.0 maybe?), the I/O is handled internally using native threads, so the typical use cases of threads that wait on I/O will tend to run concurrently even with the GIL locking the green threads.
So I don't think on modern ruby versions there's much use for having multiple workers.
I think if you're doing something more CPU intensive in your Rack app, you may want multiple workers.
Chris
@ipatch
@raelik definitely not using jRuby, all my rails apps are currenty using rvm ruby 2.3.1 love song
Blane Dabney
@raelik
@ipatch Right, so long as your rails apps aren't servicing long-running requests, I think just having a single worker with your threads set appropriately is enough.
Chris
@ipatch
@raelik by single worker you mean cap / puma begins its index at 0 and not 1 ?
Blane Dabney
@raelik
But if you start doing odd things (like say... handling persistent websocket requests), you shouldn't need to use the worker model
Technically, in the case of setting workers, 0 and 1 are effectively the same
0 means you're disabling the worker model entirely.
Chris
@ipatch
ohhh, that i didn’t know, thanks for the explanation 👍
Blane Dabney
@raelik
But setting it to 1 means you're only using 1 worker... so you aren't taking advantage of the worker model. But you also aren't actually disabling it entirely.
Chris
@ipatch
interesting, so the worker model works in conjuction with the threading nature of ruby?
Blane Dabney
@raelik
Pretty sure of that anyway. It's been so long since I've used the worker model
The worker model is actually a way to work around the limited threading in MRI
since it spins up multiple processes.
Chris
@ipatch
hmmm, so workers are new system processes spawned by puma?
Blane Dabney
@raelik
But that became less necessary in ruby 1.9
yes.
Chris
@ipatch
ahhh, that makes sense
Blane Dabney
@raelik
jRuby uses native Java threads, so the worker model is actually permanently disabled if you're using jRuby and Puma (which is my typical use case)
Chris
@ipatch
thanks for the explanation i’ll buy you a cup of ☕️ or 🍺 next time your in town.
Blane Dabney
@raelik
:+1:
Johnathon E Wright
@mustmodify
Just FYI, I had an invalid path for the second argument to stdout_redirect and puma was failing silenty. Quitting silently, I guess.
Blane Dabney
@raelik
@mustmodify what puma version?
you should have seen Cannot redirect STDERR to <your invalid path> in the puma error log
Blane Dabney
@raelik
Oh, I think I see what might be the issue there. That exception will get swallowed depending on how you start Puma
Brian Purgert
@BrianPurgert
Starting puma automatically?
I
How do
L
Brian Purgert
@BrianPurgert
**How do I start puma automatically, aka what is the recommended method? Ive just been running puma in a screen session.
Blane Dabney
@raelik
@BrianPurgert that's completely dependent on your system, deployment strategy, etc.
You might make an init.d script, or a systemd service, or could be a monit config, a line in /etc/rc.local, a launch daemon plist file (for OS X), etc etc
adamjbradley
@adamjbradley
Howdy all!