Skip to content

Instantly share code, notes, and snippets.

/**
* Module dependencies.
*/
var redis = require('./index');
var client = redis.createClient(),
times = 800000,
curr = {},
start;
#!/usr/bin/env node
/*
Redis client for Node.js -- tests
Copyright (C) 2010 Fictorial LLC.
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
// A simple web server
var http = require("http"), server;
server = http.createServer(function (request, response) {
response.writeHead(200, {
"Content-Type": "text/plain"
});
response.write("Hello World\n");
Concurrency hello_world incr ratio(b/c)
1 1969.57 1033.73 1.91
2 5570.07 2103.45 2.65
3 9331.06 4217.50 2.21
4 11196.09 5962.03 1.88
5 12057.49 7240.00 1.67
6 12252.72 7774.29 1.58
7 12400.64 8571.86 1.45
8 12528.70 8753.54 1.43
#!/bin/bash
ulimit -n 90000
echo 1024 65000 > /proc/sys/net/ipv4/ip_local_port_range
echo 1 > /proc/sys/net/ipv4/tcp_tw_recycle
echo 1 > /proc/sys/net/ipv4/tcp_tw_reuse
1: Requests per second: 1582.00 [#/sec] (mean)
2: Requests per second: 5650.92 [#/sec] (mean)
3: Requests per second: 6058.32 [#/sec] (mean)
4: Requests per second: 6813.98 [#/sec] (mean)
5: Requests per second: 7783.12 [#/sec] (mean)
6: Requests per second: 8987.17 [#/sec] (mean)
7: Requests per second: 10428.20 [#/sec] (mean)
8: Requests per second: 11345.91 [#/sec] (mean)
9: Requests per second: 12836.78 [#/sec] (mean)
10: Requests per second: 14834.44 [#/sec] (mean)
<?php
$link = mysqli_connect(
'192.168.1.115', /* The host to connect to */
'root', /* The user to connect as */
'', /* The password to use */
'test'); /* The default database to query */
mysqli_query($link, "update requests set num=num + 1 where page_id = 1");
<?php
require_once 'Predis.php';
$single_server = array(
'host' => '192.168.1.115',
'port' => 6379,
'database' => 0
);
// simple set and get scenario
1: Requests per second: 143.00 [#/sec] (mean)
2: Requests per second: 155.59 [#/sec] (mean)
3: Requests per second: 192.46 [#/sec] (mean)
4: Requests per second: 226.68 [#/sec] (mean)
5: Requests per second: 276.77 [#/sec] (mean)
6: Requests per second: 334.29 [#/sec] (mean)
7: Requests per second: 402.05 [#/sec] (mean)
8: Requests per second: 454.71 [#/sec] (mean)
9: Requests per second: 450.13 [#/sec] (mean)
10: Requests per second: 447.77 [#/sec] (mean)
#!/bin/bash
echo gcc -I/usr/include/lua5.1/ -L/usr/local/lib/ -llua -o call_lua{,.c} -llua -ldl -lm
gcc -I/usr/include/lua5.1/ -L/usr/local/lib/ -llua -o call_lua{,.c} -llua -ldl