Saturday, 26 January 2013

Memcached is an in-memory key-value store for small chunks of arbitrary data (strings, objects) from results of database calls, API calls, or page rendering.

Memcached is a general-purpose distributed memory caching system that was originally developed by Danga Interactive for LiveJournal, but is now used by many other sites. It is often used to speed up dynamic database-driven websites by caching data and objects in RAM to reduce the number of times an external data source (such as a database or API) must be read. Memcached runs on Unix, Linux, Windows and Mac OS X and is distributed under a permissive free software license.

Memcached's APIs provide a giant hash table distributed across multiple machines. When the table is full, subsequent inserts cause older data to be purged in least recently used (LRU) order.







Who uses Memcache?

  • YouTube
  • Reddit
  • Zynga
  • Facebook
  • Orange
  • Twitter
  • Wikipedia
  • Heroku offers a managed memcached service built on Couchbase Server as part of their platform as a service.
  • Google App Engine, AppScale, Windows Azure and Amazon Web Services also offer a memcached service through an API

Used For?





1) Reduces database load.
2) Perfect for websites with high database load.
3) Significantly reduces the number of retrieval requests to database
4) Cuts down the I/O access (hard disk)


1) Not a persistent data store.
2) Not a database.
3) Not application specific
4) Cannot cache large object

Configuring Memcached (For Ubuntu)

Step 1) Install Libevent
Memcached uses the Libevent library for network IO.
$ cd libevent-1.4.11-stable$ autoconf
./configure --prefix=/usr/local
sudo make install
Step 2) Install Memcached
Download the latest version of Memcached from who developed
Memcached originally for Livejournal.
$ cd memcached-1.4.0$ autoconf$ ./configure --prefix=/usr/local$ make$ sudo make install
Step 3) Run memcached
Start memcached as a daemon with 512MB of memory on port 11211(default).
Then you can telnet to the server and port and use any of the available commands.
$ memcached -d -m 512 -p 11211
telnet localhost 11211Trying ::1...
Connected to localhost.
Escape character is '^]'.
get joe
set joe 0 3600 10  (Note: TTL 3600 and 10 bytes)California
get joe
VALUE joe 0 10
Step 4) Spy Memcached (Memcached Java Client)

