{"action":"created","issue":{"url":"https://api.github.com/repos/wandenberg/nginx-push-stream-module/issues/190","labels_url":"https://api.github.com/repos/wandenberg/nginx-push-stream-module/issues/190/labels{/name}","comments_url":"https://api.github.com/repos/wandenberg/nginx-push-stream-module/issues/190/comments","events_url":"https://api.github.com/repos/wandenberg/nginx-push-stream-module/issues/190/events","html_url":"https://github.com/wandenberg/nginx-push-stream-module/issues/190","id":92935558,"number":190,"title":"Ping message interval not working","user":{"login":"geekuillaume","id":1301701,"avatar_url":"https://avatars.githubusercontent.com/u/1301701?v=3","gravatar_id":"","url":"https://api.github.com/users/geekuillaume","html_url":"https://github.com/geekuillaume","followers_url":"https://api.github.com/users/geekuillaume/followers","following_url":"https://api.github.com/users/geekuillaume/following{/other_user}","gists_url":"https://api.github.com/users/geekuillaume/gists{/gist_id}","starred_url":"https://api.github.com/users/geekuillaume/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geekuillaume/subscriptions","organizations_url":"https://api.github.com/users/geekuillaume/orgs","repos_url":"https://api.github.com/users/geekuillaume/repos","events_url":"https://api.github.com/users/geekuillaume/events{/privacy}","received_events_url":"https://api.github.com/users/geekuillaume/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-07-03T20:57:37Z","updated_at":"2015-07-07T06:47:05Z","closed_at":null,"body":"Hello,\r\nFirst thanks for your project. It helps us a lot !\r\n\r\nI've set the variable `push_stream_ping_message_interval` to `30s` but using WebSocket, no ping message is sent.\r\nThis result in a disconnection every 15m (I've set the `push_stream_subscriber_connection_ttl` variable to `15m`).\r\n\r\nHere is the result of `nginx -V`:\r\n```\r\nnginx version: nginx/1.8.0\r\nbuilt by gcc 4.9.2 (Ubuntu 4.9.2-10ubuntu13) \r\nconfigure arguments: --add-module=../nginx-push-stream-module\r\n```\r\n\r\nAnd the configuration:\r\n```\r\npid         logs/nginx.pid;\r\nerror_log   stderr debug;\r\n\r\nmaster_process      off;\r\nworker_rlimit_core  2500M;\r\nworking_directory /tmp;\r\n\r\nworker_processes    auto;\r\nworker_rlimit_nofile 65535;\r\n\r\nevents {\r\n    worker_connections  20000;\r\n    use epoll;\r\n    multi_accept on;\r\n}\r\n\r\nhttp {\r\n    access_log      stdout;\r\n\r\n    keepalive_timeout  0;\r\n\r\n    push_stream_shared_memory_size                100m;\r\n    push_stream_max_channel_id_length             200;\r\n    push_stream_ping_message_interval             10s;\r\n    push_stream_subscriber_connection_ttl         1m;\r\n    push_stream_longpolling_connection_ttl        30s;\r\n    push_stream_timeout_with_body                 off;\r\n\r\n    push_stream_authorized_channels_only        off;\r\n\r\n    push_stream_allowed_origins                 \"*\";\r\n\r\n    push_stream_ping_message_text               \"ping\";\r\n\r\n    server {\r\n        listen          42632;\r\n\r\n        server_name     localhost;\r\n\r\n        location /channels-stats {\r\n            push_stream_channels_statistics;\r\n            push_stream_channels_path               $arg_id;\r\n            allow   127.0.0.1;\r\n            deny    all;\r\n        }\r\n\r\n        location /pub {\r\n            push_stream_publisher admin;\r\n            push_stream_channels_path               $arg_id;\r\n            client_max_body_size                    32k;\r\n            client_body_buffer_size                 32k;\r\n            allow   127.0.0.1;\r\n            deny    all;\r\n        }\r\n\r\n        location ~ /sub/(.*) {\r\n            push_stream_subscriber;\r\n            push_stream_channels_path                   $1;\r\n        }\r\n\r\n        location ~ /ev/(.*) {\r\n            push_stream_subscriber eventsource;\r\n            push_stream_channels_path                   $1;\r\n        }\r\n\r\n        location ~ /lp/(.*) {\r\n            push_stream_subscriber      long-polling;\r\n            push_stream_channels_path         $1;\r\n        }\r\n\r\n        location ~ /ws/(.*) {\r\n            push_stream_subscriber websocket;\r\n            push_stream_channels_path                   $1;\r\n        }\r\n    }\r\n}\r\n```\r\n\r\nI know that if I don't set the `push_stream_subscriber_connection_ttl` variable I will not have connection drops but it can cause some dead connections to be still handled and using ressources right ?\r\n\r\nThanks for your help,\r\nGuillaume"},"comment":{"url":"https://api.github.com/repos/wandenberg/nginx-push-stream-module/issues/comments/119090645","html_url":"https://github.com/wandenberg/nginx-push-stream-module/issues/190#issuecomment-119090645","issue_url":"https://api.github.com/repos/wandenberg/nginx-push-stream-module/issues/190","id":119090645,"user":{"login":"edpelesh","id":1214072,"avatar_url":"https://avatars.githubusercontent.com/u/1214072?v=3","gravatar_id":"","url":"https://api.github.com/users/edpelesh","html_url":"https://github.com/edpelesh","followers_url":"https://api.github.com/users/edpelesh/followers","following_url":"https://api.github.com/users/edpelesh/following{/other_user}","gists_url":"https://api.github.com/users/edpelesh/gists{/gist_id}","starred_url":"https://api.github.com/users/edpelesh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edpelesh/subscriptions","organizations_url":"https://api.github.com/users/edpelesh/orgs","repos_url":"https://api.github.com/users/edpelesh/repos","events_url":"https://api.github.com/users/edpelesh/events{/privacy}","received_events_url":"https://api.github.com/users/edpelesh/received_events","type":"User","site_admin":false},"created_at":"2015-07-07T06:47:05Z","updated_at":"2015-07-07T06:47:05Z","body":"I do understand that these are control frames with opcode 0x9 for PING and 0xA for PONG. But still, they are not present in Charles and Chrome Dev Tools. Log from https://github.com/square/SocketRocket doesn't show anything either. We may be doing something wrong or this could be a bug in websocket ping/pong handler.\r\n\r\nOff-topic: is there a way to reset `push_stream_subscriber_connection_ttl` based on last received message? The case is when using mobile network, a connection may suddenly go away and socket can't close appropriately. I want to close it as soon as possible, so the value for `push_stream_subscriber_connection_ttl` is 1m. This scenario forces client to constantly reconnect every minute. Is there already a solution for this behavior?\r\nThanks in advance."}}