Giter VIP home page Giter VIP logo

Comments (1)

BG2BKK avatar BG2BKK commented on July 17, 2024

你好,ngx_lua的cache有多种,ngx_shared_dict、srcache等等,这个项目里用到了ngx_shared_dict,是ngx_lua的一个模块,基于ngx shm实现,可以实现进程间共享,原子操作,十分高效;ngx_lua的任务同步机制,或者说缓存锁,有两种实现方式,一种是lua-resty-lock,基于ngx_shared_dict实现,进程间共享,该repo的README中提到了经典用法;另一种是新版本ngx_lua中的semaphore,基于luajit的ffi实现,在worker内的级别实现锁机制。

具体到本项目,cache模块缓存的是运行时信息和用户特征对应的分流结果,有缓存失效机制,确保lua代码实时拉取运行时信息;缓存失效时有同步机制,目前采用的是semaphore方式,减轻对后端redis的压力。

from abtestinggateway.

Related Issues (20)

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.