influxdb
influxdb copied to clipboard
[0.9.6.1] influxd crash while executing a query
Hi,
I was trying to test influxd queries at high scale. I created around a million series and 200 data points per series in my db and while running a query, influxd crashed because it ran out of memory. The server has 40 cores and 256G of RAM. After all the data was created, I saw influxd running with 45G (virtual memory), when the query was run.
Below is the stack trace:
[query] 2015/12/23 21:01:21 SELECT sum(bytes) FROM FlowInfo."default".pkt WHERE vrf = 'coke' AND time > now() - 6h GROUP BY time(10s)
fatal error: out of memory
runtime stack:
runtime.MCache_Refill(0x7fe4d10b04b0, 0x3a, 0x8dcb92ea0)
/usr/local/go/src/runtime/mcache.c:92 +0xc4
goroutine 780261 [running]:
runtime.switchtoM()
/usr/local/go/src/runtime/asm_amd64.s:198 fp=0xc8d0d6f1b0 sp=0xc8d0d6f1a8
runtime.mallocgc(0x4000, 0xb0d080, 0x0, 0xe207fd4000)
/usr/local/go/src/runtime/malloc.go:178 +0x849 fp=0xc8d0d6f260 sp=0xc8d0d6f1b0
runtime.newarray(0xb0d080, 0x3e8, 0x0)
/usr/local/go/src/runtime/malloc.go:365 +0xc1 fp=0xc8d0d6f298 sp=0xc8d0d6f260
runtime.makeslice(0x990340, 0x3e8, 0x3e8, 0x0, 0x0, 0x0)
/usr/local/go/src/runtime/slice.go:32 +0x15c fp=0xc8d0d6f2e0 sp=0xc8d0d6f298
github.com/influxdb/influxdb/tsdb/engine/tsm1.(*KeyCursor).init(0xd8ed8ecee0, 0xece0d1e8a, 0x452d4f2, 0x1022880, 0xc8d0d6f401)
/tmp/tmp.NZsW7kxYIE/src/github.com/influxdb/influxdb/tsdb/engine/tsm1/file_store.go:494 +0x28f fp=0xc8d0d6f3c8 sp=0xc8d0d6f2e0
github.com/influxdb/influxdb/tsdb/engine/tsm1.(*KeyCursor).SeekTo(0xd8ed8ecee0, 0xece0d1e8a, 0xe0452d4f2, 0x1022880, 0x1022801, 0x0, 0x0, 0x0, 0x0, 0x0)
/tmp/tmp.NZsW7kxYIE/src/github.com/influxdb/influxdb/tsdb/engine/tsm1/file_store.go:499 +0xa3 fp=0xc8d0d6f4f0 sp=0xc8d0d6f3c8
github.com/influxdb/influxdb/tsdb/engine/tsm1.(*devCursor).SeekTo(0xd8ed8ef550, 0x1422ac6fc889b8f3, 0x0, 0x0, 0x0)
/tmp/tmp.NZsW7kxYIE/src/github.com/influxdb/influxdb/tsdb/engine/tsm1/engine.go:576 +0x173 fp=0xc8d0d6f5f8 sp=0xc8d0d6f4f0
github.com/influxdb/influxdb/tsdb.(*TagsCursor).SeekTo(0xd8ed8e5220, 0x1422ac6fc889b8f3, 0xc008133e1c, 0x0, 0x0)
/tmp/tmp.NZsW7kxYIE/src/github.com/influxdb/influxdb/tsdb/cursor.go:373 +0x8e fp=0xc8d0d6f650 sp=0xc8d0d6f5f8
github.com/influxdb/influxdb/tsdb.readMapItems(0xd8ed8e5220, 0xd7f1a56750, 0x5, 0x1422ac6fc889b8f3, 0x1422ac6fc889b8f3, 0x1422ac70b2a20c00, 0x0, 0x0, 0x0)
/tmp/tmp.NZsW7kxYIE/src/github.com/influxdb/influxdb/tsdb/aggregate.go:834 +0xb9 fp=0xc8d0d6f750 sp=0xc8d0d6f650
github.com/influxdb/influxdb/tsdb.(*AggregateMapper).NextChunk(0xc2c7c8a1e0, 0x0, 0x0, 0x0, 0x0)
/tmp/tmp.NZsW7kxYIE/src/github.com/influxdb/influxdb/tsdb/aggregate.go:808 +0x49a fp=0xc8d0d6f950 sp=0xc8d0d6f750
github.com/influxdb/influxdb/tsdb.(*StatefulMapper).NextChunk(0xd7ea476cc0, 0x3, 0x0, 0x0)
/tmp/tmp.NZsW7kxYIE/src/github.com/influxdb/influxdb/tsdb/mapper.go:26 +0x5c fp=0xc8d0d6f9c0 sp=0xc8d0d6f950
github.com/influxdb/influxdb/tsdb.(*AggregateExecutor).initMappers(0xd7ea476ca0, 0x0, 0x0)
/tmp/tmp.NZsW7kxYIE/src/github.com/influxdb/influxdb/tsdb/aggregate.go:215 +0x8c fp=0xc8d0d6fa30 sp=0xc8d0d6f9c0
github.com/influxdb/influxdb/tsdb.(*AggregateExecutor).execute(0xd7ea476ca0, 0xc92652ede0, 0xc92652ed20)
/tmp/tmp.NZsW7kxYIE/src/github.com/influxdb/influxdb/tsdb/aggregate.go:80 +0x2ce fp=0xc8d0d6ffc8 sp=0xc8d0d6fa30
runtime.goexit()
/usr/local/go/src/runtime/asm_amd64.s:2232 +0x1 fp=0xc8d0d6ffd0 sp=0xc8d0d6ffc8
created by github.com/influxdb/influxdb/tsdb.(*AggregateExecutor).Execute
/tmp/tmp.NZsW7kxYIE/src/github.com/influxdb/influxdb/tsdb/aggregate.go:48 +0x64
goroutine 1 [chan receive, 1582 minutes]:
main.(*Main).Run(0xc20802d680, 0xc20800a010, 0x4, 0x4, 0x0, 0x0)
/tmp/tmp.NZsW7kxYIE/src/github.com/influxdb/influxdb/cmd/influxd/main.go:96 +0x7b3
main.main()
/tmp/tmp.NZsW7kxYIE/src/github.com/influxdb/influxdb/cmd/influxd/main.go:46 +0xdc
goroutine 6 [syscall, 1585 minutes]:
os/signal.loop()
/usr/local/go/src/os/signal/signal_unix.go:21 +0x1f
created by os/signal.init·1
/usr/local/go/src/os/signal/signal_unix.go:27 +0x35
goroutine 17 [syscall, 1585 minutes, locked to thread]:
runtime.goexit()
/usr/local/go/src/runtime/asm_amd64.s:2232 +0x1
goroutine 8 [IO wait, 1585 minutes]:
net.(*pollDesc).Wait(0xc208010610, 0x72, 0x0, 0x0)
/usr/local/go/src/net/fd_poll_runtime.go:84 +0x47
net.(*pollDesc).Wait(0xc208010610, 0x72, 0x0, 0x0)
/usr/local/go/src/net/fd_poll_runtime.go:84 +0x47
net.(*pollDesc).WaitRead(0xc208010610, 0x0, 0x0)
/usr/local/go/src/net/fd_poll_runtime.go:89 +0x43
net.(*netFD).accept(0xc2080105b0, 0x0, 0x7fe4d10c1e70, 0xc20811c000)
/usr/local/go/src/net/fd_unix.go:419 +0x40b
net.(*TCPListener).AcceptTCP(0xc20807ea58, 0x0, 0x0, 0x0)
/usr/local/go/src/net/tcpsock_posix.go:234 +0x4e
net.(*TCPListener).Accept(0xc20807ea58, 0x0, 0x0, 0x0, 0x0)
/usr/local/go/src/net/tcpsock_posix.go:244 +0x4c
github.com/influxdb/influxdb/tcp.(*Mux).Serve(0xc2081041c0, 0x7fe4d10d08a0, 0xc20807ea58, 0x0, 0x0)
/tmp/tmp.NZsW7kxYIE/src/github.com/influxdb/influxdb/tcp/mux.go:48 +0x54
created by github.com/influxdb/influxdb/cmd/influxd/run.func·003
/tmp/tmp.NZsW7kxYIE/src/github.com/influxdb/influxdb/cmd/influxd/run/server.go:361 +0x9cd
goroutine 9 [chan receive, 1585 minutes]:
github.com/influxdb/influxdb/tcp.(*listener).Accept(0xc20807ea60, 0x0, 0x0, 0x0, 0x0)
/tmp/tmp.NZsW7kxYIE/src/github.com/influxdb/influxdb/tcp/mux.go:129 +0x80
github.com/influxdb/influxdb/meta.(*raftLayer).Accept(0xc2080fd920, 0x0, 0x0, 0x0, 0x0)
/tmp/tmp.NZsW7kxYIE/src/github.com/influxdb/influxdb/meta/store.go:2325 +0x64
github.com/hashicorp/raft.(*NetworkTransport).listen(0xc208010690)
/tmp/tmp.NZsW7kxYIE/src/github.com/hashicorp/raft/net_transport.go:362 +0x50
created by github.com/hashicorp/raft.NewNetworkTransportWithLogger
/tmp/tmp.NZsW7kxYIE/src/github.com/hashicorp/raft/net_transport.go:154 +0x2c4
goroutine 10 [select]:
github.com/hashicorp/raft.(*Raft).leaderLoop(0xc20806c1c0)
/tmp/tmp.NZsW7kxYIE/src/github.com/hashicorp/raft/raft.go:854 +0xc7c
github.com/hashicorp/raft.(*Raft).runLeader(0xc20806c1c0)
/tmp/tmp.NZsW7kxYIE/src/github.com/hashicorp/raft/raft.go:826 +0x876
github.com/hashicorp/raft.(*Raft).run(0xc20806c1c0)
/tmp/tmp.NZsW7kxYIE/src/github.com/hashicorp/raft/raft.go:602 +0xc9
github.com/hashicorp/raft.*Raft.(github.com/hashicorp/raft.run)·fm()
/tmp/tmp.NZsW7kxYIE/src/github.com/hashicorp/raft/raft.go:252 +0x27
github.com/hashicorp/raft.func·011()
/tmp/tmp.NZsW7kxYIE/src/github.com/hashicorp/raft/state.go:152 +0x51
created by github.com/hashicorp/raft.(*raftState).goFunc
/tmp/tmp.NZsW7kxYIE/src/github.com/hashicorp/raft/state.go:153 +0xe3
goroutine 11 [select, 195 minutes]:
github.com/hashicorp/raft.(*Raft).runFSM(0xc20806c1c0)
/tmp/tmp.NZsW7kxYIE/src/github.com/hashicorp/raft/raft.go:509 +0x1043
github.com/hashicorp/raft.*Raft.(github.com/hashicorp/raft.runFSM)·fm()
/tmp/tmp.NZsW7kxYIE/src/github.com/hashicorp/raft/raft.go:253 +0x27
github.com/hashicorp/raft.func·011()
/tmp/tmp.NZsW7kxYIE/src/github.com/hashicorp/raft/state.go:152 +0x51
created by github.com/hashicorp/raft.(*raftState).goFunc
/tmp/tmp.NZsW7kxYIE/src/github.com/hashicorp/raft/state.go:153 +0xe3
goroutine 12 [select]:
github.com/hashicorp/raft.(*Raft).runSnapshots(0xc20806c1c0)
/tmp/tmp.NZsW7kxYIE/src/github.com/hashicorp/raft/raft.go:1642 +0x466
github.com/hashicorp/raft.*Raft.(github.com/hashicorp/raft.runSnapshots)·fm()
/tmp/tmp.NZsW7kxYIE/src/github.com/hashicorp/raft/raft.go:254 +0x27
github.com/hashicorp/raft.func·011()
/tmp/tmp.NZsW7kxYIE/src/github.com/hashicorp/raft/state.go:152 +0x51
created by github.com/hashicorp/raft.(*raftState).goFunc
/tmp/tmp.NZsW7kxYIE/src/github.com/hashicorp/raft/state.go:153 +0xe3
goroutine 13 [select, 1585 minutes]:
github.com/influxdb/influxdb/meta.(*localRaft).logLeaderChanges(0xc20805ef00)
/tmp/tmp.NZsW7kxYIE/src/github.com/influxdb/influxdb/meta/state.go:192 +0x46e
created by github.com/influxdb/influxdb/meta.(*localRaft).open
/tmp/tmp.NZsW7kxYIE/src/github.com/influxdb/influxdb/meta/state.go:182 +0x130c
goroutine 14 [chan receive, 1585 minutes]:
github.com/influxdb/influxdb/tcp.(*listener).Accept(0xc20807ea68, 0x0, 0x0, 0x0, 0x0)
/tmp/tmp.NZsW7kxYIE/src/github.com/influxdb/influxdb/tcp/mux.go:129 +0x80
github.com/influxdb/influxdb/meta.(*Store).serveExecListener(0xc20806a3c0)
/tmp/tmp.NZsW7kxYIE/src/github.com/influxdb/influxdb/meta/store.go:742 +0xa1
created by github.com/influxdb/influxdb/meta.(*Store).Open
/tmp/tmp.NZsW7kxYIE/src/github.com/influxdb/influxdb/meta/store.go:248 +0x382
goroutine 15 [chan receive, 1585 minutes]:
github.com/influxdb/influxdb/tcp.(*listener).Accept(0xc20807ea70, 0x0, 0x0, 0x0, 0x0)
/tmp/tmp.NZsW7kxYIE/src/github.com/influxdb/influxdb/tcp/mux.go:129 +0x80
github.com/influxdb/influxdb/meta.(*Store).serveRPCListener(0xc20806a3c0)
/tmp/tmp.NZsW7kxYIE/src/github.com/influxdb/influxdb/meta/store.go:852 +0xc9
created by github.com/influxdb/influxdb/meta.(*Store).Open
/tmp/tmp.NZsW7kxYIE/src/github.com/influxdb/influxdb/meta/store.go:251 +0x3cc
goroutine 34 [select]:
github.com/influxdb/influxdb/meta.(*Store).monitorPeerHealth(0xc20806a3c0)
/tmp/tmp.NZsW7kxYIE/src/github.com/influxdb/influxdb/meta/store.go:450 +0x26b
created by github.com/influxdb/influxdb/meta.(*Store).Open
/tmp/tmp.NZsW7kxYIE/src/github.com/influxdb/influxdb/meta/store.go:276 +0x703
goroutine 35 [select, 1585 minutes]:
github.com/influxdb/influxdb/cmd/influxd/run.(*Server).monitorErrorChan(0xc2080d1440, 0xc20805e480)
/tmp/tmp.NZsW7kxYIE/src/github.com/influxdb/influxdb/cmd/influxd/run/server.go:536 +0x14a
created by github.com/influxdb/influxdb/cmd/influxd/run.func·003
/tmp/tmp.NZsW7kxYIE/src/github.com/influxdb/influxdb/cmd/influxd/run/server.go:367 +0xb44
goroutine 19 [sleep]:
github.com/influxdb/influxdb/tsdb/engine/tsm1.(*DevEngine).compactCache(0xc2081d0780)
/tmp/tmp.NZsW7kxYIE/src/github.com/influxdb/influxdb/tsdb/engine/tsm1/engine.go:391 +0x1f7
created by github.com/influxdb/influxdb/tsdb/engine/tsm1.(*DevEngine).Open
/tmp/tmp.NZsW7kxYIE/src/github.com/influxdb/influxdb/tsdb/engine/tsm1/engine.go:134 +0x24a
goroutine 20 [sleep]:
github.com/influxdb/influxdb/tsdb/engine/tsm1.(*DevEngine).compactTSM(0xc2081d0780)
/tmp/tmp.NZsW7kxYIE/src/github.com/influxdb/influxdb/tsdb/engine/tsm1/engine.go:420 +0x153
created by github.com/influxdb/influxdb/tsdb/engine/tsm1.(*DevEngine).Open
/tmp/tmp.NZsW7kxYIE/src/github.com/influxdb/influxdb/tsdb/engine/tsm1/engine.go:135 +0x267
goroutine 50 [sleep]:
github.com/influxdb/influxdb/tsdb/engine/tsm1.(*DevEngine).compactCache(0xc210c15680)
/tmp/tmp.NZsW7kxYIE/src/github.com/influxdb/influxdb/tsdb/engine/tsm1/engine.go:391 +0x1f7
created by github.com/influxdb/influxdb/tsdb/engine/tsm1.(*DevEngine).Open
/tmp/tmp.NZsW7kxYIE/src/github.com/influxdb/influxdb/tsdb/engine/tsm1/engine.go:134 +0x24a
goroutine 51 [sleep]:
github.com/influxdb/influxdb/tsdb/engine/tsm1.(*DevEngine).compactTSM(0xc210c15680)
/tmp/tmp.NZsW7kxYIE/src/github.com/influxdb/influxdb/tsdb/engine/tsm1/engine.go:420 +0x153
created by github.com/influxdb/influxdb/tsdb/engine/tsm1.(*DevEngine).Open
/tmp/tmp.NZsW7kxYIE/src/github.com/influxdb/influxdb/tsdb/engine/tsm1/engine.go:135 +0x267
...
...
Thanks, Sarat
Fixed in 0.10.