Skip to content

Commit f71b9a4

Browse files
authored
Update README.md
1 parent abf0cff commit f71b9a4

File tree

1 file changed

+7
-32
lines changed

1 file changed

+7
-32
lines changed

README.md

Lines changed: 7 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,14 @@
11
## About
22

3-
This is a memcache client library for the Go programming language
4-
(http://golang.org/).
3+
This is a fork of the https://github.com/bradfitz/gomemcache
54

6-
## Example
5+
## 🤷‍Why ami I doing this?
6+
In the original repo, the MaxIdleConns only limit idle connections but not the concurrent connections to memcached. So you would have a large number of one-time connections in a moment when high concurrency. As is known to all, memcached connections couldn't close gracefully. There may be a large number of **CLOSE_WAIT** connections in your system.
77

8-
Install with:
98

10-
```shell
11-
$ go get github.com/bradfitz/gomemcache/memcache
12-
```
9+
## What's new
10+
* Limit maximum number of concurrent connections to memcached.
11+
* Use go channel for connection pool.
12+
* Keep each connection in pool alive.
1313

14-
Then use it like:
15-
16-
```go
17-
import (
18-
"github.com/bradfitz/gomemcache/memcache"
19-
)
20-
21-
func main() {
22-
mc := memcache.New("10.0.0.1:11211", "10.0.0.2:11211", "10.0.0.3:11212")
23-
mc.Set(&memcache.Item{Key: "foo", Value: []byte("my value")})
24-
25-
it, err := mc.Get("foo")
26-
...
27-
}
28-
```
29-
30-
## Full docs, see:
31-
32-
See https://pkg.go.dev/github.com/bradfitz/gomemcache/memcache
33-
34-
Or run:
35-
36-
```shell
37-
$ godoc github.com/bradfitz/gomemcache/memcache
38-
```
3914

0 commit comments

Comments
 (0)