influxdb icon indicating copy to clipboard operation
influxdb copied to clipboard

[0.9.6] InfluxDB becomes unavailable after heavy insert load

Open arganzheng opened this issue 10 years ago • 9 comments

I setup influxdb cluster with 3 nodes. Test with small data and it work find. But when I put it to the IDC to collect api response time, it become unavailable. Program insert failed:

[ERROR] 2015-12-17 16:44:30,916 [pool-1-thread-7] com.baidu.global.mobile.server.monitor.server.MonitorAgentImpl (MonitorAgentImpl.java:104) - failed to push metric for metrics=[Lcom.baidu.global.mobile.server.agent.common.Metric;@1b106336
java.lang.RuntimeException: {"error":"write failed: read message type: read tcp 10.242.74.36:8088: i/o timeout"}

        at org.influxdb.impl.InfluxDBErrorHandler.handleError(InfluxDBErrorHandler.java:19)
        at retrofit.RestAdapter$RestHandler.invoke(RestAdapter.java:242)
        at org.influxdb.impl.$Proxy7.writePoints(Unknown Source)
        at org.influxdb.impl.InfluxDBImpl.write(InfluxDBImpl.java:161)
        at com.baidu.global.mobile.server.monitor.server.MonitorAgentImpl.doReport(MonitorAgentImpl.java:102)
        at com.baidu.global.mobile.server.monitor.server.MonitorAgentImpl.batchReport(MonitorAgentImpl.java:69)
        at com.baidu.global.mobile.server.agent.common.MonitorAgent$Processor$batchReport.getResult(MonitorAgent.java:293)
        at com.baidu.global.mobile.server.agent.common.MonitorAgent$Processor$batchReport.getResult(MonitorAgent.java:277)
        at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:39)
        at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:39)
        at org.apache.thrift.server.AbstractNonblockingServer$FrameBuffer.invoke(AbstractNonblockingServer.java:518)
        at org.apache.thrift.server.Invocation.run(Invocation.java:18)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)

and CLI query report error too: ERR: read message type: read tcp 10.242.76.41:8088: i/o timeout.

I check the show servers, all server status are normal. And I still can insert data into it by curl manually or query other database(small data) normal.

Could you recommend a resolution or workaround for the issue I encountered?

Thanks!

arganzheng avatar Dec 17 '15 09:12 arganzheng

I also encounter the flowing problem frequently:

work@hkg02-global-mob-xxx ~]$ influx
Visit https://enterprise.influxdata.com to register for updates, InfluxDB server management, and monitoring.
Connected to http://localhost:8086 version 0.9.6.1
InfluxDB shell 0.9.6.1
> use metrics
Using database metrics
> select * from controller_response_time limit 10;
ERR: read message type: read tcp 10.242.74.36:8088: i/o timeout
> show tag keys
ERR: write message type: use of closed network connection
>

and there are many errors in the influxd.log:

