Created
February 11, 2017 03:39
-
-
Save moznion/3ec337a06dc0c6df745b33e241fe8a52 to your computer and use it in GitHub Desktop.
This file contains hidden or 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/env perl | |
| use strict; | |
| use warnings; | |
| use utf8; | |
| use Cache::Memcached::Fast; | |
| use Parallel::ForkManager; | |
| my $memd = Cache::Memcached::Fast->new({ | |
| servers => ['127.0.0.1:11211'], | |
| }); | |
| my @keys = map {$_} (1..10000); | |
| for my $key (@keys) { | |
| $memd->set($key, 'xxxx' x 1024); | |
| } | |
| my $pm = Parallel::ForkManager->new(25); | |
| while(1) { | |
| my $pid = $pm->start and next; | |
| my $memd = new Cache::Memcached::Fast({ | |
| servers => ['127.0.0.1:11211'], | |
| }); | |
| $memd->get_multi(@keys) for 1..5; | |
| $pm->finish; | |
| } | |
| __END__ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment