[0.9.4.2] InfluxDB becomes unresponsive (and doesn't recover)
We are running version 0.9.4.2 in production for about two weeks, and we are experiencing some wierd behaviour about once a day (it seems to be on a regular interval). What happens in that the load increases from a about 0.10 to 10-15, and becomes very unresponsive. This can continue for several hours (from 2-3 to 7-8 hours). Some days it manages to get back to a normal responsive state with a low load, but sometimes it just starts rejecting requests (throwing http 500), and it won't start accepting until i restart the service. I got a tip on IRC that this might be when it starts to do some compaction on the data, but I'm not able to verify this as I cant see any corresponding events in the log.
The system is a VM with 4 cores and 32 GB of RAM
[root@a01dbvl001 influxdb]# cat /proc/version
Linux version 2.6.32-573.3.1.el6.x86_64 ([email protected]) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-16) (GCC) ) #1 SMP Mon Aug 10 09:44:54 EDT 2015
Im sending about one HTTP POST a second containing exactly 2000 points using the line protocol:
[root@a01dbvl001 influxdb]# tail -f influxd.log | grep "POST /write"
[http] 2015/11/30 07:53:02 10.161.8.32 - - [30/Nov/2015:07:53:02 +0100] POST /write?db=metrics&precision=s HTTP/1.1 204 0 - Ruby ffefa58f-972e-11e5-a228-000000000000 3.07712ms
[http] 2015/11/30 07:53:03 10.161.16.50 - - [30/Nov/2015:07:53:03 +0100] POST /write?db=metrics&precision=s HTTP/1.1 204 0 - Ruby 00c83052-972f-11e5-a229-000000000000 30.409292ms
[http] 2015/11/30 07:53:04 10.161.8.32 - - [30/Nov/2015:07:53:04 +0100] POST /write?db=metrics&precision=s HTTP/1.1 204 0 - Ruby 0100bb6c-972f-11e5-a22b-000000000000 29.559569ms
[http] 2015/11/30 07:53:04 10.161.8.32 - - [30/Nov/2015:07:53:04 +0100] POST /write?db=metrics&precision=s HTTP/1.1 204 0 - Ruby 0122cdc4-972f-11e5-a22c-000000000000 2.399596ms
[http] 2015/11/30 07:53:05 10.161.16.50 - - [30/Nov/2015:07:53:05 +0100] POST /write?db=metrics&precision=s HTTP/1.1 204 0 - Ruby 01bc4921-972f-11e5-a22d-000000000000 2.716912ms
[http] 2015/11/30 07:53:06 10.161.8.32 - - [30/Nov/2015:07:53:06 +0100] POST /write?db=metrics&precision=s HTTP/1.1 204 0 - Ruby 023f9c22-972f-11e5-a22e-000000000000 32.113661ms
Here you can see the spikes happening, however the incoming traffic to the server is constant (1 request/s containing 2000 points).
Is there some settings I can tune to alleviate this, or debug info I can turn on in order to figure out what's happening here? I have not changed anything from the default settings.
Any help is greatly appreciated.
May I ask which monitor do you use? :smile:
Sure, this is Grafana
@jhrv I don't see anything directly indicative of what might be happening. Do you have any idea what is happening to the IOPS during the high CPU load times? I suspect it might be BoltDB thrashing.
Your writes look to be fine, in that 2k is a good batch size and they are completing quickly.
What is your query load? Do you have regular dashboards, ad hoc queries, or a mix of both?
Getting 500s on writes is expected behavior when the system is too busy. Are you also getting 500s on queries?
Im currently not monitoring IOPS, but I could do that. The query load is pretty much constant, and close to all are from Grafana dashboards. Since both the reads and writes from/to the server is constant and the spikes seems to be happening on a regular interval i suspect that it might be something that InfluxDB does internally like indexing or compressing perhaps?
I'm not 100% sure, but I think the queries just time out (nothing in the logs) - the writes however gets 500s.
@jhrv I agree it's probably a compaction or WAL flush that's leading to the issue, and if so, I think it's likely we will see IOPS are saturated during the high CPU time.
What's the refresh interval for the Grafana dashboards? Are any of the queries unbounded in time?
Okey, I'll set up IOPS monitoring for this so we will know the next time it occurs. The dashboard refresh interval varies as they are defined by several different users, but ATM the query load is pretty low. If you think this is relevant can give you some better info about this tomorrow when I'm back at work.
@jhrv regarding the dashboards, I'm just wondering if someone has a very expensive SELECT * FROM foo or SELECT value FROM /.*/ WHERE time > now() - 1d type query running.
Okey, I've just verified that there is nothing unusual with the queries - none of them are unbound in time or selects from every measurement. Monitoring is also configured for IO using iostat, so if it gets in the same state as before we should be able to see if the high load is due to reads or writes to disk.
Sounds good. Let us know what you find, @jhrv.
@beckettsean I have similar problem. Mine is getting extreamly slow about once a day and spitting 500 responses also. (mine is 0.9.5 stable)
@seyoonhan can you provide similar information as to what @jhrv has given already in the issue? Not all performance issues are the same underlying cause.
@seyoonhan it looks like you opened https://github.com/influxdb/influxdb/issues/5105 for your performance issue.
@beckettsean Yes, thank you.
@beckettsean I'm not seeing the same issue after 11 days now, so I'll close the issue. Ill let you know if I find anything interesting with the new monitoring in place. Thank you for your help!
Thanks for the update, @jhrv. Should anything pop up please re-open or start a new issue.