Skip to content

Instantly share code, notes, and snippets.

View maciejzgadzaj's full-sized avatar

Maciej Zgadzaj maciejzgadzaj

View GitHub Profile
git clone git://github.com/ry/node.git
cd node
./configure
make
sudo make install
var sys = require('sys'),
http = require('http');
http.createServer(function(req, res) {
res.writeHead(200, {'Content-Type': 'text/html'});
res.write('<p>Hello World</p>');
res.end();
}).listen(8080);
<?php
echo '<p>Hello World</p>';
Concurrency Level: 1000
Time taken for tests: 121.451 seconds
Complete requests: 100000
Failed requests: 879
(Connect: 0, Receive: 156, Length: 567, Exceptions: 156)
Write errors: 0
Total transferred: 29338635 bytes
HTML transferred: 1889607 bytes
Requests per second: 823.38 [#/sec] (mean)
Time per request: 1214.510 [ms] (mean)
Concurrency Level: 1000
Time taken for tests: 21.162 seconds
Complete requests: 100000
Failed requests: 147
(Connect: 0, Receive: 49, Length: 49, Exceptions: 49)
Write errors: 0
Total transferred: 8096031 bytes
HTML transferred: 1799118 bytes
Requests per second: 4725.43 [#/sec] (mean)
Time per request: 211.621 [ms] (mean)
Concurrency Level: 20000
Time taken for tests: 1043.076 seconds
Complete requests: 1000000
Failed requests: 25227
(Connect: 0, Receive: 8409, Length: 8409, Exceptions: 8409)
Write errors: 0
Total transferred: 81265680 bytes
HTML transferred: 18059040 bytes
Requests per second: 958.70 [#/sec] (mean)
Time per request: 20861.529 [ms] (mean)
Concurrency Level: 20000
Time taken for tests: 3570.753 seconds
Complete requests: 1000000
Failed requests: 2617614
(Connect: 0, Receive: 848121, Length: 886497, Exceptions: 882996)
Write errors: 0
Total transferred: 36832520 bytes
HTML transferred: 2372264 bytes
Requests per second: 280.05 [#/sec] (mean)
Time per request: 71415.058 [ms] (mean)
@maciejzgadzaj
maciejzgadzaj / gist:1035621
Created June 20, 2011 13:44
Basic Drupal multipart form example with Previous and Next buttons
<?php
/**
* Implementation of hook_menu().
*/
function test_menu() {
$items = array();
// Form page.
$items['test/form'] = array(
'title' => t('Test Form'),
@maciejzgadzaj
maciejzgadzaj / gist:1036497
Created June 20, 2011 20:27
Basic Drupal multipart form example with Previous and Next buttons.
<?php
/**
* Defines total number of form steps.
*/
define('TEST_FORM_TOTAL_STEPS', 3);
/**
* Implements hook_menu().
*/
// Table header
$header = array(
'fruit' => t('Fruit'),
'a' => t('Vitamin A'),
'b1' => t('Vitamin B1'),
'b2' => t('Vitamin B2'),
);
// Table rows
$rows = array(
// Row 1