influxdata / influxdata/influxdb

Significant CPU usage when waking from sleep

Open
#16,510 0 comments 0 reactions 2 assignees Claimed by @aanthony1243 View on GitHub
area/flux area/performance area/tasks
Dominant language
Rust
Stars
31.7k
Forks
3.7k
Avg merge
13h 37m
Merged PRs (30d)
8

Description

I've noticed this a couple of times now on my development machine (`darwin` / Go 1.13`)

If I wake my machine from sleep `influxd` starts using a significant amount of CPU, but there is not read, write or compaction activity. It looks like it's either related to `flux` or `tasks`. I profiled the process:

[profile001.svg.zip](https://github.com/influxdata/influxdb/files/4050681/profile001.svg.zip)

```
(pprof) top
Showing nodes accounting for 22.06s, 37.20% of 59.30s total
Dropped 466 nodes (cum <= 0.30s)
Showing top 10 nodes out of 193
flat flat% sum% cum cum%
4.07s 6.86% 6.86% 12.64s 21.32% runtime.mallocgc
3.27s 5.51% 12.38% 4.63s 7.81% runtime.mapiternext
2.12s 3.58% 15.95% 2.12s 3.58% runtime.pthread_cond_wait
2.10s 3.54% 19.49% 5.55s 9.36% runtime.scanobject
2s 3.37% 22.87% 2.52s 4.25% runtime.walltime
1.81s 3.05% 25.92% 1.81s 3.05% runtime.pthread_cond_signal
1.77s 2.98% 28.90% 1.97s 3.32% runtime.findObject
1.76s 2.97% 31.87% 1.76s 2.97% runtime.memclrNoHeapPointers
1.61s 2.72% 34.59% 1.61s 2.72% runtime.nextFreeFast
1.55s 2.61% 37.20% 2.21s 3.73% runtime.nanotime
(pprof)
```

```
(pprof) top -cum
Showing nodes accounting for 0.73s, 1.23% of 59.30s total
Dropped 466 nodes (cum <= 0.30s)
Showing top 10 nodes out of 193
flat flat% sum% cum cum%
0.39s 0.66% 0.66% 23.83s 40.19% github.com/influxdata/influxdb/task/backend/scheduler.NewScheduler.func2
0 0% 0.66% 20.46s 34.50% github.com/influxdata/flux/lang.(*AstProgram).Start
0 0% 0.66% 20.46s 34.50% github.com/influxdata/influxdb/query/control.(*Controller).executeQuery
0 0% 0.66% 20.46s 34.50% github.com/influxdata/influxdb/query/control.(*Controller).processQueryQueue
0 0% 0.66% 20.46s 34.50% github.com/influxdata/influxdb/query/control.New.func1
0 0% 0.66% 20.38s 34.37% github.com/influxdata/flux/lang.(*AstProgram).getSpec
0 0% 0.66% 20.37s 34.35% github.com/influxdata/flux.EvalAST
0 0% 0.66% 20.21s 34.08% github.com/influxdata/flux/interpreter.(*Interpreter).Eval
0 0% 0.66% 18.91s 31.89% github.com/influxdata/flux/semantic.InferTypes
0.34s 0.57% 1.23% 18.15s 30.61% github.com/influxdata/influxdb/task/backend/scheduler.(*TreeScheduler).process
(pprof)
```

[pprof.influxd.samples.cpu.043.pb.gz](https://github.com/influxdata/influxdb/files/4050682/pprof.influxd.samples.cpu.043.pb.gz)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.