@@ -9,11 +9,11 @@ For several more examples demonstrating various circumstances and topologies, se
99
1010## Basic consistent hashing to pool of servers
1111
12- ``` lua
13- -- Minimal configuration.
14- -- No high level routing: just hash keys against the pool's list of backends.
15- -- This should be equivalent to a standard memcached client.
12+ Minimal configuration.
13+ No high level routing: just hash keys against the pool's list of backends.
14+ This should be equivalent to a standard memcached client.
1615
16+ ``` lua
1717pools {
1818 main = {
1919 backends = {
@@ -67,11 +67,11 @@ routes{
6767
6868## Prefix router
6969
70- ``` lua
71- -- In this example we logically split our cache where by default keys are
72- -- spread across a pool of servers to maximize available memory. Then, a small
73- -- set of highly accessed "hot" keys are replicated across multiple servers
70+ In this example we logically split our cache where by default keys are
71+ spread across a pool of servers to maximize available memory. Then, a small
72+ set of highly accessed "hot" keys are replicated across multiple servers
7473
74+ ``` lua
7575pools {
7676 main = {
7777 backends = {
@@ -121,9 +121,10 @@ routes{
121121
122122## Command map
123123
124+ If you don't want to route based on prefix, but instead just based on the
125+ command used, replace map with cmap when building routes{}
126+
124127``` lua
125- -- if you don't want to route based on prefix, but instead just based on the
126- -- command used, replace map with cmap when building routes{}
127128pools {
128129 foo = {
129130 backends = {
@@ -152,15 +153,16 @@ routes{
152153
153154## Route by listener port with tags
154155
156+ It's possible to have different route trees based on the listener port.
157+ this is useful if you want to route to different pools by port alone, or
158+ have different prefix trees for different services.
159+
160+ memcached must be started with options like:
161+ -l 127.0.0.1:12051 -l tag_b_ :127.0.0.1:12052 -l tag_cccc_ :127.0.0.1:12053
162+ this gives a default listener on 12051, "b" tag for 12052, and "cccc" tag
163+ for 12053.
164+
155165``` lua
156- -- it's possible to have different route trees based on the listener port.
157- -- this is useful if you want to route to different pools by port alone, or
158- -- have different prefix trees for different services.
159- --
160- -- memcached must be started like:
161- -- -l 127.0.0.1:12051 -l tag_b_:127.0.0.1:12052 -l tag_cccc_:127.0.0.1:12053
162- -- this gives a default listener on 12051, "b" tag for 12052, and "cccc" tag
163- -- for 12053.
164166pools {
165167 foo = {
166168 backends = {
@@ -205,9 +207,10 @@ routes{
205207
206208## Nested route handlers
207209
210+ A route handler can accept another route handler for any child type entry.
211+ This lets you freely compose complex behaviors from simpler route handlers.
212+
208213``` lua
209- -- A route handler can accept another route handler for any child type entry.
210- -- This lets you freely compose complex behaviors from simpler route handlers.
211214pools {
212215 one = {
213216 backends = {
0 commit comments