Git Product home page Git Product logo

mem_hash's Introduction

hash冲突解决方式:

多阶hash,可以hash bucket_time次,如果都冲突了,操作失败。

文件结构检查:

1、检查barrier
2、检查head,通过crc32检查head_info重要区域(该文件结构的bucket_time、bucket_len、max_block)
3、检查node zone.通过对非0 key的node节点与其对应的block节点进行crc32完整性检查,判断数据是否是完整的。

内存映射机制:

采用mmap对文件映射到内存中,并采用mlock进行锁定

内存落地机制:

1、落地依赖于操作系统msync机制
2、业务侧可以调用MemSync进行同步或者异步的落地(建议采用异步落地)
3、初始化时,可以设定多少次数据写入时,程序自动调用MemSync进行异步的落地(设为0时,取消自动调用MemSync)

数据过期机制:

node节点记录数据最新修改时间,在初始化的时候,业务自定义数据过期时间,请求到达时根据当前时间判断数据是否过期(设为0时,取消数据过期机制)

性能数据

msync频率: 0 依赖操作系统落地

[数据库大小]\[MS_ASYNC msync频率] 0 1 100 1000 10000
512B 76923 3333 5524 26315 66666
768B 62500 3289 5434 24390 55555
1024B 55555 3278 5376 21739 50000
1280B 76923 3076 5291 22222 45454
5120B 18518 2923 4484 12820 18181
5376B 18181 2915 4366 12500 17241

mem_hash's People

Contributors

zfengzhen avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.