0

This is happening to me while in my local environment, Mac OSX, every time I start my server - puma - and workers - resque.

The logs don't say anything helpful, just a repeated, "could not fork autovacuum worker process: Resource temporarily unavailable."

Until I turn ctr-c out of the server, it locks up my entire computer. When I try to visit a site in the browser it just hangs, and when I open a new tab in the terminal it says, 'pipe broken' and closes it. The MAC console isn't spitting out anything helpful, at least from what I can tell.

Anyone have any thoughts to why this is?

I've restarted Postgres multiple times to no avail.

EDIT:

Log just started spitting out, 'LOG: could not fork new process for connection: Resource temporarily unavailable'

Puma thread count:

threads_count = ENV.fetch("RAILS_MAX_THREADS") { 10 }.to_i

DB: pool: 100

EDIT2:

Tried to increase max_connection count from 100 to 200, still nothing. Ran into the duplicate postmaster.id error. Removed it, restarted Postgres, but still the same issue remains - cleared the postmaster.id error though.

Vao Tsun
  • 47,234
  • 13
  • 100
  • 132
Jack Rothrock
  • 407
  • 1
  • 8
  • 21

2 Answers2

0

I followed these two articles, and so far this seems to work. Will update if something changes.

https://github.com/sociam/indx/wiki/Increasing-max-connections-under-os-x

http://big-elephants.com/2012-12/tuning-postgres-on-macos/

Edit: From what I have experienced, this hasn't helped me. Removing the postmaster.pid doesn't seem to do much either, but seems to do more than said above. If any one stumbles upon this and figures it out, if you could post about it that would be great. I'll update if anything else changes. FWIW, when this happens, sometimes Reddis takes a shit and says that it no longer can save to disk.

Jack Rothrock
  • 407
  • 1
  • 8
  • 21
0

I was having the same issue and tried the fixes that @jack-rothrock had proposed on his answer, to no avail.

I noticed that when I tried to start postgres from the command line using homebrew services, I would get a message that postgres was already running, which reminded me that I had installed the "Postgres App" (the postgres application you can download from http://postgresapp.com/ . I relaunched that application and not everything works.

Nice way to start the year!

Samantha Cabral
  • 285
  • 3
  • 17
  • What I have noticed is that this will only occur when I've had the server running for a while, and the computer has gone into sleep mode at some point - never being fully shutdown. When I restart my computer it always fixes it, and I've never had a problem in the first session. Have you noticed this as well? – Jack Rothrock Jan 01 '17 at 20:27
  • It was the first time I have ever encountered this issue, so I am not sure. I had different issues in the past with the postgres app not shutting down properly when I restarted my computer. – Samantha Cabral Jan 02 '17 at 13:31
  • Has anyone figured out a solution? I'm still struggling with this – Zubin Apr 05 '17 at 15:05