SlideShare una empresa de Scribd logo
1 de 117
all the little pieces
 distributed systems with PHP

     Andrei Zmievski @ Digg
    IPC Spring 2009 @ Berlin
Who is this guy?
• Open Source Fellow @ Digg
• PHP Core Developer since 1999
• Architect of the Unicode/i18n support
• Release Manager for PHP 6
• Twitter: @a
• Beer lover (and brewer)
Why distributed?


• Because Moore’s Law will not save
  you

• Despite what DHH says
Share nothing


• Your Mom was wrong
• No shared data on application servers
• Distribute it to shared systems
distribute…


• memory (memcached)
• storage (mogilefs)
• work (gearman)
Building blocks


• GLAMMP - have you heard of it?
• Gearman + LAMP + Memcached
• Throw in Mogile too
memcached
background

• created by Danga Interactive
• high-performance, distributed
  memory object caching system

• sustains Digg, Facebook, LiveJournal,
  Yahoo!, and many others

• if you aren’t using it, you are crazy
background


• Very fast over the network and very
  easy to set up
• Designed to be transient
• You still need a database
architecture

client                  memcached




client                  memcached




client                  memcached
architecture

client                  memcached




client                  memcached




client                  memcached
architecture

client                  memcached




client                  memcached




client                  memcached
architecture

client                  memcached




client                  memcached




client                  memcached
architecture


   memcached
slab #1
slab #2


slab #1
slab #3


slab #2


slab #1
slab #4


slab #3


slab #2


slab #1
slab #4


slab #3


slab #2


           152   152   152   152   152
slab #1
          bytes bytes bytes bytes bytes
slab #4


slab #3


slab #2    456 bytes 456 bytes 456 bytes


           152   152   152   152   152
slab #1
          bytes bytes bytes bytes bytes
slab #4


slab #3        1368 bytes   1368 bytes


slab #2    456 bytes 456 bytes 456 bytes


           152   152   152   152   152
slab #1
          bytes bytes bytes bytes bytes
slab #4                 4104 bytes


slab #3        1368 bytes   1368 bytes


slab #2    456 bytes 456 bytes 456 bytes


           152   152   152   152   152
slab #1
          bytes bytes bytes bytes bytes
memory architecture

• memory allocated on startup, released
  on shutdown
• variable sized slabs (30+ by default)
• each object is stored in the slab most
  fitting its size

• fragmentation can be problematic
memory architecture


• items are deleted:
  • on set
  • on get, if it’s expired
  • if slab is full, then use LRU
applications

• object cache
• output cache
• action flood control / rate limiting
• simple queue
• and much more
PHP clients
PHP clients


• a few private ones (Facebook, Yahoo!,
  etc)
• pecl/memcache
• pecl/memcached
pecl/memcached

• based on libmemcached
• released in January 2009
• surface API similarity to pecl/
  memcache
• parity with other languages
API
• get         • cas
• set         • *_by_key
• add         • getMulti
• replace     • setMulti
• delete      • getDelayed / fetch*
• append      • callbacks
• prepend
consistent hashing
consistent hashing
             A
consistent hashing
             A




 B
consistent hashing
     IP1
             A




 B
consistent hashing
        IP1
              A


IP2-1

                  IP2-2


    B
consistent hashing
        IP1
                A


IP2-1

                    IP2-2


    B
              IP3
consistent hashing
        IP1
                A


IP2-1

                    IP2-2


    B
              IP3
compare-and-swap (cas)


• “check and set”
• no update if object changed
• relies on CAS token
compare-and-swap (cas)
$m = new Memcached();
$m->addServer('localhost', 11211);

do {
       $ips = $m->get('ip_block', null, $cas);

       if ($m->getResultCode() == Memcached::RES_NOTFOUND) {

           $ips = array($_SERVER['REMOTE_ADDR']);
           $m->add('ip_block', $ips);

   } else {

           $ips[] = $_SERVER['REMOTE_ADDR'];
           $m->cas($cas, 'ip_block', $ips);
   }

} while ($m->getResultCode() != Memcached::RES_SUCCESS);
delayed “lazy” fetching


• issue request with getDelayed()
• do other work
• fetch results with fetch() or
  fetchAll()
