influxdb icon indicating copy to clipboard operation
influxdb copied to clipboard

[0.9.5] InfluxDB becomes unresponsive

Open seyoonhan opened this issue 10 years ago • 11 comments

I'm using InfluxDB for production stage. But once a day, I should restart the db manually. Because InfluxDB becomes unresponsive once a day, rejecting all request with http 500. And It tooks exactly 5s to give 500 response to client.(seems timeout)

Please see middle of the log.(Click image) After running CQ, the db becomes unresponsive. (At that time, there were very small inputs, no issue on system, and there were no expensive queries running.) 2015-12-14 10 25 08

Running CQ list. 2015-12-14 10 26 06

Configuration(It's almost default)

[meta]
  dir = "/db/meta"
  hostname = "localhost"
  bind-address = ":8088"
  retention-autocreate = true
  election-timeout = "1s"
  heartbeat-timeout = "1s"
  leader-lease-timeout = "500ms"
  commit-timeout = "50ms"
  cluster-tracing = false
  raft-promotion-enabled = true

[data]
  dir = "/db/data"
  engine = "bz1"
  max-wal-size = 104857600
  wal-flush-interval = "10m0s"
  wal-partition-flush-delay = "2s"
  wal-dir = "/db/wal"
  wal-logging-enabled = false
  wal-ready-series-size = 30720
  wal-compaction-threshold = 0.5
  wal-max-series-size = 1048576
  wal-flush-cold-interval = "5s"
  wal-partition-size-threshold = 52428800
  wal-flush-memory-size-threshold = 5242880
  wal-max-memory-size-threshold = 104857600
  index-compaction-age = 60000000000
  index-min-compaction-interval = 60000000000
  index-compaction-min-file-count = 5
  index-compaction-full-age = 300000000000
  query-log-enabled = true

[cluster]
  force-remote-mapping = false
  write-timeout = "5s"
  shard-writer-timeout = "5s"
  shard-mapper-timeout = "5s"

[retention]
  enabled = true
  check-interval = "1440m0s"

[registration]
  enabled = true
  url = "https://enterprise.influxdata.com"
  token = ""
  stats-interval = "1m0s"

[shard-precreation]
  enabled = true
  check-interval = "10m0s"
  advance-period = "30m0s"

[admin]
  enabled = true
  bind-address = ":8083"
  https-enabled = false
  https-certificate = "/etc/ssl/influxdb.pem"

[monitor]
  store-enabled = false
  store-database = "_internal"
  store-interval = "10s"

[subscriber]
  enabled = true

[http]
  enabled = true
  bind-address = ":8086"
  auth-enabled = false
  log-enabled = true
  write-tracing = false
  pprof-enabled = false
  https-enabled = false
  https-certificate = "/etc/ssl/influxdb.pem"

[collectd]
  enabled = false
  bind-address = ":25826"
  database = "collectd"
  retention-policy = ""
  batch-size = 10000
  batch-pending = 10
  batch-timeout = "10s"
  read-buffer = 0
  typesdb = "/usr/share/collectd/types.db"

[opentsdb]
  enabled = false
  bind-address = ":4242"
  database = "opentsdb"
  retention-policy = ""
  consistency-level = "one"
  tls-enabled = false
  certificate = "/etc/ssl/influxdb.pem"
  batch-size = 1000
  batch-pending = 5
  batch-timeout = "1s"

[continuous_queries]
  log-enabled = true
  enabled = true
  recompute-previous-n = 2
  recompute-no-older-than = "10m0s"
  compute-runs-per-interval = 10
  compute-no-more-than = "2m0s"

[hinted-handoff]
  enabled = true
  dir = "/db/hh"
  max-size = 1073741824
  max-age = "168h0m0s"
  retry-rate-limit = 0
  retry-interval = "1s"
  retry-max-interval = "1m0s"
  purge-interval = "1h0m0s"

Hardware

cpu / Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian CPU(s): 24 On-line CPU(s) list: 0-23 Thread(s) per core: 2 Core(s) per socket: 6 Socket(s): 2 NUMA node(s): 2 Vendor ID: GenuineIntel CPU family: 6 Model: 45 Stepping: 7 CPU MHz: 1999.995 BogoMIPS: 3999.44 Virtualization: VT-x L1d cache: 32K L1i cache: 32K L2 cache: 256K L3 cache: 15360K NUMA node0 CPU(s): 0,2,4,6,8,10,12,14,16,18,20,22 NUMA node1 CPU(s): 1,3,5,7,9,11,13,15,17,19,21,23

storage/ SSD enough space

ram/ 64GB

seyoonhan avatar Dec 14 '15 02:12 seyoonhan

happened to me too this morning. version 0.9.5.1

[http] 2015/12/14 03:23:33 172.29.0.119 - - [14/Dec/2015:03:23:33 +0000] POST /write?consistency=&db=system_info&precision=s&rp= HTTP/1.1 204 0 - InfluxDBClient 0e6c2fea-a212-11e5-822e-000000000000 10.733403ms
[wal] 2015/12/14 03:23:34 Flush due to idle. Flushing 25 series with 25 points and 1037 bytes from partition 1
[wal] 2015/12/14 03:23:34 write to index of partition 1 took 7.897536ms
[http] 2015/12/14 03:23:36 172.29.0.72 - - [14/Dec/2015:03:23:36 +0000] POST /write?consistency=&db=system_info&precision=s&rp= HTTP/1.1 204 0 - InfluxDBClient 0fda5273-a212-11e5-822f-000000000000 10.103104ms
[http] 2015/12/14 03:23:36 172.29.0.72 - - [14/Dec/2015:03:23:36 +0000] POST /write?db=em_server HTTP/1.1 204 0 - Java/1.7.0_79 100d49e2-a212-11e5-8230-000000000000 3.236435ms
[http] 2015/12/14 03:23:37 172.29.0.133 - - [14/Dec/2015:03:23:37 +0000] POST /write?db=em_server HTTP/1.1 204 0 - Java/1.8.0_11 105e9435-a212-11e5-8231-000000000000 3.097265ms
[query] 2015/12/14 03:23:37 SELECT (sum(success) + sum(failure)) AS "Total", sum(success) AS "Success" FROM "em_server"."default".youtube_sign WHERE (success > 0.000 OR failure > 0.000) AND time > now() - 12h GROUP BY time(1m)
[query] 2015/12/14 03:23:41 SELECT sum(success) + sum(failure) FROM "em_server"."default".mp3_query WHERE (success > 0.000 OR failure > 0.000) AND time > now() - 1d
[wal] 2015/12/14 03:23:41 Flush due to idle. Flushing 2041 series with 12081 points and 205891 bytes from partition 1
[wal] 2015/12/14 03:23:42 write to index of partition 1 took 820.932083ms
[monitor] 2015/12/14 03:23:43 failed to store statistics: timeout
[query] 2015/12/14 03:23:44 SELECT (sum(success) + sum(failure)) AS "Total" FROM "em_server"."default".youtube_sign WHERE (success > 0.000 OR failure > 0.000) AND time > now() - 1d
[http] 2015/12/14 03:23:44 172.29.0.32 - - [14/Dec/2015:03:23:39 +0000] POST /write?consistency=&db=system_info&precision=s&rp= HTTP/1.1 500 32 - InfluxDBClient 11fd38be-a212-11e5-8233-000000000000 5.001155191s
[http] 2015/12/14 03:23:46 172.29.3.74 - - [14/Dec/2015:03:23:41 +0000] POST /write?db=em_server HTTP/1.1 500 8 - Python-urllib/2.7 12e00e34-a212-11e5-8235-000000000000 5.000447458s

page31 avatar Dec 14 '15 03:12 page31

@seyoonhan try increasing the write_timeout to 10 seconds.

...
[cluster]
  force-remote-mapping = false
  write-timeout = "10s"
  shard-writer-timeout = "5s"
  shard-mapper-timeout = "5s"
...

desa avatar Dec 14 '15 17:12 desa

@mjdesa Isn't it cluster setting? I'm running influxDB on single machine.

seyoonhan avatar Dec 15 '15 02:12 seyoonhan

before it becomes unresponsive, the memory and cpu resources are nearly used up. when that happened yesterday, i restarted the service and 1 minute later it happened again. finally I set up a cluster of two instance and one for write (r3.large) one for query(r3.xlarge). now the one for write is almost idle but the other one's load is quite heavy however both responsive.

page31 avatar Dec 15 '15 03:12 page31

@page31 Thank you for sharing your solution. I have set wal-dir to another storage from data-dir yesterday, and it seems OK till now. If it doesn't work, maybe I should try your solution.

seyoonhan avatar Dec 15 '15 06:12 seyoonhan

@page31 Seperating wal-dir from data-dir storage didn't help anything with this issue. Same problem occured after running 25 hours. I'll try your solution tomorrow, thank you.

seyoonhan avatar Dec 15 '15 09:12 seyoonhan

@seyoonhan write-timeout is not a cluster setting, it sets the timeout for all write operations. If the write takes more than the write-timeout setting, a 500 error is returned to the client.

beckettsean avatar Dec 15 '15 17:12 beckettsean

@beckettsean In my case, almost all of write query took no more than 1s, and there were no huge write at that time also, so I don't think it's really about actural write timeout. It seems Go procs or some other resources are occupied by other tasks which I don't know and InfluxDB has no resources to handle incoming queries, so queries are stuck just waiting on queue throwing timeout. So I don't think increasing timeout is a solution.

seyoonhan avatar Dec 16 '15 01:12 seyoonhan

@beckettsean Write query took no more than 10ms even in peak time.

seyoonhan avatar Dec 16 '15 09:12 seyoonhan

I am seeing the same issue on version 0.9.4. Database is only about 400 MB in size. About every 2s there are 5000 K writes to the DB. Every 20 (or so) seconds, fairly small amount (about 20-30) queries are issued. They look like this:

SELECT * FROM "db"."ret_policy".Streams GROUP BY type, stream ORDER BY time DESC LIMIT 1

When writes reach 5s threshold, influxdb becomes unresponsive, sends 500 responses, and doesn't recover even if the writes are no longer issued.

karinator avatar Jan 11 '16 15:01 karinator

This was an issue w/ the b1 and bz1 storage engines. Those engines have been replaced by the tsm engine in 0.10.

jwilder avatar Mar 21 '16 16:03 jwilder