dgraph icon indicating copy to clipboard operation
dgraph copied to clipboard

Memory consumption on one server high causing low memory condition

Open awmanoj opened this issue 8 years ago • 2 comments

If you suspect this could be a bug, follow the template.

  • What version of Dgraph are you using?
Dgraph version   : v1.0.4
Commit SHA-1     : aad59072
Commit timestamp : 2018-03-09 17:37:44 +1100
Branch           : HEAD
  • Have you tried reproducing the issue with latest release? No

  • What is the hardware spec (RAM, OS)? ubuntu 14.04 / 8 core 32GB

  • Steps to reproduce the issue (command/config used to run Dgraph).

Seeing this log on one of the server logs.

2018/04/13 20:10:16 predicate.go:51: Getting SNAPSHOT: Time elapsed: 22m55s, bytes written: 1.1 GB
2018/04/13 20:10:21 predicate.go:51: Getting SNAPSHOT: Time elapsed: 23m00s, bytes written: 1.1 GB
2018/04/13 20:10:26 predicate.go:51: Getting SNAPSHOT: Time elapsed: 23m05s, bytes written: 1.1 GB
2018/04/13 20:10:31 predicate.go:51: Getting SNAPSHOT: Time elapsed: 23m10s, bytes written: 1.1 GB
2018/04/13 20:10:36 predicate.go:51: Getting SNAPSHOT: Time elapsed: 23m15s, bytes written: 1.2 GB
2018/04/13 20:10:41 predicate.go:51: Getting SNAPSHOT: Time elapsed: 23m20s, bytes written: 1.2 GB
2018/04/13 20:10:46 predicate.go:51: Getting SNAPSHOT: Time elapsed: 23m25s, bytes written: 1.2 GB
2018/04/13 20:10:51 predicate.go:51: Getting SNAPSHOT: Time elapsed: 23m30s, bytes written: 1.2 GB
2018/04/13 20:10:56 predicate.go:51: Getting SNAPSHOT: Time elapsed: 23m35s, bytes written: 1.2 GB
2018/04/13 20:11:01 predicate.go:51: Getting SNAPSHOT: Time elapsed: 23m40s, bytes written: 1.2 GB
2018/04/13 20:11:06 predicate.go:51: Getting SNAPSHOT: Time elapsed: 23m45s, bytes written: 1.2 GB
2018/04/13 20:11:11 predicate.go:51: Getting SNAPSHOT: Time elapsed: 23m50s, bytes written: 1.2 GB
2018/04/13 20:11:16 predicate.go:51: Getting SNAPSHOT: Time elapsed: 23m55s, bytes written: 1.2 GB
2018/04/13 20:11:21 predicate.go:51: Getting SNAPSHOT: Time elapsed: 24m00s, bytes written: 1.2 GB
2018/04/13 20:11:26 predicate.go:51: Getting SNAPSHOT: Time elapsed: 24m05s, bytes written: 1.2 GB
2018/04/13 20:11:31 predicate.go:51: Getting SNAPSHOT: Time elapsed: 24m10s, bytes written: 1.2 GB
2018/04/13 20:11:36 predicate.go:51: Getting SNAPSHOT: Time elapsed: 24m15s, bytes written: 1.2 GB
2018/04/13 20:11:41 predicate.go:51: Getting SNAPSHOT: Time elapsed: 24m20s, bytes written: 1.2 GB
2018/04/13 20:11:46 predicate.go:51: Getting SNAPSHOT: Time elapsed: 24m25s, bytes written: 1.2 GB
2018/04/13 20:11:51 predicate.go:51: Getting SNAPSHOT: Time elapsed: 24m30s, bytes written: 1.2 GB
2018/04/13 20:11:56 predicate.go:51: Getting SNAPSHOT: Time elapsed: 24m35s, bytes written: 1.2 GB
2018/04/13 20:12:01 predicate.go:51: Getting SNAPSHOT: Time elapsed: 24m40s, bytes written: 1.2 GB
2018/04/13 20:12:06 predicate.go:51: Getting SNAPSHOT: Time elapsed: 24m45s, bytes written: 1.2 GB
2018/04/13 20:12:11 predicate.go:51: Getting SNAPSHOT: Time elapsed: 24m50s, bytes written: 1.2 GB
2018/04/13 20:12:16 predicate.go:51: Getting SNAPSHOT: Time elapsed: 24m55s, bytes written: 1.2 GB
2018/04/13 20:12:21 predicate.go:51: Getting SNAPSHOT: Time elapsed: 25m00s, bytes written: 1.3 GB
2018/04/13 20:12:26 predicate.go:51: Getting SNAPSHOT: Time elapsed: 25m05s, bytes written: 1.3 GB
2018/04/13 20:12:31 predicate.go:51: Getting SNAPSHOT: Time elapsed: 25m10s, bytes written: 1.3 GB
2018/04/13 20:12:36 predicate.go:51: Getting SNAPSHOT: Time elapsed: 25m15s, bytes written: 1.3 GB
2018/04/13 20:12:41 predicate.go:51: Getting SNAPSHOT: Time elapsed: 25m20s, bytes written: 1.3 GB