binary protocol

• performance
  • every request is parsed
  • can happen thousands times a
    second
• extensibility
  • support more data in the protocol
callbacks


• read-through cache callback
• if key is not found, invoke callback,
  save value to memcache and return it
callbacks


• result callback
• invoked by getDelayed() for every
  found item

• should not call fetch() in this case
buffered writes


• queue up write requests
• send when a threshold is exceeded or
  a ‘get’ command is issued
key prefixing


• optional prefix prepended to all the
  keys automatically
• allows for namespacing, versioning,
  etc.
key locality



• allows mapping a set of keys to a
  specific server
multiple serializers


• PHP
• igbinary
• JSON (soon)
future


• UDP support
• replication
• server management (ejection, status
  callback)
tips & tricks
• 32-bit systems with > 4GB memory:
    memcached -m4096 -
    p11211
    memcached -m4096 -
    p11212
    memcached -m4096 -
    p11213
tips & tricks


• write-through or write-back cache
• Warm up the cache on code push
• Version the keys (if necessary)
tips & tricks

• Don’t think row-level DB-style
  caching; think complex objects
• Don’t run memcached on your DB
  server — your DBAs might send you
  threatening notes

• Use multi-get — run things in parallel
delete by namespace
1    $ns_key = $memcache->get(quot;foo_namespace_keyquot;);
2    // if not set, initialize it
3    if ($ns_key === false)
4       $memcache->set(quot;foo_namespace_keyquot;,
5      rand(1, 10000));
6    // cleverly use the ns_key
7    $my_key = quot;foo_quot;.$ns_key.quot;_12345quot;;
8    $my_val = $memcache->get($my_key);
9    // to clear the namespace:
10   $memcache->increment(quot;foo_namespace_keyquot;);
storing lists of data

• Store items under indexed keys:
  comment.12, comment.23, etc
• Then store the list of item IDs in
  another key: comments
• To retrieve, fetch comments and then
  multi-get the comment IDs
preventing stampeding



• embedded probabilistic timeout
• gearman unique task trick
optimization


• watch stats (eviction rate, fill, etc)
  • getStats()
  • telnet + “stats” commands
  • peep (heap inspector)
slabs

• Tune slab sizes to your needs:
  • -f chunk size growth factor (default
    1.25)

  • -n minimum space allocated for key
    +value+flags (default 48)
slabs
slab   class   1:   chunk   size   104   perslab 10082
slab   class   2:   chunk   size   136   perslab 7710
slab   class   3:   chunk   size   176   perslab 5957
slab   class   4:   chunk   size   224   perslab 4681
...
slab   class   38: chunk size 394840 perslab         2
slab   class   39: chunk size 493552 perslab         2



                    Default: 38 slabs
slabs
        Most objects: ∼1-2KB, some larger

slab   class   1:   chunk   size   1048   perslab   1000
slab   class   2:   chunk   size   1064   perslab    985
slab   class   3:   chunk   size   1080   perslab    970
slab   class   4:   chunk   size   1096   perslab    956
...
slab   class 198: chunk size       9224 perslab      113
slab   class 199: chunk size       9320 perslab      112

         memcached -n 1000 -f 1.01
memcached @ digg
ops


• memcached on each app server (2GB)
• the process is niced to a lower level
• separate pool for sessions
• 2 servers keep track of cluster health
key prefixes

• global key prefix for apc, memcached,
  etc

• each pool has additional, versioned
  prefix: .sess.2

• the key version is incremented on
  each release

• global prefix can invalidate all caches
cache chain

• multi-level caching: globals, APC,
  memcached, etc.
• all cache access is through
  Cache_Chain class
• various configurations:
  • APC ➡ memcached
  • $GLOBALS ➡ APC
other


• large objects (> 1MB)
• split on the client side
• save the partial keys in a master one
stats
alternatives


• in-memory: Tokyo Tyrant, Scalaris
• persistent: Hypertable, Cassandra,
  MemcacheDB

• document-oriented: CouchDB
mogile
background

• created by Danga Interactive
• application-level distributed
  filesystem

• used at Digg, LiveJournal, etc
• a form of “cloud caching”
• scales very well
background

• automatic file replication with custom
  policies
