当前位置: 首页 > 软件库 > Web应用开发 > >

hyper-express

授权协议 MIT License
开发语言 JavaScript
所属分类 Web应用开发
软件类型 开源软件
地区 不详
投 递 者 归浩博
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

HyperExpress: High Performance Node.js Webserver

Powered by uWebSockets.js

Motivation

HyperExpress aims to be a simple yet perfomant HTTP & Websocket Server. Combined with the power of uWebsockets.js, a Node.js binding of uSockets written in C++, HyperExpress allows developers to unlock higher throughput for their web applications with their existing hardware. This can allow many web applications to become much more performant on optimized data serving endpoints without having to scale hardware.

Some of the prominent features implemented are:

  • Simplified HTTP API
  • Simplified Websocket API
  • Asynchronous By Nature
  • Global & Route-Specific Middlewares Support
  • Modular Routers Support
  • Global Error/Event Handlers
  • Cryptographically Secure Cookie Signing/Authentication
  • ExpressJS API Compatibility Through Shared Methods/Properties

What's Different?

While there may be other uWebsockets.js based packages available, HyperExpress differentiates itself in the following ways:

  • Instantaneous Request Handling
    • HyperExpress implements a request handling model similar to fetch where a request is passed almost instantly to the route handler and the request body can be asynchronously dowloaded/accessed. This behavior allows for aborting of a request and potentially saving on memory usage for endpoints that deal with relatively larger body sizes as the body simply won't be downloaded into memory without access.
  • Simple To Use API
    • HyperExpress implements simple yet understandable methods/properties for its components to allow for clear and concise code that is at many times chainable and asynchronous.
  • Lightweight Package Size
    • HyperExpress is extremely lightweight while implementing almost all of the core functionalities of a webserver providing users with flexibility.
  • High Maintainability
    • Whether you decide to develop on your own fork or expand upon HyperExpress through middlewares, You will be greeted with a concise codebase with descriptive logic comments and JSDoc types that allow for high maintainability.
  • MIT License
    • Some other webserver packages are released under more restrictive licenses and often provide paid "performance efficient" versions of their package. HyperExpress is provided with a flexible MIT licence in which you are free to expand upon the package as you desire while also being able to take advantage of the efficient and maintainable codebase at no cost.

Installation

HyperExpress can be installed using node package manager (npm)

npm i hyper-express

Documentation

  • See > [Examples & Snippets] for small and easy-to-use snippets with HyperExpress.
  • See > [Server] for creating a webserver and working with the Server component.
  • See > [Middlewares] for working with global and route-specific Middlewares in HyperExpress.
  • See > [Router] for working with the modular Router component.
  • See > [Request] for working with the Request component made available through handlers.
  • See > [Response] for working with the Response component made available through handlers.
  • See > [Websocket] for working with Websockets in HyperExpress.
  • See > [SessionEngine] for working with cookie based web Sessions in HyperExpress.

Benchmarks

Below benchmark results were derived using the autocannon HTTP benchmarking utility. The benchmark source code is included in this repository in the benchmarks folder.

CLI Command

This command simulates a high stress situation where 2500 unique visitors visit your website at the same time and their browsers on average make 4 pipelined requests per TCP connection sustained for 30 seconds.

autocannon -c 2500 -d 30 -p 4 http://HOST:PORT/benchmark

Environment Specifications

  • Machine: Ubuntu 20.04 | 1 vCPU | 1GB Mem | 32GB Nvme | Vultr @ $6/Month
  • Node: v16.0.0
  • Method: Two rounds; one to warm-up, one to measure
  • Response Body: Small HTML page with a dynamic timestamp generated with Date. See more in HTML Test.
  • Linux Optimizations: None.

Benchmark Results

Note! uWebsockets.js and HyperExpress were bottlenecked by the network speed of the Vultr instance. While, Fastify and Express were bottlenecked by high CPU usage resulting in a much lower throughput with relatively higher latency numbers. For average use cases, all webservers below can serve requests at lower than 50ms latency.

Version Requests/s Latency Throughput/s
uWebsockets.js 20.0.0 196,721 435 ms 106 Mb/s
HyperExpress 5.0.2 196,833 413 ms 106 Mb/s
NanoExpress 5.1.1 195,728 423 ms 106 Mb/s
Fastify 3.22.0 40,898 565 ms 25 Mb/s
Express 4.17.1 5,791 1740 ms 3.8 Mb/s

License

MIT

  • 通过PowerShell Script修改Hyper-V虚拟机的BIOS GUID 测试中总会遇到客户各种奇怪的需求和使用场景,这不又遇到了一个,客户Hyper-v虚拟机的BIOS GUID为空值导致产品出现异常。因此需要查找命令或者脚本修改Hyper-v虚拟机的BIOS GUID 脚本 很可惜,没有找到命令可以去直接修改Hyper-v Virtual Machine的guest BiosGuid

  •   基于Microsoft基础设施私有云计算搭建 摘要:私有云是指组织机构建设的专供自己使用的云平台,它所提供的服务不是供他人使用,而是供自己的内部人员或分支机构使用,不同于公有云,私有云部署在企业内部网络,因此它的优势是数据安全性、系统可用性等都可以自己控制。   一、引言 云计算[注]是一个提供便捷的可通过网络访问一个可定制的计算资源共享池能力的模式(计算资源包括网络、服务器、存储、应用和服务

  • Rafael Rivera Forward engineer by day, reverse engineer by night. Technical contributor at Thurrott.com Home How To: Get Consumer GPUs Working In Hyper-V Virtual Machines June 6, 2020 Changelog 06/06/

 相关资料
  • Hyper 是一种 App-Centric 的虚拟化技术,我们完全摒弃了传统虚机上必须和物理机一样,运行一个完整 OS 这种看似显然的假设,我们让Docker Image 直接运行在 Hypervisor 上。我们让一组容器直接启动在 hypervisor 上的时间达到 350 毫秒,并且还在进一步优化。而且所有这些,都是“开箱即得的”。 当然有人会问,有了容器为什么还要虚机。诚然,虚机并不是所有

  • Awesome Hyper A curated list of sweet Hyper packages, themes, and resources. Inspired by the awesome list thing. You might also like awesome-node and awesome-npm, which both have CLI stuff you can use

  • HTTP 规范在不久之后就会升级,从 HTTP/1.1 升级到 HTTP/2.0。新的规范包括了许多很棒的新机制,HTTP/1.1 将无法处理这些特性。 Hyper 就是个纯 Python 实现的当前 HTTP/2.0 规范的 draft(9)。(HPACK 规范的 draft5)。 现在,Hyper 几乎可以嵌入式的替代 Python 的标准库 http.client。

  • Hyper Estraier是一个具有强大功能的全文搜索引擎,它由一个日本人开发,支持中文,日文,韩文,英文,以及其它多国语言。Hyper Estraier采用LGPL开源授权协议。 特征: 高速处理:采用index(索引),所以支持快速搜索;能在非常短的时间内为大量文档创建索引。 高精度:采用N-gram方式,支持高精度搜索 高功能:支持短语搜索,正则表达式搜索,属性搜索,类似搜索等 多语言:支

  • Hyper 是一个基于 Web 技术开发的远程终端工具。

  • 本文向大家介绍PowerShell 3.0管理Hyper-V 3.0,包括了PowerShell 3.0管理Hyper-V 3.0的使用技巧和注意事项,需要的朋友参考一下 使用PowerShell 3.0管理Hyper-V 3.0 PowerShell ISE是集成在Windows Server中的PowerShell集成开发环境,在Windows Server 8中,PowerShell ISE