Skip to content
This repository has been archived by the owner on Oct 17, 2023. It is now read-only.

use a smaller buffer for mongo adaptor #63

Merged
merged 1 commit into from
Feb 27, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pkg/adaptor/mongodb.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
)

const (
MONGO_BUFFER_SIZE int = 5e6
MONGO_BUFFER_SIZE int = 1e6
MONGO_BUFFER_LEN int = 5e5
)

Expand Down Expand Up @@ -76,7 +76,7 @@ func NewMongodb(p *pipe.Pipe, path string, extra Config) (StopStartListener, err
tail: conf.Tail,
debug: conf.Debug,
path: path,
opsBuffer: make([]interface{}, 0, MONGO_BUFFER_SIZE),
opsBuffer: make([]interface{}, 0, MONGO_BUFFER_LEN),
bulkWriteChannel: make(chan interface{}),
bulkQuitChannel: make(chan chan bool),
bulk: conf.Bulk,
Expand Down Expand Up @@ -242,7 +242,7 @@ func (m *Mongodb) writeBuffer() {
}
}

m.opsBuffer = make([]interface{}, 0, MONGO_BUFFER_SIZE)
m.opsBuffer = make([]interface{}, 0, MONGO_BUFFER_LEN)
m.opsBufferSize = 0
}

Expand Down