SlideShare a Scribd company logo
Memcached
             http://download.tangent.org/talks/Memcached%20Study.pdf




Thursday, April 23, 2009
memcached is a high-performance, distributed memory object
                           caching system, generic in nature, but intended for use in
                           speeding up dynamic web applications by alleviating
                           database load.




Thursday, April 23, 2009
Who?
                     • Facebook
                     • Yahoo
                     • Amazon
                     • LiveJournal
                     • Mixi
                     • ...
Thursday, April 23, 2009
Why?
                           (aka why would I...)‫‏‬




Thursday, April 23, 2009
Thursday, April 23, 2009
LiveJournal

                     • Origin of memcached
                     • 30G of cache. Terabytes of data
                     • Writes to DB based on reads from the DB,
                           not cache




Thursday, April 23, 2009
Mixi

                     • Memcached on dedicated servers
                     • 300 servers in production (reuse old
                           MySQL Servers)

                     • 4/8 gigs of Memory
                     • 15,000 qps / 400Mbps throughput

Thursday, April 23, 2009
Thursday, April 23, 2009
Patrick Lenz
                           Eins.de
                           http://poocs.net




Thursday, April 23, 2009
Grazr



Thursday, April 23, 2009
100+ Nodes
                  2gigs a Node         Processing



                                                    Incoming Data




                           Memcached




Thursday, April 23, 2009
How



Thursday, April 23, 2009
Server

                     • Slab Allocator
                     • Libevent based
                     • Simple Protocol (no xml)
                     • Server has Internal Hash Table
                     • Servers know nothing about each other

Thursday, April 23, 2009
Clients


                     •     Client hashes Key to Server List (distribution)‫‏‬

                     •     Serializes the Object (server just likes byte arrays)‫‏‬

                     •     Compresses data




Thursday, April 23, 2009
Consistent Hash




Thursday, April 23, 2009
So what should I ask?

                     • How do I dump data?
                     • How is it redundant? *
                     • How does it handle failover?*
                     • How does it authenticate?

Thursday, April 23, 2009
Details on the Server?

                           • set/get/replace/add
                           • append/prepend
                           • increment/decrement
                           • cas (compare and swap atomic!)‫‏‬
                           • stats (detail)‫‏‬

Thursday, April 23, 2009
Platforms

                     • FreeBSD and Linux are top tier
                     • Windows exists
                     • Solaris (as of 1.2.5)‫‏‬
                     • OSX Good Support

Thursday, April 23, 2009
Examples



Thursday, April 23, 2009
Ruby



Thursday, April 23, 2009
 # Set up client object

                            require 'memcache'
                            servers = ['127.0.0.1:43042', '127.0.0.1:43043']
                            CACHE = MemCache.new(servers, :namespace => 'my_app')




Thursday, April 23, 2009
# Get; fall through to Rails' MySQL load if missing

                            key = "recent_posts"
                            # Try to get; returns nil on failure
                            posts = CACHE.get(key)

                            unless posts
                              # Load from DB
                              posts = Post.find(:all, :limit => 10, :order => 'id DESC')
                              # Cache the new value, which is automatically serialized
                              CACHE.set(key), posts, 60
                            end




Thursday, April 23, 2009
# Ghetto locking implementation for memcache-client
                            # from http://fauna.rubyforge.org/svn/interlock/trunk/lib/interlock/lock.rb

                            def lock(key, lock_expiry = 30, retries = 5)
                              retries.times do |count|
                                # Try to acquire the lock
                                response = CACHE.add("lock:#{key}", "Locked by #{Process.pid}", lock_expiry)
                                if response == "STOREDrn"
                                  # We got it
                                  begin
                                    # Yield the current value to the closure
                                    value = yield(CACHE.get(key))
                                    # Set the new value returned from the closure CACHE.set(key, value)
                                    # We're done ('ensure' block will still run)
                                    return value
                                  ensure
                                    # Release the lock
                                    CACHE.delete("lock:#{key}")
                                  end
                                else
                                  # Exponentially back off requests if the lock can't be acquired
                                  sleep((2**count) / 2.0)
                                end
                              end
                              # We waited and waited but our turn never came
                              raise MemCacheError, "Couldn't acquire lock for #{key}"
                            end



Thursday, April 23, 2009
PHP



Thursday, April 23, 2009
/**
           * Initalize Memcache object and add local server 127.0.0.1 using port 11211
           */
          $cache = new Memcache;
          $cache->addServer("127.0.0.1",11211);




Thursday, April 23, 2009
/** Look in cache, if not found, set object (misses null) **/
                       if (!$user = $cache->get($user_key)) {

                           /**
                            * Set object with expire of 1 hour and no compression
                            */
                           $cache->set($user_key,$value,NULL, $expire);
                           $user = $value;
                       }




Thursday, April 23, 2009
/* Get user counter value (does not handle add fail) */
                       if (!$counter = $cache->get($counter_key)) {
                         /* No counter, set to 1 */
                         $cache->add($counter_key,1);
                       } else {
                         /* Increment by 1 */
                         $cache->increment($counter_key);
                       }




Thursday, April 23, 2009
/* Print out stats from memcached server */
                           print_r($cache->getStats());

                           /* Print out extended stats from memcached server */
                           print_r($cache->getExtendedStats());

                           /* Flush memcached (bad idea in production)*/
                           var_dump($cache->flush());




Thursday, April 23, 2009
C



Thursday, April 23, 2009
libmemcached

                     • C/C++ (many language wrappers)
                     • Multiget support
                     • Async/Sync Modes (including buffered)
                     • Supports Binary Protocol (TCP/UDP)
                     • Read Through Cache Support

Thursday, April 23, 2009
memcached_st *memc;
                           memcached_return rc;
                           memc= memcached_create(NULL);
                           ...do stuff...
                           memcached_free(memc);




Thursday, April 23, 2009
memcached_server_st *servers;
                 memcached_st *memc= memcached_create(NULL);
                 char servername[]= "0.example.com";
                 servers= memcached_server_list_append(NULL, servername, 400, &rc);
                 for (x= 0; x < 20; x++)
                 {
                   char buffer[SMALL_STRING_LEN];
                   snprintf(buffer, SMALL_STRING_LEN, "%u.example.com", 400+x);
                   servers= memcached_server_list_append(servers, buffer, 401, &rc);
                 }
                 rc= memcached_server_push(memc, servers);
                 memcached_server_free(servers);
                 memcached_free(memc);




Thursday, April 23, 2009
char *key= "foo";
                           char *value;
                           size_t value_length= 8191;
                           unsigned int x;
                           value = (char*)malloc(value_length);

                           for (x= 0; x < value_length; x++)
                             value[x] = (char) (x % 127);
                           for (x= 0; x < 1; x++)
                           {
                             rc= memcached_set(memc, key, strlen(key),
                             value, value_length,
                             (time_t)0, (uint32_t)0);
                             assert(rc == MEMCACHED_SUCCESS);
                           }
                           free(value);


