Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- brianm (dev) ~ # cat memcached.php
- <?php
- $pid = getmypid();
- for($x=0;$x<20;$x++) {
- $mc = new Memcached("test");
- $mc->addServer("localhost", 11211);
- $mc->get("foo");
- unset($mc);
- $connections = `lsof -n -p $pid | fgrep -c "11211"`;
- echo "$x: $connections";
- }
- ?>
- brianm (dev) ~ # php memcached.php
- 0: 1
- 1: 2
- 2: 2
- 3: 2
- 4: 2
- 5: 3
- 6: 3
- 7: 4
- 8: 4
- 9: 4
- 10: 5
- 11: 6
- 12: 6
- 13: 6
- 14: 6
- 15: 7
- 16: 7
- 17: 7
- 18: 8
- 19: 8
- brianm (dev) ~ # cat memcache.php
- <?php
- $pid = getmypid();
- for($x=0;$x<20;$x++) {
- $mc = new Memcache();
- $mc->addServer("localhost", 11211, true);
- $mc->get("foo");
- unset($mc);
- $connections = `lsof -n -p $pid | fgrep -c "11211"`;
- echo "$x: $connections";
- }
- ?>
- brianm (dev) ~ # php memcache.php
- 0: 1
- 1: 1
- 2: 1
- 3: 1
- 4: 1
- 5: 1
- 6: 1
- 7: 1
- 8: 1
- 9: 1
- 10: 1
- 11: 1
- 12: 1
- 13: 1
- 14: 1
- 15: 1
- 16: 1
- 17: 1
- 18: 1
- 19: 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement