Idle systems stop logging #4081
-
Hello everyone, We have some kiosk systems, a few run on Next.js and the others run on React at a total of around 40 systems. Recently we added tracking with Plausible to see what pages were used most, however, they all seem to drop connection to Plausible after some time. These systems are constant online and may stay on the same page for a long period of time. Does a prolonged idle time cause Plausible to close the connection? We have other projects that are like regular websites and the tracking works fine for those. I know this is not the main use case for Plausible, is there any way to make this work? Thankful for any help! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
Yes, Cowboy, the webserver used by Plausible, drops connections that are idle (no data sent from the client) after 60 seconds. The option is called
Starting in v2.1.0-rc.1 you would be able to mount custom configs into Plausible and configure that value like this import Config
# overrides https://github.com/plausible/analytics/blob/435d7082891004bc55e740c6810fad8f70a09b62/config/runtime.exs#L308-L313 by adding an infinite idle_timeout
config :plausible, PlausibleWeb.Endpoint,
http: [
port: 8000,
ip: {0, 0, 0, 0},
transport_options: [max_connections: :infinity],
protocol_options: [max_request_line_length: 8192, max_header_value_length: 8192, idle_timeout: :infinity]
] |
Beta Was this translation helpful? Give feedback.
-
Thank you for the fast reply! You answered my other question already with your edit 🤩. Visit duration and so on is not really of interest for these systems anyway, but if an idle system gets interaction (e.g. route changes) does Plausible track these events or does it require the browser to refresh first? |
Beta Was this translation helpful? Give feedback.
-
I wonder though, why does it matter that Plausible closes the connection. Wouldn't the new event cause the browser to reconnect since it makes another XHR request? |
Beta Was this translation helpful? Give feedback.
👋 @vanquishkuso
Yes, Cowboy, the webserver used by Plausible, drops connections that are idle (no data sent from the client) after 60 seconds. The option is called
idle_timeout
Starting in v2.1.0-rc.1 you would be able to mount custom configs into Plausible and configure that value like this