Thursday, April 23, 2009
memcached_return rc;
            char *keys[]= {"fudge", "son", "food"};
            size_t key_length[]= {5, 3, 4};
            uint32_t flags;
            char return_key[MEMCACHED_MAX_KEY];
            size_t return_key_length;
            char *return_value;
            size_t return_value_length;

            rc= memcached_mget(memc, keys, key_length, 3);

            while ((return_value= memcached_fetch(memc, return_key, &return_key_length,
                                   &return_value_length, &flags, &rc)))
            {
              free(return_value);
            }




Thursday, April 23, 2009
Memcached foo;
                           char *value_set= "Data for server A";
                           char *master_key_a= "server-a";
                           char *master_key_b= "server-b";
                           char *key= "xyz";
                           char *value;
                           size_t value_length;

                           foo.set_by_key(master_key_a, key, value_set, strlen(value_set));
                           value= foo.get_by_key(master_key_a, key, &value_length);

                           assert((memcmp(value, value_set, value_length) == 0));

                           value= foo.get_by_key(master_key_b, key, &value_length);
                           assert((memcmp(value, value_set, value_length) == 0));

                           return 0;




Thursday, April 23, 2009
Application Integration



Thursday, April 23, 2009
lighttpd/mod_memcache
                    • Cache files from disk
                    • Specify mime/types
                    • Create Expire Times




Thursday, April 23, 2009
Apache (mod_memcached)‫‏‬
                    • CAS operations exposed
                    • GET/PUT/DELETE operations
                    • Still Alpha
                    • (pandoraport.com!)


Thursday, April 23, 2009
NGINX
                     • Support variable Time outs
                     • Based on Perl
                     • http://wiki.codemongers.com/
                           NginxHttpMemcachedModule

                     • http://www.igvita.com/2008/02/11/nginx-
                           and-memcached-a-400-boost/


Thursday, April 23, 2009
Memcached Functions
                          for MySQL
                         (and Drizzle)



Thursday, April 23, 2009
Overview...

                     • Uses UDF API and libmemcached
                     • Manage memcached Cluster via SQL
                     • Read through Cache
                     • Write through Cache

Thursday, April 23, 2009
Thursday, April 23, 2009
Installation

                     •     CREATE FUNCTION memc_servers_add RETURNS INT SONAME
                           "libmemcached_functions_mysql.so";

                     •     CREATE FUNCTION memc_set RETURNS INT SONAME
                           "libmemcached_functions_mysql.so";

                     •     CREATE FUNCTION memc_get RETURNS STRING SONAME
                           "libmemcached_functions_mysql.so";




Thursday, April 23, 2009
Functions Available
                     • memc_servers_set();
                     • memc_servers_behavior_set()
                     • memc_set()
                     • memc_get()
                     • memc_append()
                     • memc_prepend()
Thursday, April 23, 2009
Setting via SELECT
           select id, url, memc_set(concat('feeds', md5(url)), url) from feeds;

           select memc_get(concat('feeds', md5(url))) from feeds;
           +-------------------------------------------------------+
           | memc_get(concat('feeds', md5(url)))                   |
           +-------------------------------------------------------+
           | http://feeds.feedburner.com/littlegreenfootballs/Ilds |
           | http://del.icio.us/rss/jacomien                       |
           | http://del.icio.us/rss/tags/rmj20                     |
           | http://www.jihadwatch.org/index.rdf                   |
           | http://www.connotea.org/rss/user/rmj20                |
           | http://devblog.grazr.com/?feed=rss2x                  |
           | http://feeds.feedburner.com/littlegreenfootballs/kyeH |
           +-------------------------------------------------------+




Thursday, April 23, 2009
Trigger
          DROP TRIGGER IF EXISTS feed_insert;
          CREATE TRIGGER feed_insert BEFORE INSERT ON feeds FOR EACH ROW
          BEGIN   SET @mm= memc_set(concat('feeds:',md5(NEW.url)),
          NEW.url);END |


         insert into feeds (url) values ('http://grazr.com/feedlist.xml');

         select memc_get(concat('feeds:', md5('http://grazr.com/feedlist.xml')));
         +------------------------------------------------------------------+|
         memc_get(concat('feeds:', md5('http://grazr.com/feedlist.xml'))) |
         +------------------------------------------------------------------+|
         http://grazr.com/feedlist.xml                                    |
         +------------------------------------------------------------------+




Thursday, April 23, 2009
Memcached Replication
                      via MySQL

                  INSERT INTO table_a VALUES (“key”, “value”, “values”);
                  INSERT INTO blackhole_table VALUES (memc_delete(“key”));




Thursday, April 23, 2009
Implementation



Thursday, April 23, 2009
Limits

                     • Key Size (250 bytes) (1.2 <)‫‏‬
                     • Data Size (under 1 megabyte)‫‏‬
                     • 32bit/64bit (maximum size of the process)‫‏‬
                     • Maxbytes (limits item cache, not everything!)‫‏‬

Thursday, April 23, 2009
LRU
                    • Least recently accessed items are up for
                           eviction

                    • One LRU exists per “slab class”
                    • LRU evictions don't need to be common
                    • Can be common if you set expiration to 0
                    • Monitor evictions via 'stats items' command

Thursday, April 23, 2009
Threads
                    • No single-threading in versions past 1.2
                    • Great for large instances (16G+)
                    • Also great for large multiget requests
                    • Improvements in 1.3+
                    • Don't set too many threads
                     • One per CPU
                     • No more than 8 total for 1.2
Thursday, April 23, 2009
Slab Allocator

                     • Memory permanently allocated from OS
                     • Classes created by chunk size
                     • Cannot (presently) reassign slab pages
                     • Carefully use 'stats sizes' to test efficiency

Thursday, April 23, 2009
Binary Protocol

                            24             HEADER                  Required
                            bytes

                                        EXTRA FIELD
                                        (Command Specific)

                           Sizes are
                           defined in         KEY                  As needed
                           the header

                                            VALUE

                                        * Values must be in network byte order.



Thursday, April 23, 2009
Binary Protocol
                            MAGIC          Opcode              Key Length
                             (1 byte)       (1 byte)             (2 bytes)

                           Extra Length       Data Type           Reserved
                               (1 byte)           (1 byte)           (2 bytes)

                                           Total Body Length
                                                   (4 bytes)

                                                 Opaque
                                                   (4 bytes)

                                        CAS (Compare and Swap)
                                                   (8 bytes)




