nck-2 / test-rep

0 stars 0 forks source link

Manticore requires more RAM and disk iops for the same performance as Elasticsearch #1363

Open githubmanticore opened 1 year ago

githubmanticore commented 1 year ago

The following shows that in some cases Manticore requires more RAM than Elasticsearch to provide the same performance. The task is to figure out what we can do to optimize it.

The test is currently deployed in /home/snikolaev/docker_repo/hn on our dev. server.

How to reproduce anywhere:

#    mem_limit: 1600m   
#    memswap_limit: 1600m   
#      - "ES_JAVA_OPTS=-Xms94m -Xmx94m"   
[root@sehs01 ~]# curl -s -XGET "http://localhost:9200/full/_stats?pretty"|grep count|head -1   
        "count" : 206998,   

to stop increasing (at 11654351)

curl -XPOST "http://localhost:9200/full/_close"   
curl -XPUT "http://localhost:9200/full/_settings" -H 'Content-Type: application/json' -d '{   
    "index" : {   
         "queries.cache.enabled" : false   
    }   
}'   
curl -XPOST "http://localhost:9200/full/_open"   
-    ports:   
-      - "9315:9314"   
     ports:   
       - "9415:9314"   

In this case update the port in test_manticore.sh as well.

[root@sehs01 hn]# ./test_manticore.sh   
Tue Dec 25 00:20:29 EST 2018   
evicting cached index files   
           Files: 13   
     Directories: 1   
   Evicted Pages: 1195149 (4G)   
         Elapsed: 0.002796 seconds   
-- limits:   
            "Memory": 4194304000,   
            "KernelMemory": 0,   
            "MemoryReservation": 0,   
            "MemorySwap": 4194304000,   
            "MemorySwappiness": 0,   
-- stats before test:   
CONTAINER ID        NAME                CPU %               MEM USAGE / LIMIT   MEM %               NET I/O             BLOCK I/O           PIDS   
984303d33b2b        manticore           0.77%               374MiB / 3.906GiB   9.35%               2.46MB / 4.59MB     4.68GB / 8.19kB     55   
cache 4812800   
rss 383868928   
total_cache 4812800   
total_rss 383868928   
           Files: 13   
     Directories: 1   
  Resident Pages: 12926/1195149  50M/4G  1.08%   
         Elapsed: 0.032806 seconds   
-- test:   
........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................   
real0m55.574s   
user0m2.262s   
sys0m1.529s   
-- stats after test:   
CONTAINER ID        NAME                CPU %               MEM USAGE / LIMIT     MEM %               NET I/O             BLOCK I/O           PIDS   
984303d33b2b        manticore           0.72%               379.9MiB / 3.906GiB   9.50%               3.27MB / 6.13MB     9.33GB / 8.19kB     55   
cache 2329702400   
rss 383938560   
total_cache 2329702400   
total_rss 383938560   
Total 0   
           Files: 13   
     Directories: 1   
  Resident Pages: 580631/1195149  2G/4G  48.6%   
         Elapsed: 0.11281 seconds   
-- stats before test:   
CONTAINER ID        NAME                CPU %               MEM USAGE / LIMIT     MEM %               NET I/O             BLOCK I/O           PIDS   
984303d33b2b        manticore           0.76%               379.8MiB / 3.906GiB   9.50%               3.27MB / 6.13MB     9.33GB / 8.19kB     55   
cache 2329702400   
rss 383938560   
total_cache 2329702400   
total_rss 383938560   
           Files: 13   
     Directories: 1   
  Resident Pages: 580631/1195149  2G/4G  48.6%   
         Elapsed: 0.11327 seconds   
-- test:   
........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................   
real0m47.390s   
user0m2.273s   
sys0m1.610s   
-- stats after test:   
CONTAINER ID        NAME                CPU %               MEM USAGE / LIMIT     MEM %               NET I/O             BLOCK I/O           PIDS   
984303d33b2b        manticore           0.80%               379.8MiB / 3.906GiB   9.49%               4.09MB / 7.66MB     9.33GB / 8.19kB     55   
cache 2329702400   
rss 383991808   
total_cache 2329702400   
total_rss 383991808   
Total 0   
           Files: 13   
     Directories: 1   
  Resident Pages: 580631/1195149  2G/4G  48.6%   
         Elapsed: 0.09545 seconds   
-- stats before test:   
CONTAINER ID        NAME                CPU %               MEM USAGE / LIMIT     MEM %               NET I/O             BLOCK I/O           PIDS   
984303d33b2b        manticore           0.75%               379.8MiB / 3.906GiB   9.49%               4.09MB / 7.66MB     9.33GB / 8.19kB     55   
cache 2329702400   
rss 383991808   
total_cache 2329702400   
total_rss 383991808   
           Files: 13   
     Directories: 1   
  Resident Pages: 580631/1195149  2G/4G  48.6%   
         Elapsed: 0.095387 seconds   
-- test:   
........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................   
real0m47.133s   
user0m2.264s   
sys0m1.593s   
-- stats after test:   
CONTAINER ID        NAME                CPU %               MEM USAGE / LIMIT     MEM %               NET I/O             BLOCK I/O           PIDS   
984303d33b2b        manticore           0.84%               379.8MiB / 3.906GiB   9.49%               4.91MB / 9.19MB     9.33GB / 8.19kB     55   
cache 2329702400   
rss 383909888   
total_cache 2329702400   
total_rss 383909888   
Total 0   
           Files: 13   
     Directories: 1   
  Resident Pages: 580631/1195149  2G/4G  48.6%   
         Elapsed: 0.097005 seconds   
-------------------------   

What I see is:

Information about Lucene index format can be found here:

githubmanticore commented 1 year ago

➤ Sergey Nikolaev commented:

Tested the version which does mmap for .spd/.spp:

A little bit strange that the first run is faster than 2nd and 3rd.

So in both cases better than w/o mmap, but unfortunately mmap can't solve the main problem of this test. Under the memory constraint elastic is still more optimal.