The perfectapi benchmark used an actual module that uses perfectapi, namely node-sharedmem. This module was chosen because it has no external dependencies, and has very little logic.
Server Software: | |
Server Hostname: 10.110.49.174 | |
Server Port: 8000 | |
Document Path: / | |
Document Length: 12 bytes | |
Concurrency Level: 250 | |
Time taken for tests: 9.339 seconds | |
Complete requests: 16000 |
This set of benchmarks explores the impact on a Node.js HTTP API server when some responses take more cpu than others. The requests are to a JSON page that calculates a random fibonacci sequence between 1 and 30. The server is using node-perfectapi with a feature that scales the http server across available cpus, while leaving the user's API code in the main Node.js process.
In the red series, the http server is running in the same process as the Fibonacci calculations. In the green series, the handling of all of the http web server stuff has been moved to separate node workers. In both cases, the Fibonacci calculations occur in a single thread in the main (master) Node process.
Now obviously the red series is going to be slower than the green series (because it is restricted to a single cpu for both http requests/responses and the calculati
{ "exports": "fib", | |
"signature": [ | |
{ | |
"name": "fib", | |
"synopsis": "runs a fibonacci sequence", | |
"verb": "POST", | |
"parameters": [ | |
{"name": "number", "required":true, "description":"which fibonacci to calculate"} | |
] | |
}, |
ubuntu@domU-12-31-39-0C-49-FB:~$ ab -n 8000 -c 250 -k http://localhost:8001/middleware | |
This is ApacheBench, Version 2.3 <$Revision: 655654 $> | |
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ | |
Licensed to The Apache Software Foundation, http://www.apache.org/ | |
Benchmarking localhost (be patient) | |
Completed 800 requests | |
Completed 1600 requests | |
Completed 2400 requests | |
Completed 3200 requests |
//simple filter to decode html-encoded values, for display in options or inputs | |
//optimized so that it doesn't redo the expensive decoding every time | |
myApp.filter('decoded', function() { | |
"use strict"; | |
let e = null; //only init as-needed, and keep around | |
let cache = {}; | |
function htmlDecode(input) { | |
if (cache[input]) { |
Use chocolatey to install software. From an administrative command prompt:
@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
Re-open the administrative command prompt afterward to ensure all changes are reflected.
INFO[0000] updated log level logLevel=debug | |
DEBU[0000] created scoped scope new=rexray.cli parentScopes=rexray, | |
DEBU[0000] os.args time=1510847816918 val=[rexray volume ls] | |
DEBU[0000] activating libStorage cmd=ls time=1510847816918 | |
DEBU[0000] host is empty; initiliazing default services time=1510847816926 | |
DEBU[0000] libStorage auto service mode disabled; services defined time=1510847816928 | |
DEBU[0000] starting embedded libStorage server time=1510847816928 | |
DEBU[0000] created scoped scope new=libstorage.server parentScopes=rexray.cli,rexray, | |
INFO[0000] configured logging libstorage.logging.httpRequests=true libstorage.logging.httpResponses=true libstorage.logging.level=debug server=typhoon-hoof-lr time=1510847816981 | |
DEBU[0000] parsed server auth property libstorage.server.auth.disabled=false server=typhoon-hoof-lr time |
systemd[1]: Started linkerd. | |
systemd[1]: Starting linkerd... | |
linkerd[20228]: -XX:+AggressiveOpts -XX:+CMSClassUnloadingEnabled -XX:CMSInitiatingOccupancyFraction=70 -XX:+CMSParallelRemarkEnabled -XX:+CMSScavengeBeforeRemark -XX:InitialHeapSize=1073741824 -XX:MaxHeapSize=1073741824 -XX:MaxNewSize=357916672 -XX:MaxTenuringThreshold=6 -XX:NewSize=357916672 -XX:OldPLABSize=16 -XX:OldSize=715825152 -XX:+PrintCommandLineFlags -XX:+ScavengeBeforeFullGC -XX:-TieredCompilation -XX:+UseCMSInitiatingOccupancyOnly -XX:+UseCompressedClassPointers -XX:+UseCompressedOops -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+UseStringDeduplication | |
linkerd[20228]: Dec 06, 2017 5:01:56 PM com.twitter.finagle.http.HttpMuxer$ $anonfun$new$1 | |
linkerd[20228]: INFO: HttpMuxer[/admin/metrics.json] = com.twitter.finagle.stats.MetricsExporter(<function1>) | |
linkerd[20228]: Dec 06, 2017 5:01:56 PM com.twitter.finagle.http.HttpMuxer$ $anonfun$new$1 | |
linkerd[20228]: INFO: HttpMuxer[/admin/per_host_metrics.json] = com.twitter.finagle.stats.HostMetric |
# one or the other, NOT both | |
[url "https://github"] | |
insteadOf = git://github | |
# or | |
[url "[email protected]:"] | |
insteadOf = git://github |