1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

nusterキャッシュ永続化

1
Posted at

NusterはHAProxyを元に開発したキャッシュサーバで、HAProxyと互換性がある。
そしてHAProxyのACLを利用して細かいキャッシュルールを定義できる。新しいリリースしたv3.0.0.19では永続化機能が追加されて、永続化について紹介したいと思います。

ホームページ
https://github.com/jiangwenyuan/nuster

ruleベースで4つの永続化モードが使えます。

nuster rule name [key KEY] [ttl TTL] [code CODE] [disk MODE] [if|unless condition]
  • off: デフォルト、メモリのみに保存する
  • only: メモリに保存せず、ディスクだけに保存する
  • sync: メモリとディスクに保存してからクライアントに返す
  • async: メモリに保存してクライアントに返す、後ほどmaster processによってディスクに保存される

例えば

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

/disk-off はメモリのみに保存される
/disk-only はディスクのみに保存される
/disk-sync はメモリとディスクに保存してからクライアントに返す
/disk-async はメモリに保存してクライアントに返す。後ほどmaster processによってディスクに保存される
ほかはメモリに保存される

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?