Best practices for deploying a high performance Berkeley DB system -


i looking use berkeley db create simple key-value storage system. keys sha-1 hashes, in 160-bit address space. have simple server working, easy enough written documentation berkeley db website. however, have questions how best set such system, performance , flexibility. hopefully, has had more experience berkeley db , can me.

the simplest setup single process, single thread, handling single db; inserts , gets performed on 1 db, using transactions.

alternative 1: single process, multiple threads, single db; inserts , gets performed on db, threads in process.

  • does using multiple threads provide performance improvements? there 1 single db, , therefore it's on 1 disk, , therefore guessing won't boost. if berkeley db caches lot of stuff in memory, perhaps 1 thread able run , answer cache while has blocked waiting disk? using gnu pth, user level cooperative threading. not familiar details of pth, not sure if pth can have userlevel thread run while userlevel thread has blocked.

alternative 2: single process, 1 or multiple threads, multiple dbs each db covers fraction of 160-bit address space keys.

  • i see few advantages in having multiple dbs: can put them on different disks, less contention, easier move/partition dbs onto different physical hosts if want that. have experience setup , see significant benefits?

alternative 3: multiple processes, each 1 thread, each handles db covers fraction of 160-bit address space keys.

  • this has advantages of using multiple dbs, using multiple processes. better second alternative? suspect using processes rather user-level threads parallelism better smp caching behaviors (less invalidates, etc), killed process overheads , context switches?

i love hear if has tried options, , have seen positive or negative results.

thanks.

alternative 2 gives high scalability. partition database across multiple servers. if need high performance distributed key/value database, suggest looking @ membase. doing right need run on appliance , limit dependencies (of membase). can use berkeleydb replication , have read copies servers serve read/get requests.


Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -