sajesemuy
V2EX  ›  分享创造

高性能缓存服务器 nuster v3.0.0.19 发布,支持硬盘持久化

By sajesemuy at 2019 年 7 月 31 日 · 2710 次点击

nuster 是一个基于 HAProxy 的高性能 HTTP 缓存服务器和 RESTful NoSQL 缓存服务器,既可以用作类似 Varnish 或者 Nginx 那样的 HTTP 缓存服务器,来缓存动态或者静态的 HTTP 资源,也可以用作 RESTful NoSQL 缓存服务器, 用 HTTP POST/GET/DELETE 来 添加 /取得 /删除 Key/Value。

https://github.com/jiangwenyuan/nuster

本次更新主要添加对硬盘持久化的支持

支持四种持久模式

  • off: 默认模式,仅保存在内存
  • only: 不保存在内存,仅保存在硬盘
  • sync: 保存到内存和硬盘后返回给客户端
  • async: 保存到内存后立即换回给客户的,内存数据会由 master 进程在一定时间后保存至硬盘

比如

global
    master-worker
    nuster cache on data-size 10m dir /tmp/cache
    nuster nosql on data-size 10m dir /tmp/nosql
backend be
    nuster cache on
    nuster rule off   disk off   ttl 1m if { path_beg /disk-off }
    nuster rule only  disk only  ttl 1d if { path_beg /disk-only }
    nuster rule sync  disk sync  ttl 1h if { path_beg /disk-sync }
    nuster rule async disk async ttl 2h if { path_beg /disk-async }
    nuster rule others ttl 100
  1. /disk-off 仅保存在内存
  2. /disk-only 仅保存在硬盘
  3. /disk-sync 保存至内存和硬盘后返回给客户端
  4. /disk-async 保存至内存后立即换回给客户端,内存数据会在一定时间后被缓存至硬盘
  5. 其他的所有请求都仅保存在内存
2 条回复  •  2019-08-03 18:48:30 +08:00
nvioue
   1
nvioue  
   2019 年 8 月 1 日
存储用的什么实现?
sajesemuy
   2
sajesemuy  
OP
   2019 年 8 月 3 日
@nvioue file
爱意满满的作品展示区。
© 2026 V2EX · 25ms · 3.9.8.5