node.js 关于 heroku hobby dyno,限制
node.js on heroku hobby dyno, limitations
我无法理解将节点与 Heroku Hobby dyno 结合使用的性能限制,这种类型仅包含 1 个网络工作者。
我的 heroku 服务器用于响应 post 请求并启动服务器到服务器的通信。我们称之为 'the process'.
Node.js 是 javascript 并且只有一个事件循环,这是否意味着如果我的 heroku 服务器尚未完成该过程,它将无法启动另一个事件循环?
客户端,用户发送一个 post 请求,该请求启动 'the process'。
如果流程未完成,第二个用户是否可以发送另一个 post 请求并期望发生任何事情?在第一个进程完成之前,我的服务器会挂起吗?
在我的初步测试中,两个用户几乎同时发送请求似乎没有问题,所以我不确定我会遇到什么限制
根据 Heroku 的文档,这不是问题,使用 Node.js 可以毫无问题地处理多个请求。
Dynos and requests
A single dyno can serve thousands of requests per second, but
performance depends greatly on the language and framework you use.
A single-threaded, non-concurrent web framework (like Rails 3 in its
default configuration) can process one request at a time. For an app
that takes 100ms on average to process each request, this translates
to about 10 requests per second per dyno, which is not optimal.
Single threaded backends are not recommended for production
applications because of their inefficient handling of concurrent
requests. Choose a concurrent backend whenever developing and running
a production service.
Multi-threaded or event-driven environments like Java, Unicorn,
EventMachine, and Node.js can handle many concurrent requests. Load
testing your app is the only realistic way to determine request
throughput.
进一步阅读:
在测功机上:https://devcenter.heroku.com/articles/dynos#dyno-types
关于工作和排队:https://devcenter.heroku.com/articles/background-jobs-queueing
异步工作者:https://devcenter.heroku.com/articles/asynchronous-web-worker-model-using-rabbitmq-in-node
我无法理解将节点与 Heroku Hobby dyno 结合使用的性能限制,这种类型仅包含 1 个网络工作者。
我的 heroku 服务器用于响应 post 请求并启动服务器到服务器的通信。我们称之为 'the process'.
Node.js 是 javascript 并且只有一个事件循环,这是否意味着如果我的 heroku 服务器尚未完成该过程,它将无法启动另一个事件循环?
客户端,用户发送一个 post 请求,该请求启动 'the process'。
如果流程未完成,第二个用户是否可以发送另一个 post 请求并期望发生任何事情?在第一个进程完成之前,我的服务器会挂起吗?
在我的初步测试中,两个用户几乎同时发送请求似乎没有问题,所以我不确定我会遇到什么限制
根据 Heroku 的文档,这不是问题,使用 Node.js 可以毫无问题地处理多个请求。
Dynos and requests
A single dyno can serve thousands of requests per second, but performance depends greatly on the language and framework you use.
A single-threaded, non-concurrent web framework (like Rails 3 in its default configuration) can process one request at a time. For an app that takes 100ms on average to process each request, this translates to about 10 requests per second per dyno, which is not optimal.
Single threaded backends are not recommended for production applications because of their inefficient handling of concurrent requests. Choose a concurrent backend whenever developing and running a production service.
Multi-threaded or event-driven environments like Java, Unicorn, EventMachine, and Node.js can handle many concurrent requests. Load testing your app is the only realistic way to determine request throughput.
进一步阅读:
在测功机上:https://devcenter.heroku.com/articles/dynos#dyno-types
关于工作和排队:https://devcenter.heroku.com/articles/background-jobs-queueing
异步工作者:https://devcenter.heroku.com/articles/asynchronous-web-worker-model-using-rabbitmq-in-node