aboutsummaryrefslogtreecommitdiffstats
path: root/ethdb
diff options
context:
space:
mode:
authorgary rong <garyrong0905@gmail.com>2018-07-12 16:07:51 +0800
committerPéter Szilágyi <peterke@gmail.com>2018-07-12 16:07:51 +0800
commite8824f6e7409a2064b1165c5b6cc6b2d390573ce (patch)
tree6b8a57248492cb0253c21ee87b5932ecd6cc0ab0 /ethdb
parenta9835c1816bc49ee54c82b4f2a5b05cbcd89881b (diff)
downloadgo-tangerine-e8824f6e7409a2064b1165c5b6cc6b2d390573ce.tar
go-tangerine-e8824f6e7409a2064b1165c5b6cc6b2d390573ce.tar.gz
go-tangerine-e8824f6e7409a2064b1165c5b6cc6b2d390573ce.tar.bz2
go-tangerine-e8824f6e7409a2064b1165c5b6cc6b2d390573ce.tar.lz
go-tangerine-e8824f6e7409a2064b1165c5b6cc6b2d390573ce.tar.xz
go-tangerine-e8824f6e7409a2064b1165c5b6cc6b2d390573ce.tar.zst
go-tangerine-e8824f6e7409a2064b1165c5b6cc6b2d390573ce.zip
vendor, ethdb: resume write operation asap (#17144)
* vendor: update leveldb * ethdb: remove useless warning log
Diffstat (limited to 'ethdb')
-rw-r--r--ethdb/database.go27
1 files changed, 2 insertions, 25 deletions
diff --git a/ethdb/database.go b/ethdb/database.go
index e32c912f9..1b262b73c 100644
--- a/ethdb/database.go
+++ b/ethdb/database.go
@@ -34,9 +34,7 @@ import (
)
const (
- writeDelayNThreshold = 200
- writeDelayThreshold = 350 * time.Millisecond
- writeDelayWarningThrottler = 1 * time.Minute
+ writePauseWarningThrottler = 1 * time.Minute
)
var OpenFileLimit = 64
@@ -206,8 +204,6 @@ func (db *LDBDatabase) meter(refresh time.Duration) {
// Create storage and warning log tracer for write delay.
var (
delaystats [2]int64
- lastWriteDelay time.Time
- lastWriteDelayN time.Time
lastWritePaused time.Time
)
@@ -293,36 +289,17 @@ func (db *LDBDatabase) meter(refresh time.Duration) {
}
if db.writeDelayNMeter != nil {
db.writeDelayNMeter.Mark(delayN - delaystats[0])
- // If the write delay number been collected in the last minute exceeds the predefined threshold,
- // print a warning log here.
- // If a warning that db performance is laggy has been displayed,
- // any subsequent warnings will be withhold for 1 minute to don't overwhelm the user.
- if int(db.writeDelayNMeter.Rate1()) > writeDelayNThreshold &&
- time.Now().After(lastWriteDelayN.Add(writeDelayWarningThrottler)) {
- db.log.Warn("Write delay number exceeds the threshold (200 per second) in the last minute")
- lastWriteDelayN = time.Now()
- }
}
if db.writeDelayMeter != nil {
db.writeDelayMeter.Mark(duration.Nanoseconds() - delaystats[1])
- // If the write delay duration been collected in the last minute exceeds the predefined threshold,
- // print a warning log here.
- // If a warning that db performance is laggy has been displayed,
- // any subsequent warnings will be withhold for 1 minute to don't overwhelm the user.
- if int64(db.writeDelayMeter.Rate1()) > writeDelayThreshold.Nanoseconds() &&
- time.Now().After(lastWriteDelay.Add(writeDelayWarningThrottler)) {
- db.log.Warn("Write delay duration exceeds the threshold (35% of the time) in the last minute")
- lastWriteDelay = time.Now()
- }
}
// If a warning that db is performing compaction has been displayed, any subsequent
// warnings will be withheld for one minute not to overwhelm the user.
if paused && delayN-delaystats[0] == 0 && duration.Nanoseconds()-delaystats[1] == 0 &&
- time.Now().After(lastWritePaused.Add(writeDelayWarningThrottler)) {
+ time.Now().After(lastWritePaused.Add(writePauseWarningThrottler)) {
db.log.Warn("Database compacting, degraded performance")
lastWritePaused = time.Now()
}
-
delaystats[0], delaystats[1] = delayN, duration.Nanoseconds()
// Retrieve the database iostats.