• no single point of failure
• flat namespace
• local filesystem agnostic
• not meant for speed
architecture
                     node

          tracker
                     node


          tracker
app                  node
            DB


                     node
          tracker

                     node
architecture
                     node

          tracker
                     node


          tracker
app                  node
            DB


                     node
          tracker

                     node
architecture
                     node

          tracker
                     node


          tracker
app                  node
            DB


                     node
          tracker

                     node
architecture
                     node

          tracker
                     node


          tracker
app                  node
            DB


                     node
          tracker

                     node
architecture
                     node

          tracker
                     node


          tracker
app                  node
            DB


                     node
          tracker

                     node
architecture
                     node

          tracker
                     node


          tracker
app                  node
            DB


                     node
          tracker

                     node
architecture
                     node

          tracker
                     node


          tracker
app                  node
            DB


                     node
          tracker

                     node
architecture
                     node

          tracker
                     node


          tracker
app                  node
            DB


                     node
          tracker

                     node
architecture
                     node

          tracker
                     node


          tracker
app                  node
            DB


                     node
          tracker

                     node
architecture
                     node

          tracker
                     node


          tracker
app                  node
            DB


                     node
          tracker

                     node
architecture
                     node

          tracker
                     node


          tracker
app                  node
            DB


                     node
          tracker

                     node
applications


• images
• document storage
• backing store for certain caches
PHP client



• File_Mogile in PEAR
• MediaWiki one (not maintained)
Example

$hosts = array('172.10.1.1', '172.10.1.2');
$m = new File_Mogile($hosts, 'profiles');
$m->storeFile('user1234', 'image',
              '/tmp/image1234.jpg');

...

$paths = $m->getPaths('user1234');
mogile @ digg
mogile @ digg


• Wrapper around File_Mogile to cache
  entries in memcache
• fairly standard set-up
• trackers run on storage nodes
mogile @ digg

• not huge (about 3.5 TB of data)
• files are replicated 3x
• the user profile images are cached on
  Netscaler (1.5 GB cache)
• mogile cluster load is light
gearman
background


• created by Danga Interactive
• anagram of “manager”
• a system for distributing work
• a form of RPC mechanism
background


• parallel, asynchronous, scales well
• fire and forget, decentralized
• avoid tying up Apache processes
background

• dispatch function calls to machines
  that are better suited to do work
• do work in parallel
• load balance lots of function calls
• invoke functions in other languages
architecture

client                  worker




client      gearmand    worker




client                  worker
architecture

client                  worker




client      gearmand    worker




client                  worker
architecture

client                  worker




client      gearmand    worker




client                  worker
architecture

client                  worker




client      gearmand    worker




client                  worker
architecture

client                  worker




client      gearmand    worker




client                  worker
applications

• thumbnail generation
• asynchronous logging
• cache warm-up
• DB jobs, data migration
• sending email
servers



• Gearman-Server (Perl)
• gearmand (C)
clients

• Net_Gearman
 • simplified, pretty stable
• pecl/gearman
 • more powerful, complex, somewhat
   unstable (under development)
Concepts


• Job
• Worker
• Task
• Client
Net_Gearman

• Net_Gearman_Job
• Net_Gearman_Worker
• Net_Gearman_Task
• Net_Gearman_Set
• Net_Gearman_Client
Echo Job

class Net_Gearman_Job_Echo extends Net_Gearman_Job_Common
{
    public function run($arg)
    {
        var_export($arg);
        echo quot;nquot;;
    }
}                                              Echo.php
Reverse Job
class Net_Gearman_Job_Reverse extends Net_Gearman_Job_Common
{
    public function run($arg)
    {
        $result = array();
        $n = count($arg);
        $i = 0;
        while ($value = array_pop($arg)) {
            $result[] = $value;
            $i++;
            $this->status($i, $n);
        }

        return $result;
    }
}                                            Reverse.php
Worker
define('NET_GEARMAN_JOB_PATH', './');

require 'Net/Gearman/Worker.php';

try {
    $worker = new Net_Gearman_Worker(array('localhost:4730'));
    $worker->addAbility('Reverse');
    $worker->addAbility('Echo');
    $worker->beginWork();
} catch (Net_Gearman_Exception $e) {
    echo $e->getMessage() . quot;nquot;;
    exit;
}
Client