Thursday, April 23, 2009
Response Header
                            MAGIC          Opcode              Key Length
                             (1 byte)       (1 byte)             (2 bytes)

                           Extra Length       Data Type             Status
                               (1 byte)           (1 byte)           (2 bytes)

                                           Total Body Length
                                                   (4 bytes)

                                                 Opaque
                                                   (4 bytes)

                                        CAS (Compare and Swap)
                                                   (8 bytes)




Thursday, April 23, 2009
Tools



Thursday, April 23, 2009
Protocol

                     • Telnet’able (see doc/protocol.txt)‫‏‬
                     • Store commands are binary (no escaping)‫‏‬
                     • WireShark support for Binary Protocol


Thursday, April 23, 2009
Thursday, April 23, 2009
memcached-tool

                     • Example minimal monitoring tool
                     • Shows details of server stats, slabs
                     • memcached-tool 10.0.0.1 display
                     • memcached-tool 10.0.0.1 stats

Thursday, April 23, 2009
libmemcached Tools

                     • memcp
                     • memrm
                     • memstat
                     • memslap (hahahhaha)‫‏‬

Thursday, April 23, 2009
MRTG


                     • Plenty of interfaces monitored
                     • Old technology, been around forever


Thursday, April 23, 2009
Thursday, April 23, 2009
...and others

                     • Cacti
                      • http://dealnews.com/developers/cacti/
                           memcached.html
                     • Ganglia
                      • http://ganglia.wiki.sourceforge.net/

Thursday, April 23, 2009
Current Connections




Thursday, April 23, 2009
Requests Per Second




Thursday, April 23, 2009
DTrace

                     • User static DTrace probes to probe
                           application logic

                           • Hot keys
                           • hash efficiency
                           • lock contention

Thursday, April 23, 2009
Tuning



Thursday, April 23, 2009
Connections
                     • Don't fear setting -c (max conns) too high!
                     • Watch 'listen_disabled_num' (1.2.8+)
                     • Audit any firewalls on the system (can run
                           out of firewall states!)

                     • Watch for connection overload. Probably an
                           application bug


Thursday, April 23, 2009
Memory
                     • Don't set -m (max bytes) too high
                     • -m only controls memory for stored values
                     • Other memory is used for connection
                           handling, LRU tracking, the hash table, etc

                     • Especially if running under 32bit (-m 2048
                           bad!)

                     • Careful of -k. Could force server to swap
                     • Monitor server well! If you are swapping,
                           memcached will be slow
Thursday, April 23, 2009
Things to remember!
                     • Memcached is great for scaling, but abuse
                           will slow down your page rendering time

                     • Fetching 10,000 separate keys to build a
                           page will not be fast

                     • Use persistent connections if possible
                     • Don't fetch more than you need. Takes time
                           to serialize/deserialize 100k+ of data


Thursday, April 23, 2009
Shrink data!
                     • Especially if you use multiget, try to use
                           shorter keys

                     • “fooooooooooooooooooooooo-$MD5”
                           will take more data packets than “foo1”

                     • Try using smaller keys anyway, saves
                           memory if your data is small too


Thursday, April 23, 2009
Future Solutions!
                     • Evaluate the binary protocol in 1.3
                     • New tricks will be possible, such as
                           smashing many commands into fewer
                           packets

                     • 'noreply' commands. Don't wait for the
                           response if you don't have to

                     • ('noreply' is in 1.2, but not recommended
                           for use)

Thursday, April 23, 2009
1.2.8
                     • Bugfixes
                     • New stats
                      • listen_disabled_num
                      • cmd_flush (are you flushing your cache
                             and not realizing it? :) )

                           • evicted_time under 'stats items'
                     • Only bugfixes and minor features planned
                           for 1.2 series
Thursday, April 23, 2009
1.3.* Beta

                     • Scalability improvements
                     • New stats (per-slab get/miss/etc counters)
                     • Binary protocol
                     • Memory optimizations (disable CAS
                           support)



Thursday, April 23, 2009
ASCII Protocol vs Binary Protocol (memcached-1.3.1 Development Branch)
         task completion time (secs)




                                                                                      ASCII Protocol
                                                                                      Binary Protocol




                                                                 concurrent connections




                                       Binary Protocol
Thursday, April 23, 2009
Future
            • 1.4.0 stable
             • Multiple Engine Support
             • Durable
             • Highly Threaded
             • New Slab Features


Thursday, April 23, 2009
More Resources...
                     • http://danga.com/memcached/
                     • #memcached on Freenode
                     • http://tangent.org/552/libmemcached.html
                     • http://groups.google.com/groups/
                           memcached

                     • http://dev.mysql.com/doc/refman/5.1/en/ha-
                           memcached.html

Thursday, April 23, 2009

More Related Content

What's hot

LCA14: LCA14-306: CPUidle & CPUfreq integration with scheduler
LCA14: LCA14-306: CPUidle & CPUfreq integration with schedulerLCA14: LCA14-306: CPUidle & CPUfreq integration with scheduler
LCA14: LCA14-306: CPUidle & CPUfreq integration with scheduler
Linaro
 
Linux Memory Management
Linux Memory ManagementLinux Memory Management
Linux Memory Management
Ni Zo-Ma
 
Java Performance Analysis on Linux with Flame Graphs
Java Performance Analysis on Linux with Flame GraphsJava Performance Analysis on Linux with Flame Graphs
Java Performance Analysis on Linux with Flame Graphs
Brendan Gregg
 
MySQL SQL Tutorial
MySQL SQL TutorialMySQL SQL Tutorial
MySQL SQL Tutorial
Chien Chung Shen
 
Apache Kafka
Apache KafkaApache Kafka
Apache Kafka
Diego Pacheco
 
HBaseCon 2015: HBase Performance Tuning @ Salesforce
HBaseCon 2015: HBase Performance Tuning @ SalesforceHBaseCon 2015: HBase Performance Tuning @ Salesforce
HBaseCon 2015: HBase Performance Tuning @ Salesforce
HBaseCon
 
Oracle ACFS High Availability NFS Services (HANFS) Part-I
Oracle ACFS High Availability NFS Services (HANFS) Part-IOracle ACFS High Availability NFS Services (HANFS) Part-I
Oracle ACFS High Availability NFS Services (HANFS) Part-I
Anju Garg
 
Caching
CachingCaching
Caching
Nascenia IT
 
Apache ZooKeeper
Apache ZooKeeperApache ZooKeeper
Apache ZooKeeper
Scott Leberknight
 
Building a Dynamic Rules Engine with Kafka Streams
Building a Dynamic Rules Engine with Kafka StreamsBuilding a Dynamic Rules Engine with Kafka Streams
Building a Dynamic Rules Engine with Kafka Streams
HostedbyConfluent
 
Fluentd Overview, Now and Then
Fluentd Overview, Now and ThenFluentd Overview, Now and Then
Fluentd Overview, Now and Then
SATOSHI TAGOMORI
 
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013Introduction and Overview of Apache Kafka, TriHUG July 23, 2013
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013
mumrah
 
