{"action":"created","issue":{"url":"https://api.github.com/repos/phusion/passenger/issues/1610","labels_url":"https://api.github.com/repos/phusion/passenger/issues/1610/labels{/name}","comments_url":"https://api.github.com/repos/phusion/passenger/issues/1610/comments","events_url":"https://api.github.com/repos/phusion/passenger/issues/1610/events","html_url":"https://github.com/phusion/passenger/issues/1610","id":106640510,"number":1610,"title":"Standalone: Add a way to delay Nginx listening until application boots up","user":{"login":"charlietran","id":659307,"avatar_url":"https://avatars.githubusercontent.com/u/659307?v=3","gravatar_id":"","url":"https://api.github.com/users/charlietran","html_url":"https://github.com/charlietran","followers_url":"https://api.github.com/users/charlietran/followers","following_url":"https://api.github.com/users/charlietran/following{/other_user}","gists_url":"https://api.github.com/users/charlietran/gists{/gist_id}","starred_url":"https://api.github.com/users/charlietran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/charlietran/subscriptions","organizations_url":"https://api.github.com/users/charlietran/orgs","repos_url":"https://api.github.com/users/charlietran/repos","events_url":"https://api.github.com/users/charlietran/events{/privacy}","received_events_url":"https://api.github.com/users/charlietran/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/phusion/passenger/labels/Enhancement","name":"Enhancement","color":"c7def8"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-09-15T20:36:10Z","updated_at":"2015-09-16T15:40:51Z","closed_at":null,"body":"Currently, Passenger Standalone accepts and queues up requests via Nginx while it waits for the application to boot up. However, this can cause unnecessary delays on Heroku with preboot, where it is preferable to actually refuse connections until the application is booted up and can fully serve requests.\r\n\r\nRight now the delay is caused by this sequence of events:\r\n\r\n1. Dyno boots up, Passenger Standalone starts, Nginx accepts requests while the application boots\r\n2. Heroku routes a request to this Dyno, Nginx accepts\r\n3. Requests wait X seconds while the application is still booting\r\n4. Latency spikes!\r\n\r\nIdeally Nginx would not start listening on the public port until the application is ready."},"comment":{"url":"https://api.github.com/repos/phusion/passenger/issues/comments/140781122","html_url":"https://github.com/phusion/passenger/issues/1610#issuecomment-140781122","issue_url":"https://api.github.com/repos/phusion/passenger/issues/1610","id":140781122,"user":{"login":"OnixGH","id":10709325,"avatar_url":"https://avatars.githubusercontent.com/u/10709325?v=3","gravatar_id":"","url":"https://api.github.com/users/OnixGH","html_url":"https://github.com/OnixGH","followers_url":"https://api.github.com/users/OnixGH/followers","following_url":"https://api.github.com/users/OnixGH/following{/other_user}","gists_url":"https://api.github.com/users/OnixGH/gists{/gist_id}","starred_url":"https://api.github.com/users/OnixGH/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OnixGH/subscriptions","organizations_url":"https://api.github.com/users/OnixGH/orgs","repos_url":"https://api.github.com/users/OnixGH/repos","events_url":"https://api.github.com/users/OnixGH/events{/privacy}","received_events_url":"https://api.github.com/users/OnixGH/received_events","type":"User","site_admin":false},"created_at":"2015-09-16T15:40:51Z","updated_at":"2015-09-16T15:40:51Z","body":"I think the easiest approach would be to run Passenger Standalone with the builtin engine and place a separate Nginx in front of it (reverse proxy) that is started after the Passenger hook creates that file and binds to the public port. \r\n\r\nThen you don't have to modify Passenger or Nginx, which is I think the difficult part that @FooBarWidget was referring to."}}