Skip to content
This repository has been archived by the owner on Aug 28, 2021. It is now read-only.

Commit

Permalink
Set concurrency used by writeValue handler to num CPUs (#3030)
Browse files Browse the repository at this point in the history
Fixes #3022
  • Loading branch information
cmasone-attic authored Jan 5, 2017
1 parent 87b7bed commit ce5c747
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions go/datas/remote_database_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"io/ioutil"
"net/http"
"net/url"
"runtime"
"strings"
"time"

Expand All @@ -33,10 +34,9 @@ type Handler func(w http.ResponseWriter, req *http.Request, ps URLParams, cs chu
const (
// NomsVersionHeader is the name of the header that Noms clients and
// servers must set in every request/response.
NomsVersionHeader = "x-noms-vers"
nomsBaseHTML = "<html><head></head><body><p>Hi. This is a Noms HTTP server.</p><p>To learn more, visit <a href=\"https://github.com/attic-labs/noms\">our GitHub project</a>.</p></body></html>"
writeValueConcurrency = 16
maxGetBatchSize = 1 << 11 // Limit GetMany() to ~8MB of data
NomsVersionHeader = "x-noms-vers"
nomsBaseHTML = "<html><head></head><body><p>Hi. This is a Noms HTTP server.</p><p>To learn more, visit <a href=\"https://github.com/attic-labs/noms\">our GitHub project</a>.</p></body></html>"
maxGetBatchSize = 1 << 11 // Limit GetMany() to ~8MB of data
)

var (
Expand Down Expand Up @@ -79,6 +79,8 @@ var (
// TODO: Nice comment about what headers it expects/honors, payload
// format, and error responses.
HandleBaseGet = handleBaseGet

writeValueConcurrency = runtime.NumCPU()
)

func versionCheck(hndlr Handler) Handler {
Expand Down

0 comments on commit ce5c747

Please sign in to comment.