Skip to content

Instantly share code, notes, and snippets.

View bnoordhuis's full-sized avatar

Ben Noordhuis bnoordhuis

View GitHub Profile
#undef _GNU_SOURCE
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <linux/version.h>
#include <features.h>
#undef HAVE_FUTIMES
### cluster - /bytes/1024
log2.xml , 38578.2, 0.0, 1213, 0.0, 0
### cluster - /bytes/10240
log3.xml , 14598.6, 0.0, 10878, 0.0, 0
### cluster - /bytes/102400
| cluster (8x) | 0.6.0 | 0.4.12 | 0.2.6 |
========================================================================
http_simple bytes/1024 | 38578 | 6263 | 5461 | 5031 |
http_simple bytes/10240 | 14598 | 2156 | 1969 | 2083 |
http_simple bytes/102400 | 56 | 23 | 201 | 196 |
========================================================================
http_simple buffer/1024 | 39543 | 6640 | 6137 | 5568 |
http_simple buffer/10240 | 23592 | 5559 | 5238 | 4828 |
http_simple buffer/102400 | 5443 | 2654 | 2114 | 2258 |
========================================================================
/*
* Copyright (c) 2011, Ben Noordhuis <info@bnoordhuis.nl>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
*** test/simple/test-net-stream-events-pause-resume-from-client-to-server.js
assert.js:104
throw new assert.AssertionError({
^
AssertionError: true === false
at Server.<anonymous> (/home/bnoordhuis/src/nodejs/node/test/simple/test-net-stream-events-pause-resume-from-client-to-server.js:44:10)
at Server.emit (events.js:67:17)
at TCP.onconnection (net_uv.js:731:8)
Waf: Entering directory `/home/bnoordhuis/src/nodejs/node/out'
Waf: Leaving directory `/home/bnoordhuis/src/nodejs/node/out'
'build' finished successfully (0.058s)
DEST_OS: linux
DEST_CPU: x64
Parallel Jobs: 1
Product type: program
-rwxr-xr-x 1 bnoordhuis bnoordhuis 9.8M 2011-09-03 00:49 out/Release/node
-rwxr-xr-x 1 bnoordhuis bnoordhuis 57M 2011-09-03 00:49 out/Debug/node
python tools/test.py --mode=debug,release
@bnoordhuis
bnoordhuis / fork-vs-vfork.c
Created August 4, 2011 23:37
fork vs vfork
/*
* Copyright (c) 2011, Ben Noordhuis <info@bnoordhuis.nl>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
@bnoordhuis
bnoordhuis / safe-exec.c
Created August 3, 2011 21:11
race-free exec-after-fork
/*
* Copyright (c) 2011, Ben Noordhuis <info@bnoordhuis.nl>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
http = require('http');
fs = require('fs');
FRONTEND_PORT = 8000;
BACKEND_PORT = 8001;
//CONTENT_LENGTH = 2147483648; // 2 GB
CONTENT_LENGTH = 2097152; // 2 MB
function log_events(prefix, obj) {