nats-streaming-server icon indicating copy to clipboard operation
nats-streaming-server copied to clipboard

NATS Streaming startup takes time

Open Kazylla opened this issue 5 years ago • 9 comments

Hi

I am trying to configure NATS Streaming cluster. After sending 400k msg/sec for 30 minutes to 3 nodes and restarting NATS Streaming, it took about 30 minutes to start up. During startup, read access to data volume /data was performed at approximately 2.5k op/sec. I trace the process and found that the following calls in server/raft_log.go: decodeRaftLog is repeating.

err := dec.Decode(log)
  • Is there a way to reduce the time taken for this process?
  • Is there an alternative?

my conf for one of the nodes is:

listen: 0.0.0.0:4222
http: 8222

# Authorization for client connections
authorization {
  user: "xxx"
  password: "xxx"
  timeout: 0
}

# Cluster definition
cluster {
  listen: 0.0.0.0:5222

  authorization {
    user: "xxx"
    password: "xxx"
    timeout: 0
  }

  routes = [
    "nats-route://xxx:xxx@queue01:5222"
    "nats-route://xxx:xxx@queue02:5222"
    "nats-route://xxx:xxx@queue03:5222"
  ]
}

# logging options
debug: false
trace: false
logtime: true
log_file: ""

# Some system overides
max_connections: 0
max_control_line: 0
max_payload: 0

# Duration the server can block on a socket write to a client.  Exceeding the
# deadline will designate a client as a slow consumer.
write_deadline: "2s"

# NATS Streaming specific configuration
streaming {
  id: "xxx"
  store: "file"
  dir: "/data/stan/store"
  sd: false
  sv: false

  cluster {
    node_id: "queue01"

    peers: [
      "queue01"
      "queue02"
      "queue03"
    ]
  }

  file_options: {
    compact: false
  }
}

Sorry, I'm not good at English

Kazylla avatar Apr 11 '19 02:04 Kazylla