require_once 'Net/Gearman/Client.php';

function complete($job, $handle, $result) {
    echo quot;$job complete, result: quot;.var_export($result,
true).quot;nquot;;
}

function status($job, $handle, $n, $d)
{
    echo quot;$n/$dnquot;;
}
                                                continued..
Client


$client = new Net_Gearman_Client(array('lager:4730'));

$task = new Net_Gearman_Task('Reverse', range(1,5));
$task->attachCallback(quot;completequot;,Net_Gearman_Task::TASK_COMPLETE);
$task->attachCallback(quot;statusquot;,Net_Gearman_Task::TASK_STATUS);

                                                          continued..
Client

$set = new Net_Gearman_Set();
$set->addTask($task);

$client->runSet($set);

$client->Echo('Ich bin ein Berliner');
pecl/gearman



• More complex API
• Jobs aren’t separated into files
Worker
$gmworker= new gearman_worker();
$gmworker->add_server();
$gmworker->add_function(quot;reversequot;, quot;reverse_fnquot;);

while (1)
{
  $ret= $gmworker->work();
  if ($ret != GEARMAN_SUCCESS)
    break;
}

function reverse_fn($job)
{
  $workload= $job->workload();
  echo quot;Received job: quot; . $job->handle() . quot;nquot;;
  echo quot;Workload: $workloadnquot;;
  $result= strrev($workload);
  echo quot;Result: $resultnquot;;
  return $result;
}
Client
$gmclient= new gearman_client();

$gmclient->add_server('lager');

echo quot;Sending jobnquot;;

list($ret, $result) = $gmclient->do(quot;reversequot;, quot;Hello!quot;);

if ($ret == GEARMAN_SUCCESS)
  echo quot;Success: $resultnquot;;
gearman @ digg
gearman @ digg

• 400,000 jobs a day
• Jobs: crawling, DB job, FB sync,
  memcache manipulation, Twitter
  post, IDDB migration, etc.
• Each application server has its own
  Gearman daemon + workers
tips and tricks

• you can daemonize the workers easily
  with daemon or supervisord

• run workers in different groups, don’t
  block on job A waiting on job B

• Make workers exit after N jobs to free
  up memory (supervisord will restart
  them)
Thrift
background


• NOT developed by Danga (Facebook)
• cross-language services
• RPC-based
background

• interface description language
• bindings: C++, C#, Cocoa, Erlang,
  Haskell, Java, OCaml, Perl, PHP,
  Python, Ruby, Smalltalk
• data types: base, structs, constants,
  services, exceptions
IDL
Demo
Thank You


http://gravitonic.com/talks

Más contenido relacionado

La actualidad más candente

plProxy, pgBouncer, pgBalancer
plProxy, pgBouncer, pgBalancerplProxy, pgBouncer, pgBalancer
plProxy, pgBouncer, pgBalancerelliando dias
 
Caching and tuning fun for high scalability @ FOSDEM 2012
Caching and tuning fun for high scalability @ FOSDEM 2012Caching and tuning fun for high scalability @ FOSDEM 2012
Caching and tuning fun for high scalability @ FOSDEM 2012Wim Godden
 
0628阙宏宇
0628阙宏宇0628阙宏宇
0628阙宏宇zhu02
 
Distributed Lock Manager
Distributed Lock ManagerDistributed Lock Manager
Distributed Lock ManagerHao Chen
 
The New MariaDB Offering - MariaDB 10, MaxScale and more
The New MariaDB Offering - MariaDB 10, MaxScale and moreThe New MariaDB Offering - MariaDB 10, MaxScale and more
The New MariaDB Offering - MariaDB 10, MaxScale and moreMariaDB Corporation
 
Connection Pooling in PostgreSQL using pgbouncer
Connection Pooling in PostgreSQL using pgbouncer Connection Pooling in PostgreSQL using pgbouncer
Connection Pooling in PostgreSQL using pgbouncer Sameer Kumar
 
Feed Burner Scalability
Feed Burner ScalabilityFeed Burner Scalability
Feed Burner Scalabilitydidip
 