[2019] 200만 동접 게임을 위한 MySQL 샤딩
[2019] 200만 동접 게임을 위한 MySQL 샤딩[2019] 200만 동접 게임을 위한 MySQL 샤딩
[2019] 200만 동접 게임을 위한 MySQL 샤딩
NHN FORWARD
 
Cgroups in android
Cgroups in androidCgroups in android
Cgroups in android
ramalinga prasad tadepalli
 
HBase and HDFS: Understanding FileSystem Usage in HBase
HBase and HDFS: Understanding FileSystem Usage in HBaseHBase and HDFS: Understanding FileSystem Usage in HBase
HBase and HDFS: Understanding FileSystem Usage in HBase
enissoz
 
Stop the Guessing: Performance Methodologies for Production Systems
Stop the Guessing: Performance Methodologies for Production SystemsStop the Guessing: Performance Methodologies for Production Systems
Stop the Guessing: Performance Methodologies for Production Systems
Brendan Gregg
 
Apache kafka 모니터링을 위한 Metrics 이해 및 최적화 방안
Apache kafka 모니터링을 위한 Metrics 이해 및 최적화 방안Apache kafka 모니터링을 위한 Metrics 이해 및 최적화 방안
Apache kafka 모니터링을 위한 Metrics 이해 및 최적화 방안
SANG WON PARK
 
Android Storage - Vold
Android Storage - VoldAndroid Storage - Vold
Android Storage - Vold
William Lee
 
Open Device Programmability: Hands-on Intro to RESTCONF (and a bit of NETCONF)
Open Device Programmability: Hands-on Intro to RESTCONF (and a bit of NETCONF)Open Device Programmability: Hands-on Intro to RESTCONF (and a bit of NETCONF)
Open Device Programmability: Hands-on Intro to RESTCONF (and a bit of NETCONF)
Cisco DevNet
 
Apache kafka performance(throughput) - without data loss and guaranteeing dat...
Apache kafka performance(throughput) - without data loss and guaranteeing dat...Apache kafka performance(throughput) - without data loss and guaranteeing dat...
Apache kafka performance(throughput) - without data loss and guaranteeing dat...
SANG WON PARK
 

What's hot (20)

LCA14: LCA14-306: CPUidle & CPUfreq integration with scheduler
LCA14: LCA14-306: CPUidle & CPUfreq integration with schedulerLCA14: LCA14-306: CPUidle & CPUfreq integration with scheduler
LCA14: LCA14-306: CPUidle & CPUfreq integration with scheduler
 
Linux Memory Management
Linux Memory ManagementLinux Memory Management
Linux Memory Management
 
Java Performance Analysis on Linux with Flame Graphs
Java Performance Analysis on Linux with Flame GraphsJava Performance Analysis on Linux with Flame Graphs
Java Performance Analysis on Linux with Flame Graphs
 
MySQL SQL Tutorial
MySQL SQL TutorialMySQL SQL Tutorial
MySQL SQL Tutorial
 
Apache Kafka
Apache KafkaApache Kafka
Apache Kafka
 
HBaseCon 2015: HBase Performance Tuning @ Salesforce
HBaseCon 2015: HBase Performance Tuning @ SalesforceHBaseCon 2015: HBase Performance Tuning @ Salesforce
HBaseCon 2015: HBase Performance Tuning @ Salesforce
 
Oracle ACFS High Availability NFS Services (HANFS) Part-I
Oracle ACFS High Availability NFS Services (HANFS) Part-IOracle ACFS High Availability NFS Services (HANFS) Part-I
Oracle ACFS High Availability NFS Services (HANFS) Part-I
 
Caching
CachingCaching
Caching
 
Apache ZooKeeper
Apache ZooKeeperApache ZooKeeper
Apache ZooKeeper
 
Building a Dynamic Rules Engine with Kafka Streams
Building a Dynamic Rules Engine with Kafka StreamsBuilding a Dynamic Rules Engine with Kafka Streams
Building a Dynamic Rules Engine with Kafka Streams
 
Fluentd Overview, Now and Then
Fluentd Overview, Now and ThenFluentd Overview, Now and Then
Fluentd Overview, Now and Then
 
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013Introduction and Overview of Apache Kafka, TriHUG July 23, 2013
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013
 
[2019] 200만 동접 게임을 위한 MySQL 샤딩
[2019] 200만 동접 게임을 위한 MySQL 샤딩[2019] 200만 동접 게임을 위한 MySQL 샤딩
[2019] 200만 동접 게임을 위한 MySQL 샤딩
 
Cgroups in android
Cgroups in androidCgroups in android
Cgroups in android
 
HBase and HDFS: Understanding FileSystem Usage in HBase
HBase and HDFS: Understanding FileSystem Usage in HBaseHBase and HDFS: Understanding FileSystem Usage in HBase
HBase and HDFS: Understanding FileSystem Usage in HBase
 
Stop the Guessing: Performance Methodologies for Production Systems
Stop the Guessing: Performance Methodologies for Production SystemsStop the Guessing: Performance Methodologies for Production Systems
Stop the Guessing: Performance Methodologies for Production Systems
 
Apache kafka 모니터링을 위한 Metrics 이해 및 최적화 방안
Apache kafka 모니터링을 위한 Metrics 이해 및 최적화 방안Apache kafka 모니터링을 위한 Metrics 이해 및 최적화 방안
Apache kafka 모니터링을 위한 Metrics 이해 및 최적화 방안
 
Android Storage - Vold
Android Storage - VoldAndroid Storage - Vold
Android Storage - Vold
 
Open Device Programmability: Hands-on Intro to RESTCONF (and a bit of NETCONF)
Open Device Programmability: Hands-on Intro to RESTCONF (and a bit of NETCONF)Open Device Programmability: Hands-on Intro to RESTCONF (and a bit of NETCONF)
Open Device Programmability: Hands-on Intro to RESTCONF (and a bit of NETCONF)
 
Apache kafka performance(throughput) - without data loss and guaranteeing dat...
Apache kafka performance(throughput) - without data loss and guaranteeing dat...Apache kafka performance(throughput) - without data loss and guaranteeing dat...
Apache kafka performance(throughput) - without data loss and guaranteeing dat...
 

Similar to Memcached

All The Little Pieces
All The Little PiecesAll The Little Pieces
All The Little Pieces
Ezequiel Calderara
 
Varnish Oscon 2009
Varnish Oscon 2009Varnish Oscon 2009
Varnish Oscon 2009
Artur Bergman
 
MySQL Sandbox 3
MySQL Sandbox 3MySQL Sandbox 3
MySQL Sandbox 3
Giuseppe Maxia
 
