Skip to content

Instantly share code, notes, and snippets.

View DukeyToo's full-sized avatar

Steve Campbell DukeyToo

  • Minneapolis, MN, USA
  • 02:58 (UTC -05:00)
View GitHub Profile
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

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.

@DukeyToo
DukeyToo / benchmark.md
Created March 19, 2012 16:42
Benchmarks exploring different patterns of Node.js worker processes on an HTTP server

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.

Benchmark showing response time hit

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"}
]
},
@DukeyToo
DukeyToo / expressjs benchmark 2012-4-11
Created April 11, 2012 19:47
ab benchmarks on EC2 medium instance
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
@DukeyToo
DukeyToo / decoded.js
Last active October 31, 2016 19:27
Optimized filter in es6 for decoding html values for angularjs when displaying in input or options
//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]) {
@DukeyToo
DukeyToo / setup.md
Last active January 5, 2016 14:13
FRC Robotics Windows setup

If you have admin access...

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.

Eclipse

@DukeyToo
DukeyToo / rexray-client.log.sh
Created November 16, 2017 15:59
Rexray logs
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
@DukeyToo
DukeyToo / linkerd.log
Last active December 7, 2017 18:11
linkerd leak log
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
@DukeyToo
DukeyToo / .gitconfig
Created March 11, 2020 14:49 — forked from Kovrinic/.gitconfig
git global url insteadOf setup
# one or the other, NOT both
[url "https://github"]
insteadOf = git://github
# or
[url "git@github.com:"]
insteadOf = git://github