Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 106 lines (73 sloc) 2.948 kb
3673832 adding a readme
zeusfaber authored
1 merle : An erlang based memcached client.
2
578b666 @ppolv Add clustering support.
authored
3 Modified by Pablo Polvorin from Joe Williams original at
4 http://github.com/joewilliams/merle/
5
6 Usage:
7
8 %2 memcached instances, pool of 5 connections to each.
9 merle_sup:start_link([ ["localhost", 11211],
10 ["localhost", 11212 ]], 5).
11
12 S = merle_cluster_dynamic:get_server("SomeClusteringKey"),
13 P = local_pg2:get_closest_pid(S),
14 merle:getkey(P, "key").
15
16
17 If a memcached node goes down, connections to it will be retried
18 each 15". *Cluster keys aren't re-hashed*, they simple fail while the
19 cache node is down.
20 The cluster key may be different than the search key.
21 It isn't possible to add/remove memcached nodes on the fly, no
22 consistent hashing mechanism is used.
23 -------------------------------------------------------------------
24
25
86e7c7c changed version numbers
zeusfaber authored
26 Version : 0.3
edbe2fe usability changes and getting ready for new release
zeusfaber authored
27
5b3f23e make some changes for first release
zeusfaber authored
28 Author : Joe Williams <joe@joetify.com>
edbe2fe usability changes and getting ready for new release
zeusfaber authored
29 Contributors : Nick Gerakines <nick@gerakines.net>
30
67b3c58 added an emakefile and makefile and adjusted the readme
zeusfaber authored
31 Info : http://github.com/joewilliams/merle/
32
c7b90c5 changed out gen_server for lshift's gen_server2
zeusfaber authored
33 merle uses LShift's gen_server2 module/behavior for faster message queues.
30bd4e4 adjusted version number
joewilliams authored
34 http://hg.rabbitmq.com/rabbitmq-server/file/b95f2fd4e3f6/src/gen_server2.erl
c7b90c5 changed out gen_server for lshift's gen_server2
zeusfaber authored
35
67b3c58 added an emakefile and makefile and adjusted the readme
zeusfaber authored
36 This code is available as Open Source Software under the MIT license.
37
edbe2fe usability changes and getting ready for new release
zeusfaber authored
38
d75570b adjusted readme
zeusfaber authored
39 Features:
edbe2fe usability changes and getting ready for new release
zeusfaber authored
40 * Support for stats, version, getkey, getskey, delete, set, add, replace, cas, flushall, verbosity
d75570b adjusted readme
zeusfaber authored
41
6e0421e serialization note in readme
joewilliams authored
42 Notes:
43 * Uses term_to_binary and binary_to_term to serialize/deserialize Erlang terms before sending/receiving them. This allows for native Erlang terms to be returned from memcached but doesn't play well using other languages after setting values with merle or using merle to get values set by other languages.
44
a45b661 added links to a couple merle based projecs
joewilliams authored
45 Merle Based Projects:
46
47 http://github.com/cstar/merle/tree/master
48 http://github.com/issuu/merle/tree/master
1a6774a added another merle project to the readme.
joewilliams authored
49 http://github.com/0lvin/merle/tree/master
a45b661 added links to a couple merle based projecs
joewilliams authored
50
edbe2fe usability changes and getting ready for new release
zeusfaber authored
51 Usage:
5b3f23e make some changes for first release
zeusfaber authored
52
edbe2fe usability changes and getting ready for new release
zeusfaber authored
53 * Connecting to memcached *
5b3f23e make some changes for first release
zeusfaber authored
54
98616c1 merle 0.2 release.
zeusfaber authored
55 Using defaults:
56
edbe2fe usability changes and getting ready for new release
zeusfaber authored
57 > merle:connect().
5b3f23e make some changes for first release
zeusfaber authored
58
98616c1 merle 0.2 release.
zeusfaber authored
59 Set your own:
60
61 > merle:connect("HOSTNAME", 11211).
3673832 adding a readme
zeusfaber authored
62
63
edbe2fe usability changes and getting ready for new release
zeusfaber authored
64 * A few operations *
9d0b2a7 adjusted readme with new info
zeusfaber authored
65
edbe2fe usability changes and getting ready for new release
zeusfaber authored
66 > merle:set(a, asdf).
67 ok
68 > merle:getkey(a).
69 asdf
9d0b2a7 adjusted readme with new info
zeusfaber authored
70
edbe2fe usability changes and getting ready for new release
zeusfaber authored
71 > merle:set(a, asdf).
72 ok
73 > merle:getskey(a).
74 [4,asdf]
75 > merle:cas(a, 4, asdfasdf).
76 ok
77 > merle:getskey(a).
78 [5,asdfasdf]
9d0b2a7 adjusted readme with new info
zeusfaber authored
79
edbe2fe usability changes and getting ready for new release
zeusfaber authored
80 > merle:delete(a).
81 ok
9d0b2a7 adjusted readme with new info
zeusfaber authored
82
edbe2fe usability changes and getting ready for new release
zeusfaber authored
83 * Informational commands *
9d0b2a7 adjusted readme with new info
zeusfaber authored
84
edbe2fe usability changes and getting ready for new release
zeusfaber authored
85 > merle:version().
86 ["VERSION 1.2.6"]
9d0b2a7 adjusted readme with new info
zeusfaber authored
87
edbe2fe usability changes and getting ready for new release
zeusfaber authored
88 > merle:stats(slabs).
d75570b adjusted readme
zeusfaber authored
89 ["STAT 1:chunk_size 104","STAT 1:chunks_per_page 10082",
90 "STAT 1:total_pages 1","STAT 1:total_chunks 10082",
91 "STAT 1:used_chunks 10081","STAT 1:free_chunks 1",
edbe2fe usability changes and getting ready for new release
zeusfaber authored
92 "STAT 1:free_chunks_end 10080","STAT active_slabs 1",
93 "STAT total_malloced 1048528","END"]
d75570b adjusted readme
zeusfaber authored
94
edbe2fe usability changes and getting ready for new release
zeusfaber authored
95 > merle:stats().
96 ["STAT pid 27195","STAT uptime 497","STAT time 1232843046",
97 "STAT version 1.2.6","STAT pointer_size 64",
98 "STAT rusage_user 0.000000","STAT rusage_system 0.008000",
99 "STAT curr_items 1","STAT total_items 5","STAT bytes 83",
100 "STAT curr_connections 2","STAT total_connections 5",
101 "STAT connection_structures 3","STAT cmd_get 5",
102 "STAT cmd_set 5","STAT get_hits 5","STAT get_misses 0",
103 "STAT evictions 0","STAT bytes_read 216",
104 "STAT bytes_written 468","STAT limit_maxbytes 67108864",
105 "STAT threads 1","END"]
Something went wrong with that request. Please try again.