Charla ruby nscodermad
Charla ruby nscodermadCharla ruby nscodermad
Charla ruby nscodermad
nscoder_mad
 
Yet Another Replication Tool: RubyRep
Yet Another Replication Tool: RubyRepYet Another Replication Tool: RubyRep
Yet Another Replication Tool: RubyRep
Denish Patel
 
Caching, Memcached And Rails
Caching, Memcached And RailsCaching, Memcached And Rails
Caching, Memcached And Rails
guestac752c
 
Barcelona apc mem2010
Barcelona apc mem2010Barcelona apc mem2010
Barcelona apc mem2010
isnull
 
JRubyConf 2009
JRubyConf 2009JRubyConf 2009
JRubyConf 2009
John Woodell
 
Memcached: What is it and what does it do? (PHP Version)
Memcached: What is it and what does it do? (PHP Version)Memcached: What is it and what does it do? (PHP Version)
Memcached: What is it and what does it do? (PHP Version)
Brian Moon
 
Cloud, Cache, and Configs
Cloud, Cache, and ConfigsCloud, Cache, and Configs
Cloud, Cache, and Configs
Scott Taylor
 
APC & Memcache the High Performance Duo
APC & Memcache the High Performance DuoAPC & Memcache the High Performance Duo
APC & Memcache the High Performance Duo
Anis Berejeb
 
Script it
Script itScript it
Script it
Giuseppe Maxia
 
Apc Memcached Confoo 2011
Apc Memcached Confoo 2011Apc Memcached Confoo 2011
Apc Memcached Confoo 2011
Bachkoutou Toutou
 
RubyConf 2009
RubyConf 2009RubyConf 2009
RubyConf 2009
John Woodell
 
Testing con spock
Testing con spockTesting con spock
Testing con spock
Fátima Casaú Pérez
 
Openstack Magnum: Container-as-a-Service
Openstack Magnum: Container-as-a-ServiceOpenstack Magnum: Container-as-a-Service
Openstack Magnum: Container-as-a-Service
Chhavi Agarwal
 
GemStone/S Update
GemStone/S UpdateGemStone/S Update
GemStone/S Update
ESUG
 
Cook Up a Runtime with The New OSGi Resolver - Neil Bartlett
Cook Up a Runtime with The New OSGi Resolver - Neil BartlettCook Up a Runtime with The New OSGi Resolver - Neil Bartlett
Cook Up a Runtime with The New OSGi Resolver - Neil Bartlett
mfrancis
 
Blocks & GCD
Blocks & GCDBlocks & GCD
Blocks & GCD
rsebbe
 
OpenCms Days 2013 - OpenCms Cloud eXtensions
OpenCms Days 2013 - OpenCms Cloud eXtensionsOpenCms Days 2013 - OpenCms Cloud eXtensions
OpenCms Days 2013 - OpenCms Cloud eXtensions
Alkacon Software GmbH & Co. KG
 

Similar to Memcached (20)

All The Little Pieces
All The Little PiecesAll The Little Pieces
All The Little Pieces
 
Varnish Oscon 2009
Varnish Oscon 2009Varnish Oscon 2009
Varnish Oscon 2009
 
MySQL Sandbox 3
MySQL Sandbox 3MySQL Sandbox 3
MySQL Sandbox 3
 
Charla ruby nscodermad
Charla ruby nscodermadCharla ruby nscodermad
Charla ruby nscodermad
 
Yet Another Replication Tool: RubyRep
Yet Another Replication Tool: RubyRepYet Another Replication Tool: RubyRep
Yet Another Replication Tool: RubyRep
 
Caching, Memcached And Rails
Caching, Memcached And RailsCaching, Memcached And Rails
Caching, Memcached And Rails
 
Barcelona apc mem2010
Barcelona apc mem2010Barcelona apc mem2010
Barcelona apc mem2010
 
JRubyConf 2009
JRubyConf 2009JRubyConf 2009
JRubyConf 2009
 
Memcached: What is it and what does it do? (PHP Version)
Memcached: What is it and what does it do? (PHP Version)Memcached: What is it and what does it do? (PHP Version)
Memcached: What is it and what does it do? (PHP Version)
 
Cloud, Cache, and Configs
Cloud, Cache, and ConfigsCloud, Cache, and Configs
Cloud, Cache, and Configs
 
APC & Memcache the High Performance Duo
APC & Memcache the High Performance DuoAPC & Memcache the High Performance Duo
APC & Memcache the High Performance Duo
 
Script it
Script itScript it
Script it
 
Apc Memcached Confoo 2011
Apc Memcached Confoo 2011Apc Memcached Confoo 2011
Apc Memcached Confoo 2011
 
RubyConf 2009
RubyConf 2009RubyConf 2009
RubyConf 2009
 
Testing con spock
Testing con spockTesting con spock
Testing con spock
 
Openstack Magnum: Container-as-a-Service
Openstack Magnum: Container-as-a-ServiceOpenstack Magnum: Container-as-a-Service
Openstack Magnum: Container-as-a-Service
 
GemStone/S Update
GemStone/S UpdateGemStone/S Update
GemStone/S Update
 
Cook Up a Runtime with The New OSGi Resolver - Neil Bartlett
Cook Up a Runtime with The New OSGi Resolver - Neil BartlettCook Up a Runtime with The New OSGi Resolver - Neil Bartlett
Cook Up a Runtime with The New OSGi Resolver - Neil Bartlett
 
Blocks & GCD
Blocks & GCDBlocks & GCD
Blocks & GCD
 
OpenCms Days 2013 - OpenCms Cloud eXtensions
OpenCms Days 2013 - OpenCms Cloud eXtensionsOpenCms Days 2013 - OpenCms Cloud eXtensions
OpenCms Days 2013 - OpenCms Cloud eXtensions
 

More from elliando dias

Clojurescript slides
Clojurescript slidesClojurescript slides
Clojurescript slides
elliando dias
 
Why you should be excited about ClojureScript
Why you should be excited about ClojureScriptWhy you should be excited about ClojureScript
Why you should be excited about ClojureScript
elliando dias
 
Functional Programming with Immutable Data Structures
Functional Programming with Immutable Data StructuresFunctional Programming with Immutable Data Structures
Functional Programming with Immutable Data Structures
elliando dias
 
Nomenclatura e peças de container
Nomenclatura  e peças de containerNomenclatura  e peças de container
Nomenclatura e peças de container
elliando dias
 
Geometria Projetiva
Geometria ProjetivaGeometria Projetiva
Geometria Projetiva
elliando dias
 
Polyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better AgilityPolyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better Agility
elliando dias
 
Javascript Libraries
Javascript LibrariesJavascript Libraries
Javascript Libraries
elliando dias
 
