Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 17:07
    MSP-Greg labeled #2899
  • 17:04
    MSP-Greg labeled #2899
  • 17:04
    MSP-Greg labeled #2899
  • 15:18
    MSP-Greg edited #2903
  • 15:17
    MSP-Greg opened #2903
  • 03:24
    maleksiuk commented #2818
  • Jul 01 07:14
    rafaelgurgel commented #2273
  • Jun 30 19:37
    MSP-Greg synchronize #2896
  • Jun 28 23:37
    guilleiguaran synchronize #2892
  • Jun 28 07:42
    kares commented #2899
  • Jun 28 01:39
    MSP-Greg opened #2902
  • Jun 27 19:16
    dentarg commented #2790
  • Jun 27 18:50
    Jarrodsz commented #2790
  • Jun 27 18:46
    MSP-Greg commented #2790
  • Jun 27 18:43
    Jarrodsz commented #2790
  • Jun 27 18:43
    Jarrodsz commented #2790
  • Jun 27 18:37
    Jarrodsz commented #2790
  • Jun 27 18:34
    Jarrodsz commented #2790
  • Jun 27 18:23
    MSP-Greg commented #2899
  • Jun 27 18:22
    dentarg commented #2900
Ryan Condron
@rebelweb
ip is 216.x.x.x so it isn't even an internal address.
Mike Pastore
@mwpastore
what version of puma?
Ryan Condron
@rebelweb
3.4.0
one thing unique to me is I am using chef omnibus so everything is compiled manually nginx, ruby, etc.
Mike Pastore
@mwpastore
Are you using ActionDispatch::RemoteIp?
I am just whitelisting ::1 and 127.0.0.1 nothing else
Mike Pastore
@mwpastore
I think something in your middleware is doing the wrong thing. Take a look at this issue on puma/puma: https://github.com/puma/puma/pull/873#issuecomment-178099895
Try adding this to your Puma config: set_remote_address header: "X-Forwarded-For”
Ryan Condron
@rebelweb
I removed all custom middleware
trying the puma configuration change
still seeing 127.0.0.1
Mike Pastore
@mwpastore
can you add like a logger.debug request.env[‘HTTP_X_FORWARDED_FOR’] somewhere in there? (edit: sorry, wrong var name, try that one)
I didn’t have to do anything special for Puma to parse X-Forwarded-For from Varnish and HAproxy, so this is all a bit mysterious
Ryan Condron
@rebelweb
its not returning anything. this is weird
i am wondering now if the rollbar gem could be causing this
raelik
@raelik
@rebelweb The only way the rollbar gem would be interfering (that I know of) is if you've added X-Forwarded-For to Rollbar.configuration.scrub_headers
But even that should only scrub the headers that get sent to Rollbar, and not actually remove them from the rack request.
Ryan Condron
@rebelweb
I have figured it out it was the way my directives were setup. I had my proxy_set_header directive before the try files directive that lead to location that did the proxy pass. Everything is working now. Thanks everyone for the help guidance.
raelik
@raelik
ohhh, yeah, that'll do it.
ezchen92
@ezchen92
What is an SSL socket as listed in the readme? is that better than a normal unix socket?
ezchen92
@ezchen92
Thanks @raelik
ezchen92
@ezchen92
Does anyone have a minimal nginx/puma conf? I am running into issues getting it to work as a reverse proxy - could it be because I am running as the root user?(permissions)
Mehmet Aydogdu
@mehmetaydogduu
Hi
My rails app is too slow
Using puma
raelik
@raelik
@likelazyeyes I would start looking for other culprits as to why your app is slow.
Dave Allie
@daveallie
Hey guys, I was just wondering if anyone has any idea as to when the next puma version is coming? Would really like to see the fix for #1002 released :D
Mike Pastore
@mwpastore
@daveallie You can always use master! Or even just the 46416cb49ed2f16614f019cee969bb8f5d0a6146 commit, which includes this fix
danilogarcia024
@danilogarcia024
Someone know where to find a tutorial for deploying some apps in the same server with different sub-uri, in Puma?
Mike Pastore
@mwpastore
@danilogarcia024 You’ll want to implement that in Rack, either nesting apps as middleware or using something like Rack::URLMap to build a routing tree. If that’s not an option you’ll likely end up needing to maintain multiple Puma processes with some kind of reverse proxy / request router in front of them
Sam Pierson
@sampierson
Hello. I have a Rails initializer that contains some code that I only want to run when we are running in server mode (not console or test). Than can be done if you boot with rails server as Rails::Server is only defined when that command is run. However we use the puma binary in production, Rails::Server is not defined and Puma::Server is always defined. Is there a way I can detect that I am running inside a puma server?
danilogarcia024
@danilogarcia024
Thanks @mwpastore that is the solution.
Mike Pastore
@mwpastore
:+1:
Ryan Strandt
@ryanstrandt
I am trying to force_ssl with puma and am getting
Puma::HttpParserError: Invalid HTTP format, parsing fails
don't know how to deploy to production?
Yusuke Sangenya
@genya0407
Hello. Does anyone know how to auto-reload classes when code changed?
In my current environment, puma becomes silent (returns no response) when I modify code while puma is up.
Of course, when I restart puma manually, it works correctly.
Nate Berkopec
@nateberkopec
@genya0407 Rails app?
Kimmo Lehto
@kke
where do i put something like "Starting server version #{VERSION}" so it would only show up once when starting puma and not for every worker?
aaand where's the changelog by the way? trying to find what's new in 3.7
oh it's called History.md
raelik
@raelik
@kke You'd use a before_fork block in the puma config.rb file.
Uwe Kubosch
@donv
Hi all! When developing a Rails 5 application, is there any point in having multiple workers in development mode? How are code changes handled for each worker? How do I best adjust the number of workers depending on environment (development/test/qa/production) ?
Marion Duprey
@TiteiKo

Hey folks, is it normal (but I guess not) that even though puma says:

Puma starting in cluster mode...
* Version 3.9.1 (ruby 2.3.4-p301), codename: Private Caller
* Min threads: 1, max threads: 3
* Environment: development
* Process workers: 2
* Phased restart available
* Listening on tcp://0.0.0.0:9295

I have the 2 clusters with 8 threads each...

raelik
@raelik
@TiteiKo Well, I believe ruby has an internal timer thread, and if your rack app spins up it's own background thread, that would add up to 8 threads.
I don't think Puma spins up any additional threads, but I could be wrong and that may be accounting for the difference.
I run my Puma servers on jRuby, so I see many more threads than that.