Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use an alternative server to solve caching issues & frozen dashboards (replace thin with puma/webrick/unicorn) #47

Closed
dnsmichi opened this issue Oct 12, 2017 · 7 comments

Comments

@dnsmichi
Copy link
Collaborator

Expected Behavior

Possibly works on all clients with no more "frozen" dashboards.

Current Behavior

  • web sockets on Windows do not work
  • refresh and caching issues

Possible Solution

Replace the dashing gem with a different server.

I fear that dashing code changes are required which are not part of this project, but upstream (which is dead, and smashing does not have this sort of patches, see Smashing/smashing#31 for example).

Context

This is the working issue for #15 #29 #7

References:

Possible additional fixes:

@dnsmichi dnsmichi changed the title Use an alternative server aka replace thin with puma/webrick/unicorn Use an alternative server to solve caching issues and frozen dashboards (replace thin with puma/webrick/unicorn) Oct 12, 2017
@dnsmichi
Copy link
Collaborator Author

dnsmichi commented Feb 21, 2018

The main problem atm is that the Dashing gem itself depends on thin in various hardcoded paths. Unless someone forks and patches that, you cannot solve this and other problems.

@dnsmichi
Copy link
Collaborator Author

Since someone asked on Icinga Camp - Smashing as a fork of Dashing does not solve the problem. Their repository doesn't contain valuable fixes in this regard, and technically is more or less the same.

For the time being, this is an unsolved problem.

@dnsmichi dnsmichi changed the title Use an alternative server to solve caching issues and frozen dashboards (replace thin with puma/webrick/unicorn) Use an alternative server to solve caching issues, frozen dashboards and add Windows support (replace thin with puma/webrick/unicorn) Mar 14, 2018
@dnsmichi
Copy link
Collaborator Author

Worth reading: https://medium.com/@whale_eat_squid/why-http-2-isnt-the-answer-35ba28ad8dc3

According to @LordHepipud Microsoft doesn't have SSE enabled in its browsers (IE, edge) but Chrome, etc. seem to work flawlessly. Edge on Android works too.

@dnsmichi dnsmichi changed the title Use an alternative server to solve caching issues, frozen dashboards and add Windows support (replace thin with puma/webrick/unicorn) Use an alternative server to solve caching issues & frozen dashboards (replace thin with puma/webrick/unicorn) Mar 19, 2018
@dnsmichi
Copy link
Collaborator Author

Options

Puma

While researching a bit for #62 I've found different other problems with streaming servers, e.g. Puma in combination with the Sinatra framework.

sinatra/sinatra#1035

Related note - Dashing runs as Sinatra app in a server (thin hardcoded), alternative servers to be evaluated. Thin + Sinatra use the Eventmachine library to support http long polling / streaming, which doesn't work on Windows with Edge/IE as SEE (server sent events) are not implemented by MS.

http://thelazylog.com/long-polling-with-puma-rails-4-and-server-sent-events/

What is Server Sent Events? This is a HTML5 technology which allow browsers to receive updates from server automatically. And when it comes to HTML5 playground, one guy stands out of my way: IE. Please, I have warned you from the beginning of this post that IE will not be supported.

Dashing and Puma

sinatra/sinatra#1035 (comment) provides detailed insights on the problems with implementing Puma and Sinatra streaming. That explains why Dashing did not implement it any sooner, or why there's no development effort in this regard.

Shopify/dashing#677 (comment) also mentions SSE problems without a relation to either Thin, Puma, etc. so #62 clearly is a separate issue.

If one would want to use Puma, which seems to work stable, needs to use an unreleased branch.
Shopify/dashing#677 (comment)
https://github.com/Shopify/dashing/commits/puma_webserver

Unicorn

Unicorn doesn't seem to be an alternative, as many threads suggest to not go for websockets et al.
https://www.reddit.com/r/rails/comments/247fl1/unicorn_push_notifications_websockets_server_side/

Discourse implements Unicorn, but doesn't use websockets. https://samsaffron.com/archive/2015/12/29/websockets-caution-required

Rails

I'm toying with the idea to make use of this project: https://github.com/gottfrois/dashing-rails

This would require more overhead with Rails and Redis, on the other hand it might solve a bunch of problems.

Does not work in Internet Explorer because it relies on Server Sent Events.

Still a no-go until #62 is resolved.

Smashing

Smashing/smashing#64 got rejected for using Puma. Reasoning is the above linked PR on Dashing and issues with Sinatra.

Smashing/smashing#93 makes it even more clear that it is not Puma, but Sinatra related. And that is the inner core of what Dashing depends on being an app for it.

Conclusion

Streaming in Sinatra seems broken, SEE is not supported by MS, Puma as an alternative doesn't work, Smashing doesn't implement any of these changes for that very reason.

We'll have to wait and see.

@thekoma
Copy link

thekoma commented Apr 8, 2018

New candiate maybe?
https://github.com/tabler/tabler

@dnsmichi
Copy link
Collaborator Author

dnsmichi commented Apr 9, 2018

Thanks. My new strategy is to focus and enhance Icinga Web 2 dashboards, adopted in the way Dashing has its advantages. The disadvantages for Dashing are clearly the Ruby framework, dependencies and the websocket "thing". Therefore I'll doubt that there will be much changes to this project in the future.

@dnsmichi
Copy link
Collaborator Author

I've left the Icinga project after some discussions, just in case you are wondering where the web dashboards would be in the future. In the future I'll be working on Prometheus and other open source projects in the cloud native area.

Dashing is something which will be replaced by Grafana, and likewise, GitLab dashboards too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants