javascript - 10 million puts failing in LevelDB -
i got started leveldb , wondering if answer few questions me. running on centos vm 8 gb ram, 20 gb storage, 2 cores, , intel i7 processor. don't know if matters.
i wanted test performance of leveldb attempted 10 million puts sequentially, (not in batch) , not able to, got out of memory error. when did top, saw node using 25% of available memory. doing wrong?
here code:
var level = require('level'); var db = level('test.db' { valueencoding: 'json' }); (i = 0; <= 10000000; i++) { var value = { 'value': }; db.put(i.tostring(), value); }
when failed, tried 1 million puts happened in 2-3 seconds without problems. upped 3.5 million , got out of memory error after 40 mins of waiting. noticed code manages go through of puts makes bunch of *.ldb
files in test.db
, continues make them until run out of memory.
could maybe explain me whats going on?
Comments
Post a Comment