How to Make an Eight Bit Computer and Save the World!
How to Make an Eight Bit Computer and Save the World!How to Make an Eight Bit Computer and Save the World!
How to Make an Eight Bit Computer and Save the World!
elliando dias
 
Ragel talk
Ragel talkRagel talk
Ragel talk
elliando dias
 
A Practical Guide to Connecting Hardware to the Web
A Practical Guide to Connecting Hardware to the WebA Practical Guide to Connecting Hardware to the Web
A Practical Guide to Connecting Hardware to the Web
elliando dias
 
Introdução ao Arduino
Introdução ao ArduinoIntrodução ao Arduino
Introdução ao Arduino
elliando dias
 
Minicurso arduino
Minicurso arduinoMinicurso arduino
Minicurso arduino
elliando dias
 
Incanter Data Sorcery
Incanter Data SorceryIncanter Data Sorcery
Incanter Data Sorcery
elliando dias
 
Rango
RangoRango
Fab.in.a.box - Fab Academy: Machine Design
Fab.in.a.box - Fab Academy: Machine DesignFab.in.a.box - Fab Academy: Machine Design
Fab.in.a.box - Fab Academy: Machine Design
elliando dias
 
The Digital Revolution: Machines that makes
The Digital Revolution: Machines that makesThe Digital Revolution: Machines that makes
The Digital Revolution: Machines that makes
elliando dias
 
Hadoop + Clojure
Hadoop + ClojureHadoop + Clojure
Hadoop + Clojure
elliando dias
 
Hadoop - Simple. Scalable.
Hadoop - Simple. Scalable.Hadoop - Simple. Scalable.
Hadoop - Simple. Scalable.
elliando dias
 
Hadoop and Hive Development at Facebook
Hadoop and Hive Development at FacebookHadoop and Hive Development at Facebook
Hadoop and Hive Development at Facebook
elliando dias
 
Multi-core Parallelization in Clojure - a Case Study
Multi-core Parallelization in Clojure - a Case StudyMulti-core Parallelization in Clojure - a Case Study
Multi-core Parallelization in Clojure - a Case Study
elliando dias
 

More from elliando dias (20)

Clojurescript slides
Clojurescript slidesClojurescript slides
Clojurescript slides
 
Why you should be excited about ClojureScript
Why you should be excited about ClojureScriptWhy you should be excited about ClojureScript
Why you should be excited about ClojureScript
 
Functional Programming with Immutable Data Structures
Functional Programming with Immutable Data StructuresFunctional Programming with Immutable Data Structures
Functional Programming with Immutable Data Structures
 
Nomenclatura e peças de container
Nomenclatura  e peças de containerNomenclatura  e peças de container
Nomenclatura e peças de container
 
Geometria Projetiva
Geometria ProjetivaGeometria Projetiva
Geometria Projetiva
 
Polyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better AgilityPolyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better Agility
 
Javascript Libraries
Javascript LibrariesJavascript Libraries
Javascript Libraries
 
How to Make an Eight Bit Computer and Save the World!
How to Make an Eight Bit Computer and Save the World!How to Make an Eight Bit Computer and Save the World!
How to Make an Eight Bit Computer and Save the World!
 
Ragel talk
Ragel talkRagel talk
Ragel talk
 
A Practical Guide to Connecting Hardware to the Web
A Practical Guide to Connecting Hardware to the WebA Practical Guide to Connecting Hardware to the Web
A Practical Guide to Connecting Hardware to the Web
 
Introdução ao Arduino
Introdução ao ArduinoIntrodução ao Arduino
Introdução ao Arduino
 
Minicurso arduino
Minicurso arduinoMinicurso arduino
Minicurso arduino
 
Incanter Data Sorcery
Incanter Data SorceryIncanter Data Sorcery
Incanter Data Sorcery
 
Rango
RangoRango
Rango
 
Fab.in.a.box - Fab Academy: Machine Design
Fab.in.a.box - Fab Academy: Machine DesignFab.in.a.box - Fab Academy: Machine Design
Fab.in.a.box - Fab Academy: Machine Design
 
The Digital Revolution: Machines that makes
The Digital Revolution: Machines that makesThe Digital Revolution: Machines that makes
The Digital Revolution: Machines that makes
 
Hadoop + Clojure
Hadoop + ClojureHadoop + Clojure
Hadoop + Clojure
 
Hadoop - Simple. Scalable.
Hadoop - Simple. Scalable.Hadoop - Simple. Scalable.
Hadoop - Simple. Scalable.
 
Hadoop and Hive Development at Facebook
Hadoop and Hive Development at FacebookHadoop and Hive Development at Facebook
Hadoop and Hive Development at Facebook
 
Multi-core Parallelization in Clojure - a Case Study
Multi-core Parallelization in Clojure - a Case StudyMulti-core Parallelization in Clojure - a Case Study
Multi-core Parallelization in Clojure - a Case Study
 

Recently uploaded

Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
James Anderson
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Vladimir Iglovikov, Ph.D.
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 

Recently uploaded (20)

Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 

