{"action":"created","issue":{"url":"https://api.github.com/repos/openresty/openresty/issues/169","repository_url":"https://api.github.com/repos/openresty/openresty","labels_url":"https://api.github.com/repos/openresty/openresty/issues/169/labels{/name}","comments_url":"https://api.github.com/repos/openresty/openresty/issues/169/comments","events_url":"https://api.github.com/repos/openresty/openresty/issues/169/events","html_url":"https://github.com/openresty/openresty/issues/169","id":149207293,"number":169,"title":"Number of active connections steadily increases when an error happens in the logging phase","user":{"login":"ccleung","id":4606790,"avatar_url":"https://avatars.githubusercontent.com/u/4606790?v=3","gravatar_id":"","url":"https://api.github.com/users/ccleung","html_url":"https://github.com/ccleung","followers_url":"https://api.github.com/users/ccleung/followers","following_url":"https://api.github.com/users/ccleung/following{/other_user}","gists_url":"https://api.github.com/users/ccleung/gists{/gist_id}","starred_url":"https://api.github.com/users/ccleung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ccleung/subscriptions","organizations_url":"https://api.github.com/users/ccleung/orgs","repos_url":"https://api.github.com/users/ccleung/repos","events_url":"https://api.github.com/users/ccleung/events{/privacy}","received_events_url":"https://api.github.com/users/ccleung/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":16,"created_at":"2016-04-18T16:46:55Z","updated_at":"2016-04-29T21:07:00Z","closed_at":null,"body":"We have an nginx config file in `/etc/nginx/sites-enabled` that contains the following:\r\n\r\n```\r\nlua_package_path \"/srv/www/some_application/current/lib/?.lua;;\";\r\nerror_log  /var/log/nginx/error.log;\r\n\r\nserver {\r\n  listen 80 default_server backlog=40000;\r\n  listen [::]:80 default_server ipv6only=on backlog=40000;\r\n\r\n  root /usr/share/nginx/html;\r\n  index index.html index.htm;\r\n\r\n  # Make site accessible from http://localhost/\r\n  server_name localhost;\r\n\r\n  proxy_read_timeout 33s;\r\n  proxy_send_timeout 33s;\r\n  client_header_timeout 33s;\r\n  proxy_set_header Host $host;\r\n  proxy_set_header X-Real-IP $remote_addr;\r\n\r\n  real_ip_header X-Forwarded-For;\r\n  set_real_ip_from 0.0.0.0/0;\r\n\r\n  client_max_body_size 102400m;\r\n  gzip on;\r\n  gzip_comp_level 5;\r\n  gzip_min_length 1024;\r\n  gzip_buffers 40 4k;\r\n\r\n set $lua_log_file '/srv/www/some_application/current/lib/some_directory/tools/logger.lua';\r\n\r\n  ## setup logging\r\n  log_by_lua_file $lua_log_file;\r\n  ## end of setup logging\r\n\r\n location = /nginx_stub_status {\r\n    # Turn on nginx stats\r\n    stub_status on;\r\n    # I do not need logs for stats\r\n    access_log off;\r\n    # Security: Only allow localhost\r\n    allow 127.0.0.1;\r\n    # Send rest of the world to /dev/null\r\n    deny all;\r\n  }\r\n}\r\n```\r\n\r\nThe problem we are observing is that if an error happens in the `/logger.lua` file, it will cause the active connections to steadily increase. We are observing active connections by curling `localhost/nginx_stub_status`\r\n\r\nAny idea's why an error in the logging phase (e.g., we have tried explicitly causing an error by running incorrect lua syntax in logger.lua) will cause the nginx active connections to increase?"},"comment":{"url":"https://api.github.com/repos/openresty/openresty/issues/comments/215881982","html_url":"https://github.com/openresty/openresty/issues/169#issuecomment-215881982","issue_url":"https://api.github.com/repos/openresty/openresty/issues/169","id":215881982,"user":{"login":"ccleung","id":4606790,"avatar_url":"https://avatars.githubusercontent.com/u/4606790?v=3","gravatar_id":"","url":"https://api.github.com/users/ccleung","html_url":"https://github.com/ccleung","followers_url":"https://api.github.com/users/ccleung/followers","following_url":"https://api.github.com/users/ccleung/following{/other_user}","gists_url":"https://api.github.com/users/ccleung/gists{/gist_id}","starred_url":"https://api.github.com/users/ccleung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ccleung/subscriptions","organizations_url":"https://api.github.com/users/ccleung/orgs","repos_url":"https://api.github.com/users/ccleung/repos","events_url":"https://api.github.com/users/ccleung/events{/privacy}","received_events_url":"https://api.github.com/users/ccleung/received_events","type":"User","site_admin":false},"created_at":"2016-04-29T21:07:00Z","updated_at":"2016-04-29T21:07:00Z","body":"Thanks for the feedback. We will definitely look into using the timer as a way to use cosockets in the logging phase "}}