Toster - Understanding the Rails Web Model and Scalability Options
Toster - Understanding the Rails Web Model and Scalability OptionsToster - Understanding the Rails Web Model and Scalability Options
Toster - Understanding the Rails Web Model and Scalability OptionsFabio Akita
 
MySQL Parallel Replication: inventory, use-cases and limitations
MySQL Parallel Replication: inventory, use-cases and limitationsMySQL Parallel Replication: inventory, use-cases and limitations
MySQL Parallel Replication: inventory, use-cases and limitationsJean-François Gagné
 
Integrated Cache on Netscaler
Integrated Cache on NetscalerIntegrated Cache on Netscaler
Integrated Cache on NetscalerMark Hillick
 
Challenges when building high profile editorial sites
Challenges when building high profile editorial sitesChallenges when building high profile editorial sites
Challenges when building high profile editorial sitesYann Malet
 
Memcachedb: The Complete Guide
Memcachedb: The Complete GuideMemcachedb: The Complete Guide
Memcachedb: The Complete Guideelliando dias
 
GOTO 2013: Why Zalando trusts in PostgreSQL
GOTO 2013: Why Zalando trusts in PostgreSQLGOTO 2013: Why Zalando trusts in PostgreSQL
GOTO 2013: Why Zalando trusts in PostgreSQLHenning Jacobs
 
Java IPC and the CLIP library
Java IPC and the CLIP libraryJava IPC and the CLIP library
Java IPC and the CLIP libraryltsllc
 
MariaDB Server on macOS - FOSDEM 2022 MariaDB Devroom
MariaDB Server on macOS -  FOSDEM 2022 MariaDB DevroomMariaDB Server on macOS -  FOSDEM 2022 MariaDB Devroom
MariaDB Server on macOS - FOSDEM 2022 MariaDB DevroomValeriy Kravchuk
 

La actualidad más candente (19)

plProxy, pgBouncer, pgBalancer
plProxy, pgBouncer, pgBalancerplProxy, pgBouncer, pgBalancer
plProxy, pgBouncer, pgBalancer
 
Caching and tuning fun for high scalability @ FOSDEM 2012
Caching and tuning fun for high scalability @ FOSDEM 2012Caching and tuning fun for high scalability @ FOSDEM 2012
Caching and tuning fun for high scalability @ FOSDEM 2012
 
0628阙宏宇
0628阙宏宇0628阙宏宇
0628阙宏宇
 
Distributed Lock Manager
Distributed Lock ManagerDistributed Lock Manager
Distributed Lock Manager
 
The New MariaDB Offering - MariaDB 10, MaxScale and more
The New MariaDB Offering - MariaDB 10, MaxScale and moreThe New MariaDB Offering - MariaDB 10, MaxScale and more
The New MariaDB Offering - MariaDB 10, MaxScale and more
 
Connection Pooling in PostgreSQL using pgbouncer
Connection Pooling in PostgreSQL using pgbouncer Connection Pooling in PostgreSQL using pgbouncer
Connection Pooling in PostgreSQL using pgbouncer
 
GUC Tutorial Package (9.0)
GUC Tutorial Package (9.0)GUC Tutorial Package (9.0)
GUC Tutorial Package (9.0)
 
Feed Burner Scalability
Feed Burner ScalabilityFeed Burner Scalability
Feed Burner Scalability
 
Shootout at the PAAS Corral
Shootout at the PAAS CorralShootout at the PAAS Corral
Shootout at the PAAS Corral
 
Toster - Understanding the Rails Web Model and Scalability Options
Toster - Understanding the Rails Web Model and Scalability OptionsToster - Understanding the Rails Web Model and Scalability Options
Toster - Understanding the Rails Web Model and Scalability Options
 
MySQL Parallel Replication: inventory, use-cases and limitations
MySQL Parallel Replication: inventory, use-cases and limitationsMySQL Parallel Replication: inventory, use-cases and limitations
MySQL Parallel Replication: inventory, use-cases and limitations
 
Integrated Cache on Netscaler
Integrated Cache on NetscalerIntegrated Cache on Netscaler
Integrated Cache on Netscaler
 
7 Ways To Crash Postgres
7 Ways To Crash Postgres7 Ways To Crash Postgres
7 Ways To Crash Postgres
 
Shootout at the AWS Corral
Shootout at the AWS CorralShootout at the AWS Corral
Shootout at the AWS Corral
 
Challenges when building high profile editorial sites
Challenges when building high profile editorial sitesChallenges when building high profile editorial sites
Challenges when building high profile editorial sites
 
Memcachedb: The Complete Guide
Memcachedb: The Complete GuideMemcachedb: The Complete Guide
Memcachedb: The Complete Guide
 
GOTO 2013: Why Zalando trusts in PostgreSQL
GOTO 2013: Why Zalando trusts in PostgreSQLGOTO 2013: Why Zalando trusts in PostgreSQL
GOTO 2013: Why Zalando trusts in PostgreSQL
 
Java IPC and the CLIP library
Java IPC and the CLIP libraryJava IPC and the CLIP library
Java IPC and the CLIP library
 
MariaDB Server on macOS - FOSDEM 2022 MariaDB Devroom
MariaDB Server on macOS -  FOSDEM 2022 MariaDB DevroomMariaDB Server on macOS -  FOSDEM 2022 MariaDB Devroom
MariaDB Server on macOS - FOSDEM 2022 MariaDB Devroom
 

Similar a All The Little Pieces

Evergreen Sysadmin Survival Skills
Evergreen Sysadmin Survival SkillsEvergreen Sysadmin Survival Skills
Evergreen Sysadmin Survival SkillsEvergreen ILS
 
Scaling Rails with memcached
Scaling Rails with memcachedScaling Rails with memcached
Scaling Rails with memcachedelliando dias
 
Caching and tuning fun for high scalability @ FrOSCon 2011
Caching and tuning fun for high scalability @ FrOSCon 2011Caching and tuning fun for high scalability @ FrOSCon 2011
Caching and tuning fun for high scalability @ FrOSCon 2011Wim Godden
 
How to build a state-of-the-art rails cluster
How to build a state-of-the-art rails clusterHow to build a state-of-the-art rails cluster
How to build a state-of-the-art rails clusterTim Lossen
 
From One to a Cluster
From One to a ClusterFrom One to a Cluster
From One to a Clusterguestd34230
 
Web 2.0 Performance and Reliability: How to Run Large Web Apps
Web 2.0 Performance and Reliability: How to Run Large Web AppsWeb 2.0 Performance and Reliability: How to Run Large Web Apps
Web 2.0 Performance and Reliability: How to Run Large Web Appsadunne
 
PECL Picks - Extensions to make your life better
PECL Picks - Extensions to make your life betterPECL Picks - Extensions to make your life better
PECL Picks - Extensions to make your life betterZendCon
 
PHP Performance with APC + Memcached
PHP Performance with APC + MemcachedPHP Performance with APC + Memcached
PHP Performance with APC + MemcachedFord AntiTrust
 
Rails hosting
Rails hostingRails hosting
Rails hostingwonko
 
BADCamp 2008 DB Sync
BADCamp 2008 DB SyncBADCamp 2008 DB Sync
BADCamp 2008 DB SyncShaun Haber
 
Kettunen, miaubiz fuzzing at scale and in style
Kettunen, miaubiz   fuzzing at scale and in styleKettunen, miaubiz   fuzzing at scale and in style
Kettunen, miaubiz fuzzing at scale and in styleDefconRussia
 
WordPress Performance & Scalability
WordPress Performance & ScalabilityWordPress Performance & Scalability
WordPress Performance & ScalabilityJoseph Scott
 
MySQL Server Backup, Restoration, and Disaster Recovery Planning
MySQL Server Backup, Restoration, and Disaster Recovery PlanningMySQL Server Backup, Restoration, and Disaster Recovery Planning
MySQL Server Backup, Restoration, and Disaster Recovery PlanningLenz Grimmer
 
Caching and tuning fun for high scalability
Caching and tuning fun for high scalabilityCaching and tuning fun for high scalability
Caching and tuning fun for high scalabilityWim Godden
 
10 things i wish i'd known before using spark in production
10 things i wish i'd known before using spark in production10 things i wish i'd known before using spark in production
10 things i wish i'd known before using spark in productionParis Data Engineers !
 
[CB20] Vulnerabilities of Machine Learning Infrastructure by Sergey Gordeychik
[CB20] Vulnerabilities of Machine Learning Infrastructure by Sergey Gordeychik[CB20] Vulnerabilities of Machine Learning Infrastructure by Sergey Gordeychik
[CB20] Vulnerabilities of Machine Learning Infrastructure by Sergey GordeychikCODE BLUE
 

Similar a All The Little Pieces (20)

Memcached Study
Memcached StudyMemcached Study
Memcached Study
 
Evergreen Sysadmin Survival Skills
Evergreen Sysadmin Survival SkillsEvergreen Sysadmin Survival Skills
Evergreen Sysadmin Survival Skills
 
Scaling Rails with memcached
Scaling Rails with memcachedScaling Rails with memcached
Scaling Rails with memcached
 
Caching and tuning fun for high scalability @ FrOSCon 2011
Caching and tuning fun for high scalability @ FrOSCon 2011Caching and tuning fun for high scalability @ FrOSCon 2011
Caching and tuning fun for high scalability @ FrOSCon 2011
 
How to build a state-of-the-art rails cluster
How to build a state-of-the-art rails clusterHow to build a state-of-the-art rails cluster
How to build a state-of-the-art rails cluster
 
From One to a Cluster
From One to a ClusterFrom One to a Cluster
From One to a Cluster
 
Web 2.0 Performance and Reliability: How to Run Large Web Apps
Web 2.0 Performance and Reliability: How to Run Large Web AppsWeb 2.0 Performance and Reliability: How to Run Large Web Apps
Web 2.0 Performance and Reliability: How to Run Large Web Apps
 
PECL Picks - Extensions to make your life better
PECL Picks - Extensions to make your life betterPECL Picks - Extensions to make your life better
PECL Picks - Extensions to make your life better
 
PHP Performance with APC + Memcached
PHP Performance with APC + MemcachedPHP Performance with APC + Memcached
PHP Performance with APC + Memcached
 
Advanced Deployment
Advanced DeploymentAdvanced Deployment
Advanced Deployment
 
Rails hosting
Rails hostingRails hosting
Rails hosting
 
BADCamp 2008 DB Sync
BADCamp 2008 DB SyncBADCamp 2008 DB Sync
BADCamp 2008 DB Sync
 
Kettunen, miaubiz fuzzing at scale and in style
Kettunen, miaubiz   fuzzing at scale and in styleKettunen, miaubiz   fuzzing at scale and in style
Kettunen, miaubiz fuzzing at scale and in style
 
Pecl Picks
Pecl PicksPecl Picks
Pecl Picks
 
WordPress Performance & Scalability
WordPress Performance & ScalabilityWordPress Performance & Scalability
WordPress Performance & Scalability
 
MySQL Server Backup, Restoration, and Disaster Recovery Planning
MySQL Server Backup, Restoration, and Disaster Recovery PlanningMySQL Server Backup, Restoration, and Disaster Recovery Planning
MySQL Server Backup, Restoration, and Disaster Recovery Planning
 
Caching and tuning fun for high scalability
Caching and tuning fun for high scalabilityCaching and tuning fun for high scalability
Caching and tuning fun for high scalability
 
Qcon
QconQcon
Qcon
 
10 things i wish i'd known before using spark in production
10 things i wish i'd known before using spark in production10 things i wish i'd known before using spark in production
10 things i wish i'd known before using spark in production
 
[CB20] Vulnerabilities of Machine Learning Infrastructure by Sergey Gordeychik
[CB20] Vulnerabilities of Machine Learning Infrastructure by Sergey Gordeychik[CB20] Vulnerabilities of Machine Learning Infrastructure by Sergey Gordeychik
[CB20] Vulnerabilities of Machine Learning Infrastructure by Sergey Gordeychik
 

Último

Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 

Último (20)

Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 

All The Little Pieces

Notas del editor

  1. (for any serious amount of traffic) 28 TB of memcached storage at FB
  2. It uses libevent to scale to any number of open connections, uses non-blocking network I/O, refcounts internal objects, and uses its own slab allocator
  3. more on fragmentation later
  4. wish it was called Mangear, then we’d have 3 Ms