简体   繁体   English

Raspberry Pi上的Web界面

[英]Web Interface on the Raspberry Pi

I have a web application that I developed for use on a Raspberry Pi written in Python and hosted on nginx. 我有一个Web应用程序,该应用程序是为用Python编写并托管在Nginx上的Raspberry Pi开发的。 It's a bit slow to serve new pages, even when there is very little to no logic being processed for the page that's loading (4-5 seconds+). 服务新页面有点慢,即使正在加载的页面几乎没有处理逻辑(4-5秒以上)。

I know that's a common problem as Pi's aren't exactly equipped to handle the load required to deliver web pages super quickly, but I was wondering if anyone had any experience with this and if it would be worthwhile to recreate the app in some other environment? 我知道这是一个普遍的问题,因为Pi并没有完全具备处理超快速交付网页所需的负载的能力,但我想知道是否有人对此有任何经验,是否值得在其他环境中重新创建该应用程序? I was wondering if perhaps a nodejs server would be significantly (a few seconds) quicker in general, or building a single page application using react would be worthwhile? 我想知道,一般来说,nodejs服务器是否会显着更快(几秒钟),或者使用react构建单个页面应用程序是否值得? Or if there is some other solution that would be even faster? 或者,如果还有其他解决方案会更快?

EDIT: 编辑:

more info: raspberry pi 3, json for storing/reading data (very small amounts of data), running chrome, only one user interacting directly with the app, and on the device itself (not from the internet or another network) 更多信息:raspberry pi 3,用于存储/读取数据(非常少量的数据)的json,运行chrome,仅一个用户直接与该应用进行交互,以及在设备本身上(而不是来自Internet或其他网络)

If the frontend will run on a browser executed on a laptop o desktop it will run fine, but if the interface will run on a browser executed on the Pi maybe it will be too expensive in terms of GPU/CPU usage and it will require fine tuning in order to avoid unnecessary re-renders. 如果前端将在笔记本电脑或台式机上运行的浏览器上运行,它将运行良好,但是如果接口将在Pi上运行的浏览器上运行,则在GPU / CPU使用率方面可能会过于昂贵,并且要求进行调整以避免不必要的重新渲染。 So if the browser is on a remote machine ok, if not think about a something like TkInter for UI. 因此,如果浏览器在远程计算机上正常,则不要考虑类似TkInter for UI的事情。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM