当前位置:网站首页>Openresty Lua resty mlcache multi-level cache
Openresty Lua resty mlcache multi-level cache
2022-07-25 19:19:00 【o_ Guatian Lixia_ o】
openresty lua-resty-mlcache Multi level cache
Official website :https://github.com/thibaultcha/lua-resty-mlcache
Multi level cache

First level cache : Use lrucache Store the most commonly used data , Every worker Use a single memory
Second level cache : Use lua_shared_dict Store shared data , When the L1 cache misses , Read data from L2 cache
Three level cache : One 、 L2 cache miss , Just read data from the back end ( Use lock Lock , Avoid a large number of requests accessing at the same time ), And store the data in the L2 cache , And others worker share
Create cache instance
new: Create cache instance
Grammar format :cache, err = mlcache.new(name, shm, opts?)
* Create cache instance , If the creation fails , return nil、 error message
* name: The name of the cache instance , If different cache instances name identical , Then data sharing
* shm:lua_shared_dict Shared cache name , If different mlcache Of shm identical , Then data sharing
* opts: Optional parameters
* lru_size: L1 cache size , Default 100
* ttl: Cache expiration time , The unit is in seconds , Set to 0 Never expire , Default 30
* neg_ttl: When the L3 cache returns nil when , Cache expiration time , The unit is in seconds , Set to 0 Never expire , Default 5
* resurrect_ttl: When 3 Level cache return nil, Extend expiration cache time , The unit is in seconds 边栏推荐
- [Detr for 3D object detection] 3detr: an end to end transformer model for 3D object detection
- 2022 IAA industry category development insight series report - phase II
- 乐理基础 调式
- Hongmeng - Damiao computing Sketchpad - VIDEO
- Common development software download addresses
- How to change the chords after the tune of the song is changed
- The difference between PHP equal to = = and identity equal to = = =
- 房地产行业大洗牌
- Youth, oh, youth
- Gan, why ".Length! == 3??
猜你喜欢

小程序毕设作品之微信校园维修报修小程序毕业设计成品(5)任务书
![[iniparser] simple use of the project configuration tool iniparser](/img/2b/1d20b4ef44dfe2544891d9c72b676e.png)
[iniparser] simple use of the project configuration tool iniparser

帝国CMS整站|手机号/QQ靓号商城源码|适配移动端

The degree of interval of basic music theory

Fruit chain "siege": it's a journey of sweetness and bitterness next to apples

微信小程序 27 进度条的动态实现和搜索框、热搜榜的静态搭建

2022 IAA industry category development insight series report - phase II

The finished product of wechat campus maintenance and repair applet graduation design (1) development outline

鸿蒙-大喵计算画板-简介

网上商城系统MySql数据库设计项目实战
随机推荐
Imeta | sangerbox: interactive integrated clinical information analysis platform
阿里云免费SSL证书申请详细流程
Pymoo学习 (6):终止条件
leetcode刷题:动态规划07(不同的二叉搜索树)
Small program completion work wechat campus maintenance application small program graduation design finished product (2) small program function
How to prohibit the use of 360 browser (how to disable the built-in browser)
歌曲转调之后和弦如何转换
Fearless of high temperature and rainstorm, how can Youfu network protect you from worry?
SQL Server 2019 安装教程
Improvement of wechat applet 29 hot search list ②
一个函数中写多少行代码比较合适呢? 代码整洁之道
[Detr for 3D object detection] detr3d: 3D object detection from multi view images via 3D-to-2D queries
小程序毕设作品之微信校园维修报修小程序毕业设计成品(2)小程序功能
How to design product help center? The following points cannot be ignored
平衡二叉树
In the first half of the year, the shipment volume has exceeded that of the whole year of last year, and centritec millimeter wave radar has "captured" the international giant
Improvement of wechat applet 28 hot search list ①
新瓶装老酒--近期APT32(海莲花)组织攻击活动样本分析
600000 pieces of data are made from March 1 to March 31. Videodate requires starting time from 00:00 to 24:00 on March 1 to 31, which is only for notes
[encryption weekly] has the encryption market recovered? The cold winter has not thawed yet! Check the major events in the encryption market last week!