0

After upgrading to Rails 5, I notice that every 30 seconds, a request to our root url comes in.

Has anyone any idea what this could be?

I checked a few things like closing all browsers, restarting my server, looking at our javascript session timeout check, and checking no rake tasks are running.

Most likely it is something specific to our code and no one can help, but here's hoping! (It was not happening when we were using Rails 4.2)

ryan2johnson9
  • 724
  • 6
  • 21
  • 1
    A) Where are they coming from IP-wise? B) What are these requesting, always just `/`? C) Are you sure this isn't some monitoring service? Check the user-agent. – tadman Mar 31 '21 at 06:51
  • always just `/` IP wise, must be local because It is happening on my dev env and I have no public connection. But I used a breakpoint and got: ```request.remote_ip => "127.0.0.1"``` the user agent is ```request.user_agent => "curl/7.64.0"``` It could well be a monitoring service, but I am not sure which one, or why it would suddenly start monitoring like this after the upgrade to Rails5 – ryan2johnson9 Apr 01 '21 at 08:02
  • 1
    Well, that's likely a `curl` process, but the question is which? Do you use `puma-dev`? I don't think it's a Rails 5 thing so much as now you're seeing requests that previously went somewhere else. – tadman Apr 01 '21 at 20:49
  • ok, we use the `puma` gem, 3.10.0, and we run our server in a docker image locally. I can see the app server there is run with `puma` but we do not have any gem called `puma-dev` installed – ryan2johnson9 Apr 02 '21 at 00:05
  • 1
    If you want to find out what process it is, one way is to try and feed back an outrageously huge page, like several GB of HTML junk, to see if `curl` will use enough CPU to be visible in your process list. From there you can track down the parent process. – tadman Apr 02 '21 at 00:09
  • Thanks, no need because it seems the process is in my docker image where processes are very few, only 8: ```PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 7 user 20 0 1116876 316372 24168 S 0.0 1.0 0:17.46 ruby 406 user 20 0 650996 275348 23832 S 0.0 0.8 0:10.93 ruby 513 user 20 0 9748 3544 3060 R 0.0 0.0 0:00.07 top``` PID 7 is the culprit, it jumps to the top at the same time I see the request get logged. – ryan2johnson9 Apr 02 '21 at 00:26
  • I'm not sure why your Ruby process would call itself. Do you use the `curb` gem? – tadman Apr 02 '21 at 00:27
  • 1
    Normally I use the [Phusion container](https://hub.docker.com/u/phusion) as a base for a Rails app, so I'm not sure what you've got going on here dependency-wise. – tadman Apr 02 '21 at 00:28
  • 1
    false alarm, that is just my rails server getting busy when the request hits it,. Thanks for your help @tadman I haven't been able to work out how to respond with a large file yet, as the request is not getting past the devise authentication, but I am sure I'll find a way. – ryan2johnson9 Apr 02 '21 at 01:02

1 Answers1

1

Our docker configuration was doing a healthcheck every 30 seconds:

HEALTHCHECK --interval=30s --start-period=60s --timeout=6s --retries=3 \
  CMD curl -fL http://localhost:${HTTP_PORT}/ || exit 1

I don't think this question will be very useful to anyone, should I remove it?

ryan2johnson9
  • 724
  • 6
  • 21