influxdb icon indicating copy to clipboard operation
influxdb copied to clipboard

[0.9.3] wal compacting causing database to time out

Open kenzodeluxe opened this issue 11 years ago • 7 comments

Once a database has reached a critical size (11GB was mentioned in another issue and seems relevant somehow), wal flushing is causing outages:

[http] 2015/09/06 23:56:55 1.2.3.4 - - [06/Sep/2015:23:56:55 +0200] POST /write?db=monitoring&precision=s HTTP/1.1 204 0 - client 20.828986ms
[wal] 2015/09/06 23:56:56 Flush due to threshold. Flushing 982 series with 5260667 bytes from partition 1. Compacting 702 series
(..)
[http] 2015/09/06 23:57:01 1.2.3.4 - - [06/Sep/2015:23:56:56 +0200] POST /write?db=monitoring&precision=s HTTP/1.1 500 32 - client 5.007814203s
(...)
[http] 2015/09/07 00:02:34 1.2.3.4 - - [07/Sep/2015:00:02:29 +0200] POST /write?db=monitoring&precision=s HTTP/1.1 500 32 - client 5.008541152s

The database will never recover from this fault until it's removed or wal is deleted. Will then happen again once wal is flushed again. du -hs: 55G /var/opt/influxdb/data/monitoring

kenzodeluxe avatar Sep 06 '15 22:09 kenzodeluxe

The following changes were active:

wal-ready-series-size = 4096 wal-partition-size-threshold = 10485760

kenzodeluxe avatar Sep 07 '15 11:09 kenzodeluxe

Neither writing, nor reading is possible when this state has been reached. At a certain level (>55GB?) only dropping the database appears to help.

kenzodeluxe avatar Sep 08 '15 13:09 kenzodeluxe

After a bunch of testing, we've determined that the underlying index just can't keep up with the insertion load that the WAL makes possible. To prevent the system from going OOM and dying we're going to put back pressure on the write clients and start failing writes when memory gets too high. See #4066.

We're also working on a massive storage engine upgrade that will fix this. Should be available in the nightlies within a week or two. It will have much better compression and be able to keep up with the write load of the WAL.

More soon...

pauldix avatar Sep 10 '15 18:09 pauldix

Thanks! Looking forward to getting the fix.

kenzodeluxe avatar Sep 10 '15 20:09 kenzodeluxe

0.9.4-rc1 contains the change that writes will start failing if memory usage gets too high.

https://s3.amazonaws.com/influxdb/influxdb_0.9.4-rc1_amd64.deb https://s3.amazonaws.com/influxdb/influxdb-0.9.4_rc1-1.x86_64.rpm

otoolep avatar Sep 10 '15 20:09 otoolep

Another finding: When compacting leads to 500s for all databases, sometimes restarting influxdb does the trick. Hope that this matches your findings and the fix you mentioned is suitable for this situation, too.

kenzodeluxe avatar Sep 15 '15 06:09 kenzodeluxe

Appears to be fixed in 0.9.4.1.

kenzodeluxe avatar Sep 22 '15 06:09 kenzodeluxe