Skip to content

Commit

Permalink
Merge pull request #33 from bogdanovich/ab/limit-open-files
Browse files Browse the repository at this point in the history
Limit goleveldb OpenFilesCacheCapacity to 64 files per queue
  • Loading branch information
bogdanovich committed Jan 2, 2016
2 parents 98beb30 + 840ee54 commit cd4b8e7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 0.6.2
- Limit OpenFilesCacheCapacity to 64 per queue

## 0.6.0
- Change durable cursor separator from `:` to `.` for Kestrel compatibility.<br>
Kestrel uses `:` as a namespace separator.
Expand Down
7 changes: 6 additions & 1 deletion queue/queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ var (
ErrSharedFlush = errors.New("queue: can't flush shared queue")
)

const levelDBOpenFilesCacheCapacity = 64

var validQueueNameRegex = regexp.MustCompile(`[^a-zA-Z0-9_\-\:]+`)

// Consumer represents a queue consumer
Expand Down Expand Up @@ -278,7 +280,10 @@ func (q *Queue) open() error {

if !q.isShared {
var err error
q.db, err = leveldb.OpenFile(q.Path(), &opt.Options{})
q.db, err = leveldb.OpenFile(
q.Path(),
&opt.Options{OpenFilesCacheCapacity: levelDBOpenFilesCacheCapacity},
)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion repository/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
)

// Version represents siberite version
const Version = "siberite-0.6.1"
const Version = "siberite-0.6.2"

// QueueRepository represents a repository of queues
type QueueRepository struct {
Expand Down

0 comments on commit cd4b8e7

Please sign in to comment.