We also observe that our free memory going down fast:

ma160314@dgraph-fraud-172-21-253-16:~$ free -m 
             total       used       free     shared    buffers     cached
Mem:         32174      27211       4963          0        330       8897
-/+ buffers/cache:      17983      14191
Swap:            0          0          0
ma160314@dgraph-fraud-172-21-253-16:~$ free -m 
             total       used       free     shared    buffers     cached
Mem:         32174      27213       4961          0        330       8899
-/+ buffers/cache:      17983      14191
Swap:            0          0          0
ma160314@dgraph-fraud-172-21-253-16:~$ free -m 
             total       used       free     shared    buffers     cached
Mem:         32174      27214       4960          0        330       8899
-/+ buffers/cache:      17984      14190
Swap:            0          0          0
ma160314@dgraph-fraud-172-21-253-16:~$ free -m 
             total       used       free     shared    buffers     cached
Mem:         32174      27216       4958          0        330       8901
-/+ buffers/cache:      17983      14191
Swap:            0          0          0
ma160314@dgraph-fraud-172-21-253-16:~$ free -m 
             total       used       free     shared    buffers     cached
Mem:         32174      27217       4957          0        330       8902
-/+ buffers/cache:      17983      14190
Swap:            0          0          0
ma160314@dgraph-fraud-172-21-253-16:~$ free -m 
             total       used       free     shared    buffers     cached
Mem:         32174      27225       4949          0        330       8910
-/+ buffers/cache:      17983      14190
Swap:            0          0          0
  PID %MEM   RSS    VSZ COMMAND
24414 47.4 15632240 34948984 dgraph
  • More details on the server

RAM: 32 GB

ma160314@dgraph-fraud-172-21-253-16:~$ free -m 
             total       used       free     shared    buffers     cached
Mem:         32174      31262        911          0        137       3438
-/+ buffers/cache:      27686       4488
Swap:            0          0          0

Dgraph config:

# Folder in which to store export.
export: export

# Fraction of dirty posting lists to commit every few seconds.
gentlecommit: 0.33 

# RAFT ID that this server will use to join RAFT groups.

# If RAM usage exceeds this, we stop the world, and flush our buffers.
memory_mb: 16087.0

# The ratio of queries to trace.
trace: 0.33

# Directory to store posting lists.
postings: /data/dgraph/p

# Directory to store raft write-ahead logs.
wal: /data/dgraph/w

# Debug mode for testing.
debugmode: False

bindall: True

my: "172.21.253.16:7080"

zero: "dgraphzero-fraud.service.consul:5080"
ma160314@dgraph-fraud-172-21-253-16:~$ sudo du -h /data/dgraph/p
7.8G	/data/dgraph/p

awmanoj avatar Apr 13 '18 13:04 awmanoj

@nyelonong

awmanoj avatar Apr 13 '18 13:04 awmanoj

Closing the ticket. These logs were observed when we restarted the servers. It will be great if there are any reference documentation to understand the architecture.

awmanoj avatar Apr 13 '18 13:04 awmanoj