Memcached

  • 1. Memcached http://download.tangent.org/talks/Memcached%20Study.pdf Thursday, April 23, 2009
  • 2. memcached is a high-performance, distributed memory object caching system, generic in nature, but intended for use in speeding up dynamic web applications by alleviating database load. Thursday, April 23, 2009
  • 3. Who? • Facebook • Yahoo • Amazon • LiveJournal • Mixi • ... Thursday, April 23, 2009
  • 4. Why? (aka why would I...)‫‏‬ Thursday, April 23, 2009
  • 6. LiveJournal • Origin of memcached • 30G of cache. Terabytes of data • Writes to DB based on reads from the DB, not cache Thursday, April 23, 2009
  • 7. Mixi • Memcached on dedicated servers • 300 servers in production (reuse old MySQL Servers) • 4/8 gigs of Memory • 15,000 qps / 400Mbps throughput Thursday, April 23, 2009
  • 9. Patrick Lenz Eins.de http://poocs.net Thursday, April 23, 2009
  • 11. 100+ Nodes 2gigs a Node Processing Incoming Data Memcached Thursday, April 23, 2009
  • 13. Server • Slab Allocator • Libevent based • Simple Protocol (no xml) • Server has Internal Hash Table • Servers know nothing about each other Thursday, April 23, 2009
  • 14. Clients • Client hashes Key to Server List (distribution)‫‏‬ • Serializes the Object (server just likes byte arrays)‫‏‬ • Compresses data Thursday, April 23, 2009
  • 16. So what should I ask? • How do I dump data? • How is it redundant? * • How does it handle failover?* • How does it authenticate? Thursday, April 23, 2009
  • 17. Details on the Server? • set/get/replace/add • append/prepend • increment/decrement • cas (compare and swap atomic!)‫‏‬ • stats (detail)‫‏‬ Thursday, April 23, 2009
  • 18. Platforms • FreeBSD and Linux are top tier • Windows exists • Solaris (as of 1.2.5)‫‏‬ • OSX Good Support Thursday, April 23, 2009
  • 21.  # Set up client object  require 'memcache'  servers = ['127.0.0.1:43042', '127.0.0.1:43043']  CACHE = MemCache.new(servers, :namespace => 'my_app') Thursday, April 23, 2009
  • 22. # Get; fall through to Rails' MySQL load if missing  key = "recent_posts"  # Try to get; returns nil on failure  posts = CACHE.get(key)  unless posts    # Load from DB    posts = Post.find(:all, :limit => 10, :order => 'id DESC')    # Cache the new value, which is automatically serialized    CACHE.set(key), posts, 60  end Thursday, April 23, 2009
  • 23. # Ghetto locking implementation for memcache-client  # from http://fauna.rubyforge.org/svn/interlock/trunk/lib/interlock/lock.rb  def lock(key, lock_expiry = 30, retries = 5)    retries.times do |count|      # Try to acquire the lock      response = CACHE.add("lock:#{key}", "Locked by #{Process.pid}", lock_expiry)      if response == "STOREDrn"        # We got it        begin          # Yield the current value to the closure          value = yield(CACHE.get(key))          # Set the new value returned from the closure CACHE.set(key, value)          # We're done ('ensure' block will still run)          return value        ensure          # Release the lock          CACHE.delete("lock:#{key}")        end      else        # Exponentially back off requests if the lock can't be acquired        sleep((2**count) / 2.0)      end    end    # We waited and waited but our turn never came    raise MemCacheError, "Couldn't acquire lock for #{key}"  end Thursday, April 23, 2009
  • 25. /** * Initalize Memcache object and add local server 127.0.0.1 using port 11211 */ $cache = new Memcache; $cache->addServer("127.0.0.1",11211); Thursday, April 23, 2009
  • 26. /** Look in cache, if not found, set object (misses null) **/ if (!$user = $cache->get($user_key)) { /** * Set object with expire of 1 hour and no compression */ $cache->set($user_key,$value,NULL, $expire); $user = $value; } Thursday, April 23, 2009
  • 27. /* Get user counter value (does not handle add fail) */ if (!$counter = $cache->get($counter_key)) { /* No counter, set to 1 */ $cache->add($counter_key,1); } else { /* Increment by 1 */ $cache->increment($counter_key); } Thursday, April 23, 2009
  • 28. /* Print out stats from memcached server */ print_r($cache->getStats()); /* Print out extended stats from memcached server */ print_r($cache->getExtendedStats()); /* Flush memcached (bad idea in production)*/ var_dump($cache->flush()); Thursday, April 23, 2009
  • 30. libmemcached • C/C++ (many language wrappers) • Multiget support • Async/Sync Modes (including buffered) • Supports Binary Protocol (TCP/UDP) • Read Through Cache Support Thursday, April 23, 2009
  • 31. memcached_st *memc; memcached_return rc; memc= memcached_create(NULL); ...do stuff... memcached_free(memc); Thursday, April 23, 2009
  • 32. memcached_server_st *servers; memcached_st *memc= memcached_create(NULL); char servername[]= "0.example.com"; servers= memcached_server_list_append(NULL, servername, 400, &rc); for (x= 0; x < 20; x++) { char buffer[SMALL_STRING_LEN]; snprintf(buffer, SMALL_STRING_LEN, "%u.example.com", 400+x); servers= memcached_server_list_append(servers, buffer, 401, &rc); } rc= memcached_server_push(memc, servers); memcached_server_free(servers); memcached_free(memc); Thursday, April 23, 2009
  • 33. char *key= "foo"; char *value; size_t value_length= 8191; unsigned int x; value = (char*)malloc(value_length); for (x= 0; x < value_length; x++) value[x] = (char) (x % 127); for (x= 0; x < 1; x++) { rc= memcached_set(memc, key, strlen(key), value, value_length, (time_t)0, (uint32_t)0); assert(rc == MEMCACHED_SUCCESS); } free(value); Thursday, April 23, 2009
  • 34. memcached_return rc; char *keys[]= {"fudge", "son", "food"}; size_t key_length[]= {5, 3, 4}; uint32_t flags; char return_key[MEMCACHED_MAX_KEY]; size_t return_key_length; char *return_value; size_t return_value_length; rc= memcached_mget(memc, keys, key_length, 3); while ((return_value= memcached_fetch(memc, return_key, &return_key_length, &return_value_length, &flags, &rc))) { free(return_value); } Thursday, April 23, 2009
  • 35. Memcached foo; char *value_set= "Data for server A"; char *master_key_a= "server-a"; char *master_key_b= "server-b"; char *key= "xyz"; char *value; size_t value_length; foo.set_by_key(master_key_a, key, value_set, strlen(value_set)); value= foo.get_by_key(master_key_a, key, &value_length); assert((memcmp(value, value_set, value_length) == 0)); value= foo.get_by_key(master_key_b, key, &value_length); assert((memcmp(value, value_set, value_length) == 0)); return 0; Thursday, April 23, 2009
  • 37. lighttpd/mod_memcache • Cache files from disk • Specify mime/types • Create Expire Times Thursday, April 23, 2009
  • 38. Apache (mod_memcached)‫‏‬ • CAS operations exposed • GET/PUT/DELETE operations • Still Alpha • (pandoraport.com!) Thursday, April 23, 2009
  • 39. NGINX • Support variable Time outs • Based on Perl • http://wiki.codemongers.com/ NginxHttpMemcachedModule • http://www.igvita.com/2008/02/11/nginx- and-memcached-a-400-boost/ Thursday, April 23, 2009
  • 40. Memcached Functions for MySQL (and Drizzle) Thursday, April 23, 2009
  • 41. Overview... • Uses UDF API and libmemcached • Manage memcached Cluster via SQL • Read through Cache • Write through Cache Thursday, April 23, 2009
  • 43. Installation • CREATE FUNCTION memc_servers_add RETURNS INT SONAME "libmemcached_functions_mysql.so"; • CREATE FUNCTION memc_set RETURNS INT SONAME "libmemcached_functions_mysql.so"; • CREATE FUNCTION memc_get RETURNS STRING SONAME "libmemcached_functions_mysql.so"; Thursday, April 23, 2009
  • 44. Functions Available • memc_servers_set(); • memc_servers_behavior_set() • memc_set() • memc_get() • memc_append() • memc_prepend() Thursday, April 23, 2009
  • 45. Setting via SELECT select id, url, memc_set(concat('feeds', md5(url)), url) from feeds; select memc_get(concat('feeds', md5(url))) from feeds; +-------------------------------------------------------+ | memc_get(concat('feeds', md5(url))) | +-------------------------------------------------------+ | http://feeds.feedburner.com/littlegreenfootballs/Ilds | | http://del.icio.us/rss/jacomien | | http://del.icio.us/rss/tags/rmj20 | | http://www.jihadwatch.org/index.rdf | | http://www.connotea.org/rss/user/rmj20 | | http://devblog.grazr.com/?feed=rss2x | | http://feeds.feedburner.com/littlegreenfootballs/kyeH | +-------------------------------------------------------+ Thursday, April 23, 2009
  • 46. Trigger DROP TRIGGER IF EXISTS feed_insert; CREATE TRIGGER feed_insert BEFORE INSERT ON feeds FOR EACH ROW BEGIN SET @mm= memc_set(concat('feeds:',md5(NEW.url)), NEW.url);END | insert into feeds (url) values ('http://grazr.com/feedlist.xml'); select memc_get(concat('feeds:', md5('http://grazr.com/feedlist.xml'))); +------------------------------------------------------------------+| memc_get(concat('feeds:', md5('http://grazr.com/feedlist.xml'))) | +------------------------------------------------------------------+| http://grazr.com/feedlist.xml | +------------------------------------------------------------------+ Thursday, April 23, 2009
  • 47. Memcached Replication via MySQL INSERT INTO table_a VALUES (“key”, “value”, “values”); INSERT INTO blackhole_table VALUES (memc_delete(“key”)); Thursday, April 23, 2009
  • 49. Limits • Key Size (250 bytes) (1.2 <)‫‏‬ • Data Size (under 1 megabyte)‫‏‬ • 32bit/64bit (maximum size of the process)‫‏‬ • Maxbytes (limits item cache, not everything!)‫‏‬ Thursday, April 23, 2009
  • 50. LRU • Least recently accessed items are up for eviction • One LRU exists per “slab class” • LRU evictions don't need to be common • Can be common if you set expiration to 0 • Monitor evictions via 'stats items' command Thursday, April 23, 2009
  • 51. Threads • No single-threading in versions past 1.2 • Great for large instances (16G+) • Also great for large multiget requests • Improvements in 1.3+ • Don't set too many threads • One per CPU • No more than 8 total for 1.2 Thursday, April 23, 2009
  • 52. Slab Allocator • Memory permanently allocated from OS • Classes created by chunk size • Cannot (presently) reassign slab pages • Carefully use 'stats sizes' to test efficiency Thursday, April 23, 2009
  • 53. Binary Protocol 24 HEADER Required bytes EXTRA FIELD (Command Specific) Sizes are defined in KEY As needed the header VALUE * Values must be in network byte order. Thursday, April 23, 2009
  • 54. Binary Protocol MAGIC Opcode Key Length (1 byte) (1 byte) (2 bytes) Extra Length Data Type Reserved (1 byte) (1 byte) (2 bytes) Total Body Length (4 bytes) Opaque (4 bytes) CAS (Compare and Swap) (8 bytes) Thursday, April 23, 2009
  • 55. Response Header MAGIC Opcode Key Length (1 byte) (1 byte) (2 bytes) Extra Length Data Type Status (1 byte) (1 byte) (2 bytes) Total Body Length (4 bytes) Opaque (4 bytes) CAS (Compare and Swap) (8 bytes) Thursday, April 23, 2009
  • 57. Protocol • Telnet’able (see doc/protocol.txt)‫‏‬ • Store commands are binary (no escaping)‫‏‬ • WireShark support for Binary Protocol Thursday, April 23, 2009
  • 59. memcached-tool • Example minimal monitoring tool • Shows details of server stats, slabs • memcached-tool 10.0.0.1 display • memcached-tool 10.0.0.1 stats Thursday, April 23, 2009
  • 60. libmemcached Tools • memcp • memrm • memstat • memslap (hahahhaha)‫‏‬ Thursday, April 23, 2009
  • 61. MRTG • Plenty of interfaces monitored • Old technology, been around forever Thursday, April 23, 2009
  • 63. ...and others • Cacti • http://dealnews.com/developers/cacti/ memcached.html • Ganglia • http://ganglia.wiki.sourceforge.net/ Thursday, April 23, 2009
  • 66. DTrace • User static DTrace probes to probe application logic • Hot keys • hash efficiency • lock contention Thursday, April 23, 2009
  • 68. Connections • Don't fear setting -c (max conns) too high! • Watch 'listen_disabled_num' (1.2.8+) • Audit any firewalls on the system (can run out of firewall states!) • Watch for connection overload. Probably an application bug Thursday, April 23, 2009
  • 69. Memory • Don't set -m (max bytes) too high • -m only controls memory for stored values • Other memory is used for connection handling, LRU tracking, the hash table, etc • Especially if running under 32bit (-m 2048 bad!) • Careful of -k. Could force server to swap • Monitor server well! If you are swapping, memcached will be slow Thursday, April 23, 2009
  • 70. Things to remember! • Memcached is great for scaling, but abuse will slow down your page rendering time • Fetching 10,000 separate keys to build a page will not be fast • Use persistent connections if possible • Don't fetch more than you need. Takes time to serialize/deserialize 100k+ of data Thursday, April 23, 2009
  • 71. Shrink data! • Especially if you use multiget, try to use shorter keys • “fooooooooooooooooooooooo-$MD5” will take more data packets than “foo1” • Try using smaller keys anyway, saves memory if your data is small too Thursday, April 23, 2009
  • 72. Future Solutions! • Evaluate the binary protocol in 1.3 • New tricks will be possible, such as smashing many commands into fewer packets • 'noreply' commands. Don't wait for the response if you don't have to • ('noreply' is in 1.2, but not recommended for use) Thursday, April 23, 2009
  • 73. 1.2.8 • Bugfixes • New stats • listen_disabled_num • cmd_flush (are you flushing your cache and not realizing it? :) ) • evicted_time under 'stats items' • Only bugfixes and minor features planned for 1.2 series Thursday, April 23, 2009
  • 74. 1.3.* Beta • Scalability improvements • New stats (per-slab get/miss/etc counters) • Binary protocol • Memory optimizations (disable CAS support) Thursday, April 23, 2009
  • 75. ASCII Protocol vs Binary Protocol (memcached-1.3.1 Development Branch) task completion time (secs) ASCII Protocol Binary Protocol concurrent connections Binary Protocol Thursday, April 23, 2009
  • 76. Future • 1.4.0 stable • Multiple Engine Support • Durable • Highly Threaded • New Slab Features Thursday, April 23, 2009
  • 77. More Resources... • http://danga.com/memcached/ • #memcached on Freenode • http://tangent.org/552/libmemcached.html • http://groups.google.com/groups/ memcached • http://dev.mysql.com/doc/refman/5.1/en/ha- memcached.html Thursday, April 23, 2009