[cluster] 2015/12/17 16:21:08 process map shard error: write message value: write tcp 10.242.74.36:12759: connection reset by peer
[cluster] 2015/12/17 16:21:08 process map shard error writing response: write message type: write tcp 10.242.74.36:12759: broken pipe
[cluster] 2015/12/17 16:21:08 close remote connection from 10.242.74.36:12759
...
[write] 2015/12/17 16:40:06 write failed for shard 6 on node 2: read message type: read tcp 10.242.74.36:8088: i/o timeout
[http] 2015/12/17 16:40:06 10.242.75.27 - argan [17/Dec/2015:16:40:01 +0800] POST /write?consistency=all&db=metrics&p=%5BREDACTED%5D&precision=n&rp=default&u=argan HTTP/1.0 500 104 - okhttp/2.4.0 c30ce477-a499-11e5-a265-000000000000 5.003433876s
[http] 2015/12/17 16:40:06 10.242.75.27 - argan [17/Dec/2015:16:40:06 +0800] POST /write?consistency=all&db=metrics&p=%5BREDACTED%5D&precision=n&rp=default&u=argan HTTP/1.0 204 0 - okhttp/2.4.0 c60cce9c-a499-11e5-a287-000000000000 16.040651ms
[http] 2015/12/17 16:40:06 10.242.75.27 - argan [17/Dec/2015:16:40:06 +0800] POST /write?consistency=all&db=metrics&p=%5BREDACTED%5D&precision=n&rp=default&u=argan HTTP/1.0 204 0 - okhttp/2.4.0 c610e591-a499-11e5-a288-000000000000 6.304565ms
[http] 2015/12/17 16:40:06 10.242.75.27 - argan [17/Dec/2015:16:40:06 +0800] POST /write?consistency=all&db=metrics&p=%5BREDACTED%5D&precision=n&rp=default&u=argan HTTP/1.0 204 0 - okhttp/2.4.0 c6150869-a499-11e5-a289-000000000000 116.357272ms
[http] 2015/12/17 16:40:06 10.242.75.27 - argan [17/Dec/2015:16:40:06 +0800] POST /write?consistency=all&db=metrics&p=%5BREDACTED%5D&precision=n&rp=default&u=argan HTTP/1.0 204 0 - okhttp/2.4.0 c62b95a5-a499-11e5-a28a-000000000000 7.362486ms
[http] 2015/12/17 16:40:06 10.242.75.27 - argan [17/Dec/2015:16:40:06 +0800] POST /write?consistency=all&db=metrics&p=%5BREDACTED%5D&precision=n&rp=default&u=argan HTTP/1.0 204 0 - okhttp/2.4.0 c63082f0-a499-11e5-a28b-000000000000 9.13734ms
[http] 2015/12/17 16:40:07 10.242.75.27 - argan [17/Dec/2015:16:40:07 +0800] POST /write?consistency=all&db=metrics&p=%5BREDACTED%5D&precision=n&rp=default&u=argan HTTP/1.0 204 0 - okhttp/2.4.0 c66b0e9e-a499-11e5-a28d-000000000000 9.339978ms
[write] 2015/12/17 16:40:07 write failed for shard 6 on node 2: read message type: read tcp 10.242.74.36:8088: i/o timeout
[http] 2015/12/17 16:40:07 10.242.75.27 - argan [17/Dec/2015:16:40:01 +0800] POST /write?consistency=all&db=metrics&p=%5BREDACTED%5D&precision=n&rp=default&u=argan HTTP/1.0 500 104 - okhttp/2.4.0 c34590b8-a499-11e5-a26f-000000000000 5.634917291s
[cluster] 2015/12/17 16:40:07 close remote connection from 10.242.76.26:32251
[cluster] 2015/12/17 16:40:07 close remote connection from 10.242.76.26:32248
[cluster] 2015/12/17 16:40:07 close remote connection from 10.242.76.26:32247
[cluster] 2015/12/17 16:40:07 close remote connection from 10.242.76.26:32249
[cluster] 2015/12/17 16:40:07 close remote connection from 10.242.76.26:32250
[write] 2015/12/17 16:40:07 write failed for shard 6 on node 2: read message type: read tcp 10.242.74.36:8088: i/o timeout
[http] 2015/12/17 16:40:07 10.242.75.27 - argan [17/Dec/2015:16:40:01 +0800] POST /write?consistency=all&db=metrics&p=%5BREDACTED%5D&precision=n&rp=default&u=argan HTTP/1.0 500 104 - okhttp/2.4.0 c34d5960-a499-11e5-a270-000000000000 5.593289894s
[write] 2015/12/17 16:40:07 write failed for shard 6 on node 2: read message type: read tcp 10.242.74.36:8088: i/o timeout

arganzheng avatar Dec 17 '15 10:12 arganzheng

@arganzheng since there are I/O timeouts in the logs, is the system starved for resources? What are the CPU, RAM, and IOPS on the box during the issue? Are they close to or exceeding the max available on the box?

beckettsean avatar Dec 19 '15 01:12 beckettsean

@beckettsean, the system load is just fine during the metric collection.

Have you ever test influxdb under heavy load? It's not just a perform issue, but functional. The system just can not work! The insertion goes wrong sometimes, but the query is timeout all the time! Which makes anything in vain.

We finally change to one MySQL, and it works just fine. Although we can't not collect too many data, but three days metrics meet our needs.

arganzheng avatar Dec 22 '15 03:12 arganzheng

@beckettsean BTW, I have try out Kairosdb about one years ago, backing with a three nodes Cassandra cluster. And We collect almost three months metrics, and Kairosdb works without any problem. I switch to influxdb for its easy deployment, but after try out, I think influxdb is not production ready yet.

arganzheng avatar Dec 22 '15 03:12 arganzheng

@arganzheng I understand you are having some frustration, but we have many customers using InfluxDB under heavy load, including one that is writing 500,000 points per second from 4,000 Telegraf sources. The system CAN handle massive load, so there is likely something less than ideal with the configuration of the hardware or software in your system.

I have not seen I/O timeout errors like you are posting, so I'm trying to narrow down the possible causes.

the system load is just fine during the metric collection.

Are you just looking at load average, or do you know that the system IOPS are not saturated? Under decent load a default configuration 0.9.6 installation can require 20,000 IOPS for normal function. Are you running on SSDs?

beckettsean avatar Dec 22 '15 23:12 beckettsean

@beckettsean could you post a blog to describe the details about how do you make this work?

writing 500,000 points per second from 4,000 Telegraf sources

since I haven't found one article describing those details? the proxy servers deployment front of the cluster,the cluster confiuration,and etc? thanks.

just2d avatar Dec 23 '15 10:12 just2d

@just2d as I said, this is a customer deployment. I believe they have plans to blog about it but InfluxData cannot do so without their permission and cooperation.

beckettsean avatar Dec 28 '15 18:12 beckettsean

This should no longer be an issue with v0.10.0 and the TSM storage engine, so I'm closing this out.

toddboom avatar Feb 11 '16 05:02 toddboom

I am using influx version 1.5.2-1

I still face same issues as stated above by some users. Timeout exception is like very common and annoying. I have set timeout config to 3 minutes. All of a sudden performance of db gets very slow..very very slow..frustrating. We have come so fsr with influx,.now switiching to another time series DB is not easy. Any help ?

mahaveer1707 avatar Jan 28 '19 05:01 mahaveer1707