人们使用哪些技术/工具来实现实时网站?

发布于 2024-08-27 22:54:40 字数 521 浏览 2 评论 0原文

我有以下情况:

-我有一个服务器 A 连接到一个每秒发送值和信息的硬件。服务器计算机上的程序可以读取这些值。该服务器 A 位于非常偏远的位置,因此 Internet 连接非常慢且不可靠,但连接确实存在。假设这是北极的一个气象站。

-来自家乡的用户希望以某种方式监控天气值。好吧,用户可以使用远程桌面连接服务器 A,但那样太慢了。

我的想法是以某种方式在 Web 服务器上建立一个网站(让我们称之为 Web 服务器 - B,B 位于主位置)并使服务器 A 连接到服务器 B 并以某种方式发送值,Web 应用程序读取值并显示他们......但是如何做这样一个系统?我知道我可以使用 MySQL 并让服务器 A 连接到服务器 B 上的 SQL 服务器并发送 INSERT 查询,并让服务器 B 上运行的 Web 应用程序不断从 SQL 服务器读取数据,但我认为这太慢了,我认为必须有更好的解决方案。

有什么想法吗?

顺便提一句。用户也应该能够从网站向气象站发送信息(因此应该允许管理员用户从网站或其他方式关闭气象站)

祝好, 麦德塞布

I have the following situation:

-I have a server A hooked up to a piece of hardware that sends values and information out of every second. Programs on the server machine can read these values. This server A is in a very remote location so Internet connection is very slow and not reliable but the connection does exist. Let's say it's a weather station in the Arctic.

-Users from the home location want to monitorize the weather values somehow. Well, the users can use a remote desktop connection the server A but that would be too too slow.

My idea is somehow to have a website on a web server (let's call the webserver - B and B is in a home location ) and make the server A connect to the server B and somehow send values and the web application reads the values and displays them....... but how to do such a system ?? I know I can use MySQL and have the server A connect to a SQL server on server B and send INSERT queries and have the web application running on server B constantly read from the SQL server but I think that would be way way too slow and I think there has to be a better solution.

Any ideas ?

BTW. The users should be able to send information to the weather station from the website as well ( so an ADMIN user should be allowed to shut down the weather station from the website or whatever)

Best regards,
MadSeb

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

把梦留给海 2024-09-03 22:54:40

Ganglia (http://ganglia.sourceforge.net/) 是一种流行的监控工具,支持收集任意统计信息使用 gmetric 工具。你也许可以围绕它构建一些东西。

如果您确实需要推出自己的解决方案,那么您可以在 A 处拥有一个持久消息队列(我是 RabbitMQ 的粉丝),您可以在其中记录指标。然后,您可以在 B 处设置一些东西,侦听队列上的消息并将状态保存在 B 处。

  • 这种方法意味着当连接断开时您不会丢失数据。
  • 该消息可能是一个简单的压缩数据值,例如 csv 或 json,因此在低带宽连接上应该没问题。
  • 所有工作(例如解析 csv 或 json,并将数据保存到数据库)都在 B 处完成,您没有任何限制。

Ganglia (http://ganglia.sourceforge.net/) is a popular monitoring tool that supports collecting arbitrary statistics using the gmetric tool. You might be able to build something around that.

If you do need to roll your own solution then you could have a persistent message queue at A (I'm a fan of RabbitMQ) to which you could log your metrics. You could then have something at B which listens for messages on the queue and saves the state at B.

  • This approach means you don't lose data when the connection drops.
  • The message might be a simple compressed data value, say csv or json so should be fine on low bandwidth connections.
  • All the work (parsing the csv or json, and saving the data to a database for example) is done at B where you don't have limitations.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文