public class Users implements Serializable{
       private int id;
private String name ;
    // Getter and Setter methods

public class MemcachedDemo {
public static void main(String[] args) {
Users users = new Users();
try {
MemcachedClient c=new MemcachedClient(new InetSocketAddress("", 1121));
               c.set("someKey_1", 2592000, users);
               Object myObject=c.get("someKey_1");
               System.out.println("Object 1: " + myObject);
               System.out.println("Statistics: " + c.getStats());
               System.out.println("Statistics of individual Items: " + c.getStats("items"));
               c=null ;
           } catch (IOException e) {


  1. Thanks for sharing this webpage.It is really good and useful.
    AWS Training | AWS Training in Chennai | AWS course in Chennai

  2. Awesome blog with informative content... thanks for sharing such a wonderful blog... Java Training in Chennai | Dot Net Training in Chennai

    1. I am technology Enthusiast. Your blog is really awesome, attractive and impressive. I like the way you think. it is very useful for Java SE & Java EE Learners. Your article adds best knowledge to our Java Online Training from India. or learn thru Java Online Training from India Students. or learn thru JavaScript Online Training from India. Appreciating the persistence you put into your blog and detailed information you provide. Kindly keep blogging.

  3. Amazing blog about the various informative information of the programming languages. PHP is one such programming language which is more easier to learn and has lot of scope in future which is provided in Php Training institute in Chennai

  4. I have read your blog its very Interesting. Thanks for sharing. ERP Providers in Chennai | ERP in Chennai. We provide best quality cost effective ERP software applications and end to end enterprise solutions to all the industry verticals with the affordable cost.

  5. Thank you for this valuable information. I have got some important suggestions from it. I'm working in Brave Technologies Private Limited. We provides lowest price of ERP Software for our clients. Contact us on
    Manufacturing ERP software Chennai | Automotive ERP in Chennai

  6. Really an amazing post..! By reading your blog post i gained more information.

    Bulk SMS Services in Chennai

  7. Very Nice Post…Thanks.Very interesting and Helpful Tips…..Thanks For Sharing.

    Executive MBA Distance Education


  8. This is excellent information. It is amazing and wonderful to visit your site.Thanks for sharng this information,this is useful to me...
    Android Training in Chennai
    Ios Training in Chennai


  9. Pretty article! I found some useful information in your blog, it was awesome to read, thanks for sharing this great content to my vision, keep sharing..
    Android App Development Company


  10. Nice it seems to be good post... It will get readers engagement on the article since readers engagement plays an vital role in every blog.i am expecting more updated posts from your hands.
    iOS App Development Company
    iOS App Development Company

  11. great and nice blog thanks sharing..I just want to say that all the information you have given here is awesome...Thank you very much for this one.
    web design Company
    web development Company
    web design Company in chennai
    web development Company in chennai
    web design Company in India
    web development Company in India

  12. You have provided an nice article, Thank you very much for this one. And i hope this will be useful for many people.. and i am waiting for your next post keep on updating these kinds of knowledgeable things...
    Fitness SMS
    Fitness Text
    Salon SMS
    Salon Text
    Investor Relation SMS
    Investor Relation Text

  13. it is really amazing...thanks for sharing....provide more useful information...
    Mobile app development company


  14. Being new to the blogging world I feel like there is still so much to learn. Your tips helped to clarify a few things for me as well

    iOS App Development Company
    Android App Development Company

  15. Excellent concept with understandable manner. Thanks for sharing such a nice blog. Software Testing Training Institute in Chennai | Selenium Training Institute in Chennai

  16. Thanks for taking the time to discuss this Database topic and I feel very happy about it. Keep Sharing.. Best Dot Net Training in Chennai | Best Java Training in Chennai | Best Web Design Training in Chennai

  17. Excellent information from your article..I really love reading and following your post as I find them extremely informative and interesting.
    Best B.E/B.Tech Project Center in Chennai | No.1 M.E/M.Tech Projects in Chennai | Best IT Project Center in Chennai

  18. Really it was an awesome article...very interesting to read..You have provided an nice article....Thanks for sharing..
    Android Training in Chennai
    Ios Training in Chennai

  19. Thanks For Your valuable posting, it was very informative
    Webdesign Lüdenscheid

  20. Thank you very much for your very informative post. In my opinion, I can offer you to read an article with a similar topic on how mobile applications can boost sales of your business in 2017 :

  21. this is really too useful and have more ideas from yours. keep sharing many techniques.
    Java Project Center in Chennai | Best Java Projects in Velachery

  22. Interesting post! This is really helpful for me. I like it! Thanks for sharing!
    microsoft office online

  23. These ways are very simple and very much useful, as a beginner level these helped me a lot thanks fore sharing these kinds of useful and knowledgeable information.
    Sms marketing
    Text message marketing
    Fitness SMS

  24. Thanks a lot for sharing this with all of us, I like it and we can communicate. Do you need buy app ratings and reviews. To boost app ranking and double app downloads now.

  25. Interesting post! This is really helpful for me. I like it! Thanks for sharing!
    WebDesign Lüdenscheid

  26. The website is looking bit flashy and it catches the visitors eyes. A design is pretty simple .
    online marketing lüdenscheid

  27. These ways are very simple and very much useful, as a beginner level these helped me a lot thanks fore sharing these kinds of useful and knowledgeable information.
    PSD to Wordpress
    wordpress website development

  28. I really enjoyed while reading your article, the information you have delivered in this post was damn good. Keep sharing your post with efficient news.
    MSC Project Center in Chennai | MSC Project Center in Velachery

  29. Informative blog and it was up to the point describing the information very effectively. Thanks to blog author for wonderful and informative post.
    Mobile application developers in Chennai | Android application developers in Chennai | Android app
    developers Chennai
    | PHP developers chennai

  30. Those guidelines additionally worked to become a good way to recognize that other people online have the identical fervor like mine to grasp great deal more around this condition.

    android training in bangalore

  31. I am so happy to read such a wonderful post...Thank you for updating...VLSI Project Center in Chennai | VLSI Project Center in Velachery

  32. Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging…
    No.1 IOS Training Institute in Chennai | Best IOS Training Institute in Velachery

  33. Impressive blog with lovely information. really very useful article for us thanks for sharing such a wonderful blog...
    MCA Project Center in Chennai | MCA Project Center in Velachery

  34. Extraordinary blog. you put Good stuff. All the themes were clarified briefly.Thanks for sharing that post.Keep in blogging...No.1 IOS Training Institute in Velachery | Best Android Training Institute in Velachery | Core Java Training Institute in Chennai

  35. Thanks for this grateful information. all this information is very important to all the users and can be used good at all this process.
    Web Designing Training Institute in Chennai | Web Designing Training Institute in Velachery

  36. Thanks For Your valuable posting, it was very informative

  37. Appreciation for really being thoughtful and also for deciding on certain marvelous guides most people really want to be aware of.

    AWS Training in Chennai

  38. Thanks a lot for Sharing the valuable information keep posting everyone ..Java Project Center in Chennai | Java Project Center in Velachery

  39. I read that Post and got it fine and informative. Please share more like that..
    hr and payroll software in chennai


Find me on Facebook! Follow me on Twitter!