0

Memcache简介

 1 year ago
source link: https://blog.p2hp.com/archives/11191
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

什么是 Memcached?

免费开源、高性能、分布式内存对象缓存系统, 本质上是通用的,但旨在通过减轻数据库负载来加速动态 Web 应用程序d.

Memcached ( memcache )  是一种内存中的键值存储,用于缓存来自数据库调用、API 调用或页面呈现结果的任意小块数据(字符串、对象).

Memcached简单而强大. 其简单的设计促进了快速部署、易于开发,并解决了大数据缓存面临的许多问题。其 API 适用于大多数流行语言.

function get_foo(foo_id)
    foo = memcached_get("foo:" . foo_id)
    return foo if defined foo

    foo = fetch_foo_from_database(foo_id)
    memcached_set("foo:" . foo_id, foo)
    return foo
end

使用远程登录

$ telnet localhost 11211
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
get foo
VALUE foo 0 2
hi
END
stats
STAT pid 8861
(etc)




About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK