# Influxdb have performance problem when query data

**URL:** https://community.influxdata.com/t/influxdb-have-performance-problem-when-query-data/3752
**Category:** Systems
**Created:** [January 23, 2018, 7:31am UTC](https://community.influxdata.com/t/influxdb-have-performance-problem-when-query-data/3752 "2018-01-23T07:31:38Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![yqfclid](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/yqfclid/32/2258_2.png) [@yqfclid](https://community.influxdata.com/u/yqfclid)
#### Post date: [January 23, 2018, 7:31am UTC](https://community.influxdata.com/t/influxdb-have-performance-problem-when-query-data/3752/1 "2018-01-23T07:31:38Z")

</div>

Hello, I have a problem when I read data from influxdb by http. I find my influxdb use too many memory and cpu of my computer.And the disk io is in high usage,too.But I find My frequency of reading data from influxdb is not high.It’s highest frequency is 116qps.I’m very curious about why influxdb use too many resources of my computer.

This is my requests frequency:

 ![64tu](https://us1.discourse-cdn.com/flex023/uploads/influxdata/original/1X/3878c8d3ddb2696ba9679cf7aae62285c523e322.png)  
This is system info when reading from influxdb  
 ![64IO](https://us1.discourse-cdn.com/flex023/uploads/influxdata/original/1X/590ea41c30f42a1b2a99e8a82a458dda98518e38.png)  
 ![mem](https://us1.discourse-cdn.com/flex023/uploads/influxdata/original/1X/1d0e3d44f9fa1daaf41b9b63b0baf1ff889f3f13.png)  
And my request is like this

```
select *,day_epoch::integer, created_at::integer from one_year.load where symbol = 'node1' order by desc limit 6&epoch=ms
```

this is the debug info I created by folloing commands while I quering data from influxdb

```
curl -o profiles.tar.gz "http://localhost:8086/debug/pprof/all?cpu=true"

curl -o vars.txt "http://localhost:8086/debug/vars"
iostat -xd 1 30 > iostat.txt
```

[iostat.txt](https://discoursecommunity.s3-us-west-1.amazonaws.com/original/1X/f6003dbdd8963e9dfa0462c8f2c48f7d9252e5c2.txt) (10.8 KB)  
[profiles.tar.gz](https://discoursecommunity.s3-us-west-1.amazonaws.com/original/1X/12b02c8206022a489e4614d0f07e52d0d73a88ab.gz) (977.3 KB)  
[vars.txt](https://discoursecommunity.s3-us-west-1.amazonaws.com/original/1X/745645e5c2af68aa0c24b5893e2d0654f8093f32.txt) (98.5 KB)

Do you have any suggestions to help performance tunning?

---

<div class="post-metadata">

### Author: ![philb](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/philb/32/1805_2.png) [@philb](https://community.influxdata.com/u/philb)
#### Post date: [February 1, 2018, 5:08pm UTC](https://community.influxdata.com/t/influxdb-have-performance-problem-when-query-data/3752/2 "2018-02-01T17:08:22Z")

</div>

which version of influx? How many data points are you writing?

Based on my limited knowledge

Whenever i have had issues with memory its down to high cardinality. You can index teh data on disk if you have SSD (i think. They were working on something like this) It’s mentioned [here](https://github.com/influxdata/influxdb/blob/master/CHANGELOG.md#v142-2017-11-15).

That could help. There is also a decent tool on GitHub by one of the guys from Influx. You can use it to bench mark Influx on your kit. I can’t find the link but the tool is called INCH (Influx Benchmark).

Also, Grafana is terribly slow imo when viewing the data in the browser so if you are hosting the TICK stack and Grafana on the same machine.

---

<div class="post-metadata">

### Author: ![yqfclid](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/yqfclid/32/2258_2.png) [@yqfclid](https://community.influxdata.com/u/yqfclid)
#### Post date: [February 2, 2018, 7:07am UTC](https://community.influxdata.com/t/influxdb-have-performance-problem-when-query-data/3752/3 "2018-02-02T07:07:50Z")

</div>

The version of influx is 1.3.8, and the datapoints I write is over 600 millions. I will see if INCH is helpful to my problem.  
Thanks for your reply!

---

<div class="post-metadata">

### Author: ![yqfclid](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/yqfclid/32/2258_2.png) [@yqfclid](https://community.influxdata.com/u/yqfclid)
#### Post date: [February 5, 2018, 11:37am UTC](https://community.influxdata.com/t/influxdb-have-performance-problem-when-query-data/3752/4 "2018-02-05T11:37:10Z")

</div>

Hello, I find inch tests the performance while writing points into influxdb, but my problem happened at the time of quering data.Do you have antother tools help with my problem?

---

<div class="post-metadata">

### Author: ![philb](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/philb/32/1805_2.png) [@philb](https://community.influxdata.com/u/philb)
#### Post date: [February 9, 2018, 8:58am UTC](https://community.influxdata.com/t/influxdb-have-performance-problem-when-query-data/3752/5 "2018-02-09T08:58:46Z")

</div>

Hi, apologies for delayed reply.

I’m afraid i can’t offer much more i’m still wrapping my head around it myself. The later versions of Influx should allow you to send some of the data to disk which should free up the memory.

It might be better if you were to sample the data and downsize it, then query the sampled data. I don’t know if that would help, i haven’t tried it myself - I’m just prepping to update to the latest version to try and fix the memory issues i’m having.

EDIT: [Downsampling and data retention | InfluxDB OSS 1.4 Documentation](https://docs.influxdata.com/influxdb/v1.4/guides/downsampling_and_retention/)

---

<div class="post-metadata">

### Author: ![Kiddinglife](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/kiddinglife/32/2803_2.png) [@Kiddinglife](https://community.influxdata.com/u/Kiddinglife)
#### Post date: [June 4, 2019, 7:15am UTC](https://community.influxdata.com/t/influxdb-have-performance-problem-when-query-data/3752/6 "2019-06-04T07:15:39Z")

</div>

HI mate,  
single instance influx db is very good at handling super frequent write (insert a vast number of lines data per second).  
However, I have to say single instance influx-db is super weak for frequent read but powerful in occasional reads.  
when you read very fast without waiting between each read query, write will be significantly slowed down.

So, I usually sleep a while (100ms) between each query that has a very big time range (up to 1d).  
you can use enterprise or cloud influx-db that provides you r/w split but it is reasonably expensive (thousands dollars for 2 or 3 instances per year).
