nightscout / nightscout.github.io

website, meta repo for whole project
GNU General Public License v2.0
103 stars 227 forks source link

flyctl is deploying 2 machines for HA and it breaks Nightscout websocket #187

Closed waltersf closed 1 year ago

waltersf commented 1 year ago

Recent versions of flyctl now support the --ha (high availability) parameter, which is set to true by default. However, I encountered an issue where I couldn't find a way to disable this feature. When --ha is enabled, Fly.io creates two machines and deploys Nightscout on both of them. Unfortunately, this setup doesn't include session replication between instances, leading to a problem with websockets. Consequently, numerous messages are being printed in the browser's console, impacting the application's performance.

As a workaround, I issued a command to scaling down the deployment to a single instance:

flyctl scale --app <app_name> count 1

I have tested this workaround, and it appears to resolve the problem. I kindly request you to test the Fly deployment again and apply the provided workaround. If you encounter the same issue and find that the workaround effectively solves it, please update the instructions accordingly.

Best regards,

psonnera commented 1 year ago

Just checked yes, this is happening. Updating the documentation. Thanks for your feedback. Unfortunately very few of those who migrated are able to maintain their site (i.e. install flyctl and make a fly.toml) so I guess V2 upgrade will stop them.