{"action":"closed","issue":{"url":"https://api.github.com/repos/puma/puma/issues/1008","repository_url":"https://api.github.com/repos/puma/puma","labels_url":"https://api.github.com/repos/puma/puma/issues/1008/labels{/name}","comments_url":"https://api.github.com/repos/puma/puma/issues/1008/comments","events_url":"https://api.github.com/repos/puma/puma/issues/1008/events","html_url":"https://github.com/puma/puma/issues/1008","id":162317943,"number":1008,"title":"Puma not up to the mark with respect to Unicorn","user":{"login":"brahamshakti","id":2370848,"avatar_url":"https://avatars.githubusercontent.com/u/2370848?v=3","gravatar_id":"","url":"https://api.github.com/users/brahamshakti","html_url":"https://github.com/brahamshakti","followers_url":"https://api.github.com/users/brahamshakti/followers","following_url":"https://api.github.com/users/brahamshakti/following{/other_user}","gists_url":"https://api.github.com/users/brahamshakti/gists{/gist_id}","starred_url":"https://api.github.com/users/brahamshakti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brahamshakti/subscriptions","organizations_url":"https://api.github.com/users/brahamshakti/orgs","repos_url":"https://api.github.com/users/brahamshakti/repos","events_url":"https://api.github.com/users/brahamshakti/events{/privacy}","received_events_url":"https://api.github.com/users/brahamshakti/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2016-06-26T08:25:03Z","updated_at":"2016-07-24T04:38:24Z","closed_at":"2016-07-24T04:38:24Z","body":"Hi I have puma.rb which look exactly like\r\n\r\n    directory '/home/rubyist/applications/current/MyApp'\r\n    rackup \"/home/rubyist/applications/current/MyApp/config.ru\"\r\n    environment 'production'\r\n\r\n    pidfile \"/home/rubyist/applications/shared/tmp/pids/puma.pid\"\r\n    state_path \"/home/rubyist/applications/shared/tmp/pids/puma.state\"\r\n    stdout_redirect '/home/rubyist/applications/shared/log/puma_access.log',     /home/rubyist/applications/shared/log/puma_error.log', true\r\n\r\n    threads 0,5\r\n\r\n    bind 'unix:/tmp/sockets/puma.sock'\r\n\r\n    workers 3\r\n\r\n    preload_app!\r\n\r\n    on_restart do\r\n      puts 'Refreshing Gemfile'\r\n      ENV[\"BUNDLE_GEMFILE\"] = \"/home/rubyist/applications/current/Gemfile\"\r\n    end\r\n\r\n    before_fork do\r\n      ActiveRecord::Base.connection_pool.disconnect!\r\n    end\r\n\r\n    on_worker_boot do\r\n      ActiveSupport.on_load(:active_record) do\r\n        ActiveRecord::Base.establish_connection\r\n      end\r\n    end\r\n\r\nand my nginx conf file is like\r\n\r\n    upstream puma_MyApp_production { \r\n      server unix:/tmp/sockets/puma.sock fail_timeout=0;\r\n    }\r\n    server {\r\n\r\n      listen 80;\r\n      client_max_body_size 4G;\r\n      keepalive_timeout 10;\r\n\r\n      error_page 500 502 504 /500.html;\r\n      error_page 503 @503;\r\n\r\n      server_name production.myapp.in;\r\n      root /home/rubyist/applications/current/MyApp/public;\r\n      try_files $uri/index.html $uri @puma_MyApp_production;\r\n\r\n      location @puma_MyApp_production {\r\n        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\r\n        proxy_set_header Host $http_host;\r\n       proxy_redirect off;\r\n       proxy_pass http://puma_MyApp_production;\r\n       # limit_req zone=one;\r\n       access_log /home/rubyist/applications/shared/log/nginx.access.log;\r\n       error_log /home/rubyist/applications/shared/log/nginx.error.log;\r\n      }\r\n    }\r\n\r\nand I am still getting these errors\r\n\r\n>  upstream prematurely closed connection while reading response header from upstream\r\n>  upstream timed out (110: Connection timed out) while reading response header from upstream\r\n>  failed (104: Connection reset by peer) while reading response header from upstream.\r\n>  502 Badgateway\r\n\r\nSome time request fulfilled but some time I get this response. Do you guys have any idea what wrong with these configuration. \r\n\r\nI shifted from unicorn to puma thinking that it will handle 2000 request with a ramp time of 20 sec. Unicorn was handling around 1500 request in 20 sec ramp period but with puma it is limited to only 500 request and all I get above errors. \r\n\r\nPlease do provide some light on this behavior of  puma w.r.t unicorn and why puma is not up to the mark in handling request. My system is 2 core cpu with 8 GB ram centos server/\r\n"}}
{"actor":{"display_login":"evanphx"}}