This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Intel(R) Core(TM)2 Duo CPU T9600 @ 2.80GHz | |
# Ubuntu 9.10 64 bit | |
git clone https://github.com/luvit/luvit.git | |
(cd luvit | |
make | |
make install | |
) | |
git clone git://github.com/JakSprats/Alchemy-Database.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <fstream> | |
#include <string> | |
#include <cstring> | |
#include <ctime> | |
#include <cstdlib> | |
#include <db_cxx.h> | |
using namespace std; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# download | |
git clone git://github.com/JakSprats/Alchemy-Database.git | |
# make the package | |
cd Alchemy-Database; make; | |
# change to directory w/ server, client, & benchmark-tool | |
cd redis/src | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
T=$(tempfile) | |
time sudo find /usr -type f| sort -R | head -n 4000 | sed -e "s/\ /\\\ /g" > $T | |
rm -f rand.files | |
I=0 | |
FILES="" | |
cat $T | while read file; do | |
if [ $I -lt 25 ]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
. ./bash_functions.sh | |
$CLI DROP TABLE item | |
$CLI CREATE TABLE item "(id INT, name TEXT)" | |
$CLI DROP TABLE word2item | |
$CLI CREATE TABLE word2item "(id INT, word_id INT, type INT, seller_id INT, pub_type INT, tag_id INT, item_id INT)" | |
$CLI CREATE INDEX ind_w2i_w ON word2item "(word_id)" | |
$CLI CREATE INDEX ind_w2i_i ON word2item "(item_id)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CLI=./redisql-cli | |
$CLI CONFIG ADD LUA test/alchemy.lua | |
$CLI LUA "function cap_per_fk(max, tbl, fkname, fkval, pkname) | |
wc = fkname .. '=' .. fkval; | |
cnt_s = select('COUNT(*)', tbl, wc); | |
cnt = tonumber(string.sub(cnt_s, 2)); | |
if (cnt > max) then | |
dnum = cnt - max; | |
wcob = wc .. ' ORDER BY ' .. pkname .. ' LIMIT ' .. dnum; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BENCH=./gen-benchmark | |
1.) use PK (no sorting) | |
taskset -c 1 $BENCH -q -c $C -n $REQ -s -A MULTI -Q SELECT \* FROM obycol WHERE "id BETWEEN 1 AND 10 ORDER BY id LIMIT 4 OFFSET 3" | |
38207.73 requests per second | |
2.) use unindexed column (sort) and sort to one column | |
taskset -c 1 $BENCH -q -c $C -n $REQ -s -A MULTI -Q SELECT \* FROM obycol WHERE "id BETWEEN 1 AND 10 ORDER BY m LIMIT 4 OFFSET 3" | |
28815.95 requests per second | |
3.) use unindexed column (sort) and sort to two columns | |
taskset -c 1 $BENCH -q -c $C -n $REQ -s -A MULTI -Q SELECT \* FROM obycol WHERE "id BETWEEN 1 AND 10 ORDER BY j,m LIMIT 4 OFFSET 3" | |
28535.61 requests per second |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime | |
import errno | |
import socket | |
import threading | |
import time | |
import warnings | |
from itertools import chain, imap | |
from redis.exceptions import ConnectionError, ResponseError, InvalidResponse, WatchError | |
from redis.exceptions import RedisError, AuthenticationError |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This test is not that conclusive, but its a start to test how much of a "tax" running AlchemyDB as a VirtualMachine must be paid. | |
All tests were run from one machine to another (both w/ phenom X4 @ 3.0 GHz CPUs) | |
The bare-metal was run on a 64bit Ubuntu 9.10 | |
The Virtual machine was run on the same 64 bit Ubuntu 9.10 and the Virtual Machine was a Debian 5 (32 bit), the Hypervisor was VMware workstation 7.0. | |
A little bit stupid that the Virtual Machine was 32bit, but this is just a quick nothing-special first test to get a ballpark idea ... No special configuration was done in any of this, this is basically right out of the box. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nrows: TOTAL: (WHERE fk=1)1000020 | |
set count=4 WHERE fk = 1 | |
elapsed time: 4375.12(ms) | |
nrows: (WHERE fk=1) count = 4: 10000196 | |
nrows: (WHERE fk=1) count = 99: 0 | |
BATCH UPDATE: set count=99 WHERE fk = 1 | |
elapsed time: 5210.04(ms) |
NewerOlder