The below file is REALLY OLD!
Instead, check out the library I put together at https://github.com/navarr/Sockets
#!/bin/sh | |
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the | |
# CREATE block and create them in separate commands _after_ all the INSERTs. | |
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk. | |
# The mysqldump file is traversed only once. | |
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite | |
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite |
<?php | |
$redis = new Redis(); | |
$redis->connect('127.0.0.1', 6379); | |
for ($i = 0; $i < 100; $i++) { | |
$start = microtime(true); | |
for ($j = 0; $j < 10000; $j++) { | |
$key = sprintf("key:%05d", $j); | |
/* GET or SET */ |
<?php | |
// | |
// | |
//// Decide how many children to use. | |
$children = 10; | |
// Load Predis. If using PHP 5.2, call new Predis_Client() instead. | |
$predis = new Redis(); |
The below file is REALLY OLD!
Instead, check out the library I put together at https://github.com/navarr/Sockets