memcached 协议中英文对照

memcached 协议中英文对照

ID:9801193

大小:162.50 KB

页数:14页

时间:2018-05-10

memcached 协议中英文对照_第1页
memcached 协议中英文对照_第2页
memcached 协议中英文对照_第3页
memcached 协议中英文对照_第4页
memcached 协议中英文对照_第5页
资源描述:

《memcached 协议中英文对照》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库

1、Memcached协议中英文对照协议Protocolmemcached的客户端使用TCP链接与服务器通讯。(UDP接口也同样有效,参考后文的“UDP协议”)一个运行中的memcached服务器监视一些(可设置)端口。客户端连接这些端口,发送命令到服务器,读取回应,最后关闭连接。ClientsofmemcachedcommunicatewithserverthroughTCPconnections.(AUDPinterfaceisalsoavailable;detailsarebelowunder"U

2、DPprotocol.")Agivenrunningmemcachedserverlistensonsome(configurable)port;clientsconnecttothatport,sendcommandstotheserver,readresponses,andeventuallyclosetheconnection.结束会话不需要发送任何命令。当不再需memcached服务时,要客户端可以在任何时候关闭连接。需要注意的是,鼓励客户端缓存这些连接,而不是每次需要存取数据时都重新打开连

3、接。这是因为memcached被特意设计成及时开启很多连接也能够高效的工作(数百个,上千个如果需要的话)。缓存这些连接,可以消除建立连接所带来的开销(/*/相对而言,在服务器端建立一个新连接的准备工作所带来的开销,可以忽略不计。)。Thereisnoneedtosendanycommandtoendthesession.Aclientmayjustclosetheconnectionatanymomentitnolongerneedsit.Note,however,thatclientsareenc

4、ouragedtocachetheirconnectionsratherthanreopenthemeverytimetheyneedtostoreorretrievedata.Thisisbecausememcachedisespeciallydesignedtoworkveryefficientlywithaverylargenumber(manyhundreds,morethanathousandifnecessary)ofopenconnections.Cachingconnectionsw

5、illeliminatetheoverheadassociatedwithestablishingaTCPconnection(theoverheadofpreparingforanewconnectionontheserversideisinsignificantcomparedtothis).在memcache协议中发送的数据分两种:文本行和自由数据。文本行被用于来自客户端的命令和服务器的回应。自由数据用于客户端从服务器端存取数据时。同样服务器会以字节流的方式传回自由数据。/*/服务器不用关心自

6、由数据的字节顺序。自由数据的特征没有任何限制;但是通过前文提到的文本行,这项数据的接受者(服务器或客户端),便能够精确地获知所发送的数据库的长度。Therearetwokindsofdatasentinthememcacheprotocol:textlinesandunstructureddata.Textlinesareusedforcommandsfromclientsandresponsesfromservers.Unstructureddataissentwhenaclientwantsto

7、storeorretrievedata.Theserverwilltransmitbackunstructureddatainexactlythesamewayitreceivedit,asabytestream.Theserverdoesn'tcareaboutbyteorderissuesinunstructureddataandisn'tawareofthem.Therearenolimitationsoncharactersthatmayappearinunstructureddata;ho

8、wever,thereaderofsuchdata(eitheraclientoraserver)willalwaysknow,fromaprecedingtextline,theexactlengthofthedatablockbeingtransmitted.文本行固定以“r”(回车符紧跟一个换行符)结束。自由数据也是同样会以“r”结束,但是r(回车符)、(换行符),以及任何其他8位字符,均可出现在数据中。因此,当客户端从服务器取回数据时,必须使

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。