mirror of
https://github.com/dolthub/dolt.git
synced 2026-04-23 21:59:01 -05:00
Add rate limit to ipfs chunkstore, increase thread limit
This commit is contained in:
committed by
Dan Willhite
parent
e5bcde644a
commit
b1cb8a0fff
@@ -74,18 +74,21 @@ func runImport(dir, dsSpec string) error {
|
||||
fmt.Println("Creating users")
|
||||
users := topUsers(msgs)
|
||||
|
||||
fmt.Println("Committing data")
|
||||
fmt.Println("Docs:", termDocs.Len(), "Users:", len(users))
|
||||
root := Root{Messages: m, Index: termDocs, Users: users}
|
||||
nroot := marshal.MustMarshal(db, root)
|
||||
if ds.HasHead() {
|
||||
left := ds.HeadValue()
|
||||
parent := Root{
|
||||
parent := marshal.MustMarshal(db, Root{
|
||||
Index: types.NewMap(db),
|
||||
Messages: types.NewMap(db),
|
||||
}
|
||||
nroot, err = merge.ThreeWay(left, nroot, marshal.MustMarshal(db, parent), db, nil, nil)
|
||||
})
|
||||
fmt.Println("Merging data")
|
||||
nroot, err = merge.ThreeWay(left, nroot, parent, db, nil, nil)
|
||||
fmt.Println("Merging complete")
|
||||
d.Chk.NoError(err)
|
||||
}
|
||||
fmt.Println("Committing data")
|
||||
_, err = db.CommitValue(ds, nroot)
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -466,11 +466,28 @@ func highlightTerms(s string, terms []string) string {
|
||||
func expandRLimit() {
|
||||
var rLimit syscall.Rlimit
|
||||
err := syscall.Getrlimit(syscall.RLIMIT_NOFILE, &rLimit)
|
||||
d.Chk.NoError(err, "Unable to query rlimit: %s", err)
|
||||
d.Chk.NoError(err, "Unable to query file rlimit: %s", err)
|
||||
fmt.Println("orig file limit:", rLimit)
|
||||
if rLimit.Cur < rLimit.Max {
|
||||
rLimit.Max = 64000
|
||||
rLimit.Cur = 64000
|
||||
err = syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rLimit)
|
||||
d.Chk.NoError(err, "Unable to increase number of open files limit: %s", err)
|
||||
}
|
||||
err = syscall.Getrlimit(syscall.RLIMIT_NOFILE, &rLimit)
|
||||
d.Chk.NoError(err)
|
||||
fmt.Println("current file limit:", rLimit)
|
||||
|
||||
err = syscall.Getrlimit(8, &rLimit)
|
||||
d.Chk.NoError(err, "Unable to query thread rlimit: %s", err)
|
||||
fmt.Println("orig thread limit:", rLimit)
|
||||
if rLimit.Cur < rLimit.Max {
|
||||
rLimit.Max = 64000
|
||||
rLimit.Cur = 64000
|
||||
err = syscall.Setrlimit(8, &rLimit)
|
||||
d.Chk.NoError(err, "Unable to increase number of threads limit: %s", err)
|
||||
}
|
||||
err = syscall.Getrlimit(8, &rLimit)
|
||||
d.Chk.NoError(err)
|
||||
fmt.Println("current thread limit:", rLimit)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user