memcached 是一种高性能的分布式内存对象缓存系统,具有通用性,但最初旨在通过减轻数据库负载来加速动态 Web 应用程序。
您可以将其视为应用程序的短期内存。
memcached 允许您从系统中内存充足的部分获取内存,并将其提供给内存不足的区域。
memcached 还允许您更好地利用内存。如果您考虑右侧的图表,您可以看到两种部署场景
第一个场景说明了经典的部署策略,但是您会发现它既浪费,因为总缓存大小只是您 Web 服务器场实际容量的一小部分,而且在保持所有这些节点之间缓存一致性方面也需要付出很多努力。
使用 memcached,您可以看到所有服务器都在查看同一个虚拟内存池。这意味着给定项始终存储在整个 Web 集群中的相同位置,并且始终从该位置检索。
此外,随着应用程序需求的增长,您需要更多服务器,通常也需要更多需要定期访问的数据。将系统这两个方面一起扩展的部署策略是有意义的。
右侧的插图仅显示了两个 Web 服务器,为了简单起见,但随着数量的增加,属性保持不变。如果您有 50 个 Web 服务器,第一个示例中可用的缓存大小仍然为 64MB,但在第二个示例中,可用的缓存大小为 3.2GB。
当然,您不需要使用 Web 服务器的内存作为缓存。许多 memcached 用户拥有专门的机器,这些机器专门用作 memcached 服务器。
Memcached 最初由 Brad Fitzpatrick 于 2003 年为 LiveJournal 开发。
dormando (978) | Dustin Sallings (214) | Brad Fitzpatrick (164) | Trond Norbye (130) |
Paul Lindner (58) | Toru Maesaka (34) | Steven Grimm (25) | David Carlier (23) |
Kevin Lin (17) | Stanisław Pitucha (16) | Anatoly Vorobey (15) | Brian Aker (15) |
Steve Yen (15) | Tomash Brechko (12) | minkikim89 (12) | Fei Hu (9) |
Tharanga Gamaethige (9) | Tomas Korbar (7) | hachi (7) | Aaron Stone (6) |
Dan McGee (6) | Guillaume Delacour (6) | Kanak Kshetri (6) | Ola Jeppsson (6) |
Steve Wills (6) | Daniel Schemmel (5) | Evan Martin (5) | Fabrice Fontaine (5) |
Matt Ingenthron (5) | Miroslav Lichvar (5) | Peter (Stig) Edwards (5) | Sailesh Mukil (5) |
xuesenliang (5) | Chris Goffinet (4) | Craig Andrews (4) | David CARLIER (4) |
Eric McConville (4) | Finn Frankis (4) | Jefty Negapatan (4) | Remi Collet (4) |
Victor Kirkebo (4) | Andrei Nigmatulin (3) | Calin Iorgulescu (3) | Cameron Norman (3) |
Daniel Pañeda (3) | Eric Lambert (3) | Jay Grizzard (3) | Paul Furtado (3) |
Qu Chen (3) | sergiocarlos (3) | Antony Dovgal (2) | Bernhard M. Wiedemann (2) |
Brion Vibber (2) | Carl Myers (2) | Clint Byrum (2) | Colin Pitrat (2) |
Cosimo Streppone (2) | David Bremner (2) | Dmitry Volodin (2) | Doug Porter (2) |
Eric Hodel (2) | Evan Miller (2) | Giovanni Bechis (2) | Iqram Mahmud (2) |
J. Grizzard (2) | Jason CHAN (2) | Jay Bonci (2) | Jean-Francois BUSTARRET (2) |
Josh Soref (2) | Khem Raj (2) | Linkerist (2) | Mat Hostetter (2) |
Monty Taylor (2) | Olof Nord (2) | Paolo Borelli (2) | Ricky Zhou (2) |
Shiv Nagarajan (2) | Tianon Gravi (2) | Tyson Andre (2) | Vadim Pushtaev (2) |
pkarumanchi9 (2) | 祁冰 (2) | Adam Chainz (1) | Adam Dixon (1) |
Adam Szkoda (1) | Adam Thomason (1) | Alex Leone (1) | Alexander Pyhalov (1) |
Ali Saidi (1) | Alwayswithme (1) | Andre Azevedo Pinto (1) | Andrew Drake (1) |
Andrew Glinskiy (1) | Andrey Niakhaichyk (1) | Anthony Ryan (1) | Artur Bergman (1) |
Baptiste Mille-Mathias (1) | Ben Evans (1) | Caleb Shay (1) | CaptTofu (1) |
Chang Song (1) | Charmander (1) | Chen-Yu Tsai (1) | Clinton Webb (1) |
Dagobert Michelsen (1) | Dan Christian (1) | Daniel Byrne (1) | Danny Kopping (1) |
David Bohman (1) | David J. M. Karlsen (1) | David Oliveira (1) | David Phillips (1) |
David Schoen (1) | Dmitry Isaykin (1) | Don MacAskill (1) | Eiichi Tsukata (1) |
Eli Bingham (1) | Elizabeth Mattijsen (1) | Evan Klitzke (1) | Fangrui Song (1) |
Filipe Laborde (1) | Fordy (1) | Fumihiro Ito (1) | Gabe Van Engel (1) |
Gabriel A. Samfira (1) | Gleicon Moraes (1) | Gordon Franke (1) | Grant Mathews (1) |
Gregor Jasny (1) | Guido Iaquinti (1) | Hemal Shah (1) | Hervé Beraud (1) |
Huzaifa Sidhpurwala (1) | Iain Wade (1) | Ian Miell (1) | Iliya (1) |
Ing-eoking (1) | James Cohen (1) | Jamie McCarthy (1) | Jason Titus (1) |
Jeff Lawson (1) | Jeremy Sowden (1) | Joe Orton (1) | Johan Bergström (1) |
John Leslie (1) | Jon Jensen (1) | Jonathan Bastien-Filiatrault (1) | Jonathan Steinert (1) |
Josh Kupershmidt (1) | Juliy V. Chirkov (1) | Junji Hashimoto (1) | Jørgen Austvik (1) |
Kenneth Steele (1) | Keyur (1) | KissPeter (1) | Kleber (1) |
LSmithx2 (1) | Levente Polyak (1) | Lisa Seelye (1) | Léon Brocard (1) |
Maksim Zhylinski (1) | Manish Katiyar (1) | Mark Hagger (1) | Martin Tzvetanov Grigorov (1) |
Mate Borcsok (1) | Mathieu CARBONNEAUX (1) | Matt Fowles Kulukundis (1) | Matthew Shafer (1) |
Mattias Geniar (1) | Maxim Dounin (1) | Menghan (1) | Michael Alan Dorman (1) |
Mike Dillon (1) | Miklos Vajna (1) | Natanael Copa (1) | Nate (1) |
Nathan Neulinger (1) | Nick (1) | Nick Frost (1) | Nick Pillitteri (1) |
Ori Shalev (1) | Oskari Saarenmaa (1) | Patrice Duroux (1) | Paul Querna (1) |
Peter van Dijk (1) | Piotr Balcer (1) | Prudhviraj K (1) | Qian Li (1) |
Ramasai (1) | Raphael Isemann (1) | Richard Russo (1) | River Tarnell (1) |
Roman Mueller (1) | Ryan McCullagh (1) | Ryan T. Dean (1) | Ryan Tomayko (1) |
Saman Barghi (1) | Sergei Trofimovich (1) | Sergio Durigan Junior (1) | Sharif Nassar (1) |
Simon Liu (1) | Sjon Hortensius (1) | Sridhar Samudrala (1) | Steve Peters (1) |
Tao Hui (1) | Ted Schundler (1) | Theo Najim (1) | Thomas van Gulick (1) |
Tim Yardley (1) | Tom Stellard (1) | Tomas Kalibera (1) | Torsten Foertsch (1) |
弗拉基米尔 (1) | Wing Lian (1) | 孙永悦 (1) | 郑谷 (1) |
ajccosta (1) | akisssa (1) | bitground (1) | clark.kang (1) |
githublvv (1) | hayashier (1) | hiracy (1) | iqr4m (1) |
js (1) | jwbee (1) | kenvifire (1) | kokke (1) |
kun (1) | 刘波 (1) | 李文龙05 (1) | mckelvin (1) |
mdl (1) | meteorgan (1) | miwasson (1) | neal-zhu (1) |
nirvanazc (1) | phantom9999 (1) | prudhvi (1) | q66 (1) |
theblop (1) | tom (1) | 王康-xy (1) | yuryur (1) |
周泰 (1) | 伊藤洋也 (1) |