开源 C 嵌入式 Web 服务器,支持基于 SOAP / JSON-RPC 的 Web 服务,并与 ARM 处理器兼容

发布于 2024-10-06 01:37:12 字数 101 浏览 0 评论 0原文

我正在开发一个项目,将用 C 编写的 Web 服务器嵌入到设备中。要求是它应该支持Web服务(SOAP / JSON-RPC)并且应该与ARM处理器兼容。有什么具体产品的建议或首先看哪里?

I am working on a project to embed a web server written in C into a device. The requirement is that it should support web services (SOAP / JSON-RPC) and should be compatible with ARM processor. Any suggestions of specific products or where to look first?

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

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

发布评论

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

评论(2

嘦怹 2024-10-13 01:37:12

根据您的描述:基于 Linux 的平台,具有 256MB RAM,您基本上可以使用您喜欢的任何 Web 服务器。 256MB RAM 将您的设备从典型的嵌入式领域带入服务器空间。

不用太担心 ARM 支持,因为它得到了 Linux 社区的良好支持。它是 Debian 官方支持的架构之一。我自己在 ARM 上运行几个 Web 服务器,运行 Debian 和 lighttpd,硬件只有 32MB RAM。

前三名最受欢迎的 Web 服务器(受欢迎程度非常重要,因为这意味着如果遇到问题,您可以轻松地通过 google 进行搜索):

  • lighttpd - RAM 使用量非常少,因为它是单线程的,而且 CPU 使用量也非常少。缺点是,如果您尝试在其上运行重量级、CPU 密集型 CGI 应用程序,它的响应速度可能会很慢,因为它是单线程的。

  • Apache2 - RAM 使用量很大。 Apache 的默认操作模式是让线程尽可能长时间地保持活动状态以处理重负载。这意味着大多数时候您会在睡眠进程中耗尽 RAM。但如果您确实需要处理重负载,这是一件好事。适合重型 CGI 应用程序。

  • Nginx - 新事物。没有像 lighttpd 或 Apache 那样有详细的文档记录(目前,显然文档随着时间的推移而改进),但人们一直说它优于两者。它像 Apache2 一样是多线程的,但像 lighttpd 一样是非阻塞的,因此它具有两全其美的优点:一般来说,它使用的 RAM 比 Apache2 少(尽管比 lighttpd 多),并且在负载下的性能至少与 Apache2 一样好,甚至更好。对我来说,唯一真正的缺点是文档。

Given your description: Linux based platform with 256MB RAM, you can basically use any web server you like. 256MB RAM takes your device out of the typical embedded territory into server space.

Don't worry about ARM support too much because it is well supported by the Linux community. It is one of the architectures that is officially supported by Debian. I myself run a couple of web servers on ARM running Debian and lighttpd with hardware having only 32MB RAM.

The top three most popular web servers (and popularity is quite important since it means you can easily google if you have a problem):

  • lighttpd - very light on RAM usage since it is single threaded and very light on CPU usage as well. The disadvantage is that it can be slow to respond if you try to run heavyweight, CPU intensive CGI applications on it since it is single threaded.

  • Apache2 - heavy on RAM usage. Apache's default operating mode is to keep threads alive as long as possible to handle heavy loads. This means most of the time you use up RAM on sleeping processes. But if you DO need to handle heavy loads this is a good thing. Good for heavy duty CGI apps.

  • Nginx - the new kid on the block. Not as well documented (at the moment, obviously documentation improves with time) as either lighttpd or Apache but people have been saying that it outperforms both. It is multithreaded like Apache2 but nonblocking like lighttpd so it has the best of both worlds: it uses less RAM that Apache2 (though more than lighttpd) in general and performs at least as well if not better than Apache2 under load. The only real downside for me is the documentation.

我为君王 2024-10-13 01:37:12

如果设备资源确实不足,请考虑使用嵌入式网络服务器库,例如 Mongooselibsoup (使用 GLib)。但请注意,像 SOAP 和 XML 解析这样的服务通常会占用大量资源。

If the device is really short on resources consider an embedded webserver library like Mongoose or libsoup (using GLib). However note that services like SOAP and XML parsing in general are pretty heavy on resources.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文