I'm migrating my Restify project to Nest and I have to migrate the throttle plugin too. I noticed that the Restify throttle plugin uses burst (in requests) and rate (in seconds) as options for throttling.
Are these two properties equivalent to Nest throttle module properties limit (in requests) and ttl (in seconds)?
It makes most sense to me if they would be the same but I can't find much information about this.
After a cursory look at their documentation, yes
Related
Fastify is much faster than Express, achieving almost two times better benchmarks results.
So how they’re achieving this while keeping express as core (nestjs)?
From Performance (Fastify) in the NestJS docs:
"A fair question is why does Nest use Express as the default HTTP provider? The reason is that Express is widely-used, well-known, and has an enormous set of compatible middleware, which is available to Nest users out-of-the-box."
If you prefer high performance, you can follow that docs page to switch to the Fastify framework adapter.
I'm looking for a simple way to know how many records are being created by my Node.js analytics service. I came across average-requests-per-minute Express middleware, but the author says:
Disclaimer: it's very simple, trivial, keeps things in memory, and does not verify all the parameters. It is not tested well (yet), so use at your own risk.
That makes me not event want to use that module in development...
What is a simple way to calculate average requests per minute in an Express app, managed by pm2, ran on EC2?
You can try pm2 custom metrics.
I just started with Meteor app development and have a use case which I am not sure is good for meteor.
We have a java application that pushes data to redis at a very fast rate (data updates in less than 50 milliseconds) and we are building a web application (on NodeJS) which connects to this redis instance and sends the data to the client. For now (with native NodeJS app), we are sending data only twice a second (as we do not require such fast updates).
My question is, how can I achieve the same with Meteor? As we know Meteor has live-query which will tend to send data as soon as it changes, but this is not optimum for us. Is there a way to tune live-query to send data say only after a certain time?
Thanks
I think you are looking for ways to throttle meteors calls. This could be done with this library.
This issue has been also discussed here. Reading up on it I think they still haven't implemented it in core. This would make sense since there are no out-of-the-box throttling mechanisms in node or iojs.
Hope this was helpful.
I would like to script benchmark of my socket.io implementation.
After some research I have identified several NodeJS modules, but they have either not been updated for past years (wsbench), or are only supporting websocket protocol (wsbench, thor) or is not testing socket.io implementation but socket.io project (socket.io-benchmark).
Since socket.io project has been highly active the past year, I wonder what is the latest and greatest tool/module to use for benchmarking?
My requirements:
Easy to script and run the tests
Test reports giving good overview of test runs
Test reports should be easy to save in order to compare with later benchmarking
Just came across this in search of some benchmarking for my Socket.IO project.
I found socket.io-benchmark, however had some additional items that I wanted to work through but found one of the forks nearly there.
https://github.com/slowthinker/socket.io-benchmark
I also forked it to add a cap on messagse/second sent to give it more realistic parameters.
Hope that helps!
I would suggest Artillery: Artillery is a modern, powerful, easy-to-use, open-source load-testing toolkit: https://github.com/shoreditch-ops/artillery
Here some feature:
Mulitple protocols: Load-test HTTP, WebSocket and Socket.io applications
Scenarios: Specify scenarios to test multi-step interactions in your API or web app
Perfomance metrics: get detailed performance metrics (latency, requests per second, concurrency, throughput)
Scriptable: write custom logic in JS to do pretty much anything
High performance: generate serious load on modest hardware
Integrations: statsd support out of the box for real-time reporting (integrate with Datadog, Librato, InfluxDB etc)
Extensible: custom reporting plugins, custom protocol engines etc
and more! HTML reports, nice CLI, parameterization with CSV files
I have a question - does anyone has any benchmark data re. using Express JS framework vs pure Node.js?
Is this something that even should be considered -- or using Express or similar framework is definitely a MUST if you're building a more or less large web app?
EDIT:
The article I linked to below disappeared, and I couldn't find it after searching around a bit. However, in lieu of that, here are a couple of relevant references with sufficiently scientific benchmarks:
https://github.com/koajs/koa/blob/master/docs/koa-vs-express.md#is-koa-faster-than-express
http://serdardogruyol.com/?p=111
http://qzaidi.github.io/2013/07/20/surprises/
Although this doesn't answer the delta part of your question, there's some absolute statistics about ExpressJS performance here:
Updated Link
http://blog.perfectapi.com/2012/benchmarking-apis-using-perfectapi-vs-express.js-vs-restify.js/
Looks like, on a small Amazon instance, Express averages:
a very respectable 1,600-1,700 requests per second
Express is a convenience wrapper around node.js, and should not add much latency to your server; your code would probably go through many of the same steps anyway. That being said, if your load tests (or hapless customers) find the server is too slow and/or not scalable, then you should profile at that time, and the bottleneck probably won't be Express.
BTW, even though Express calls itself "high performance", they're naughty for not posting measurements.