Why mallocgc wasted a lot of time


why mallocgc wasted a lot of time,my alpha deploy at AWS m5.large instance(2vcpu & 8GB),my alpha config like this

idx: 1
lru_mb: 2800
my: 172.30.22.204:7087
zero: 172.30.23.193:5086
port_offset: 7
postings: /home/work/dgraph_alpha/data/server/p1
wal: /home/work/dgraph_alpha/data/server/w1

It is allocating memory for the posting list unmarshal.

Is that correct?I`m doinig a benchmark for Dgraph, my cluster consists of 3alpha and 3zero, alpha deploy in AWS m5.large instance, zero deploy in AWS t3.medium instance, my test request include 1 query and 2 mutate. My cluster just have 40qps throughput, benchmark result like this

1. wrk parameters: wrk2 -t5 -c20 -R40 -d2m

  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   363.30ms  196.14ms   1.43s    73.15%
    Req/Sec    19.42      4.29    31.00     77.21%
  Latency Distribution (HdrHistogram - Recorded Latency)
 50.000%  329.73ms
 75.000%  453.38ms
 90.000%  606.21ms
 99.000%    1.06s 
 99.900%    1.24s 
 99.990%    1.44s 
 99.999%    1.44s 
100.000%    1.44s 
#[Mean    =      363.302, StdDeviation   =      196.141]
#[Max     =     1434.624, Total count    =         4384]
#[Buckets =           27, SubBuckets     =         2048]
----------------------------------------------------------
  4785 requests in 2.00m, 1.38MB read
Requests/sec:     39.86
Transfer/sec:     11.79KB

alpha   cpu  %48 iops 366
zero     cpu  %34 iops 244

2. wrk parameters: wrk2 -t5 -c40 -R80 -d2m
50.000%  973.82ms
 75.000%    1.11s 
 90.000%    1.26s 
 99.000%    1.54s 
 99.900%    1.70s 
 99.990%    1.85s 
 99.999%    1.85s 
100.000%    1.85s 
#[Mean    =      978.974, StdDeviation   =      217.198]
#[Max     =     1853.440, Total count    =         4508]
#[Buckets =           27, SubBuckets     =         2048]
----------------------------------------------------------
  4973 requests in 2.00m, 1.44MB read
Requests/sec:     41.42
Transfer/sec:     12.26KB
alpha   cpu  46%  iops  277
zero     cpu  46%  iops 156