Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $memcached_obj = memcache_connect('localhost',11211);
- $keysize = 300;
- $total = 100000;
- // Initialize values
- $s = array();
- for ($k=0;$k<10;$k++)
- {
- $s[$k] = "";
- for ($i=0;$i<$keysize;$i++) $s[$k].=$k;
- }
- // Setting values
- for ($i=0;$i<$total;$i++)
- {
- memcache_set($memcached_obj,'huy'.$i,$s[$i%10]);
- }
- $count = 0;
- // Get them back and count
- for ($i=0;$i<$total;$i++)
- {
- $v = memcache_get($memcached_obj,'huy'.$i);
- if (!$v) $count++;
- elseif ($v != $s[$i%10]) $count++;
- }
- echo "Missed ".$count."/".$total."\n";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement