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
<?php | |
# usage: $ php gen_upt01.php 10000 > upt01.txt | |
define('NUM_PAIRS', $argv[1]); | |
define('MAX_USERS', 5000 * 10000); | |
$dbname = 'db01'; | |
$host = 'localhost'; | |
$user = 'root'; |
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
#!/usr/bin/perl -w | |
# description: | |
# inserting benchmark | |
# usage: | |
# $ php gen_upt01.php 10 > upt01.txt | |
# $ ./ibt01.pl -n 1 -r 10 -d db01 -t t01 -f upt01.txt | |
use strict; | |
use MyBench; |
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
<?php | |
# generate unique pairs | |
# usage: $ php gen_upt11.php 10 > upt11.txt | |
define('NUM_PAIRS', $argv[1]); | |
define('MAX_USERS', 5000 * 10000); | |
$dbname = 'db01'; | |
$host = 'localhost'; |
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
#!/usr/bin/perl -w | |
# description: | |
# inserting benchmark | |
# usage: | |
# $ php gen_upt11.php 1000 > upt.txt | |
# $ ./ibt11.pl -n 1 -r 1000 -d db01 -t t11 -f upt11.txt | |
use strict; | |
use MyBench; |
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
#!/usr/bin/perl -w | |
# usage: | |
# $ php generate_unique_pair.php 1000 > unique_pairs.txt | |
# $ ./ibench_a.pl -n 100 -d db01 -t t01 -f unique_pairs.txt | |
use strict; | |
use MyBench; | |
use Getopt::Std; | |
use Time::HiRes qw(gettimeofday tv_interval); |
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
echo "This is a benchmark script for insert." | |
echo "Now, going to have a bench." | |
num=100000 | |
CLI=1 | |
QPC=`expr ${num} / ${CLI}` | |
echo "=== C:${CLI}, Q/C: ${QPC} ===" | |
php generate_unique_pair.php ${num} > unique_pairs.txt | |
php generate_unique_pair_t11.php ${num} > unique_pairs_t11.txt |
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
echo "This is a benchmark script." | |
echo "Now prepare for the bench." | |
echo "Making sampled valid users...." | |
perl -ne 'print if (rand() < .05)' valid_users.txt > sampled_valid_users.txt | |
echo "-> Done. now you can see the number of the users." | |
wc -l sampled_valid_users.txt | |
echo "-> OK. Above you can see the number of the users." | |
echo "Now, going to have a bench." | |
echo "=== C:1, Q/C: 100000 ===" |
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
#!/usr/bin/perl -w | |
# usage : $ ./insert_bench_t11.pl -n 1 -d db01 -t t11 -f unique_pairs_t11.txt | |
use strict; | |
use MyBench; | |
use Getopt::Std; | |
use Time::HiRes qw(gettimeofday tv_interval); | |
use DBI; | |
use Redis; |
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
<?php | |
# usage: $ php generate_unique_pair_t11.php 10 > unique_pairs_t11.txt | |
define('NUM_PAIRS', $argv[1]); | |
define('MAX_USERS', 5000 * 10000); | |
$dbname = 'db01'; | |
$host = 'localhost'; | |
$user = 'root'; |
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
#!/usr/bin/perl -w | |
# usage : $ ./select_t11_verbose.pl -n 100 -r 1000 -d tw -t t1 -f users.txt | |
use strict; | |
use MyBench; | |
use Getopt::Std; | |
use Time::HiRes qw(gettimeofday tv_interval); | |
use DBI; | |