mirror of
https://github.com/jiangwenyuan/nuster.git
synced 2025-10-09 15:23:55 +02:00
Page:
Getting Started
Pages
Basic Config
Getting Started
Home
Performance
Use nuster As HTTP Cache Server
Use nuster As HTTP.HTTPS Loader Balancer
Use nuster As RESTful NoSQL Cache Server
Use nuster As TCP Loader Balancer
Web cache server HTTP 2 performance benchmark: nuster vs nginx
Web cache server performance benchmark: nuster vs nginx vs varnish vs squid
Web cache server performance benchmark: nuster vs squid
nuster Cache
nuster NoSQL
No results
2
Getting Started
Jiang Wenyuan edited this page 2020-04-21 21:38:01 +09:00
Table of Contents
Download
Download stable version from Download page for production use, otherwise git clone the source code.
Build
make TARGET=linux-glibc USE_LUA=1 LUA_INC=/usr/include/lua5.3 USE_OPENSSL=1 USE_PCRE=1 USE_ZLIB=1
make install PREFIX=/usr/local/nuster
use
USE_PTHREAD_PSHARED=1
to use pthread lib
omit
USE_LUA=1 LUA_INC=/usr/include/lua5.3 USE_OPENSSL=1 USE_PCRE=1 USE_ZLIB=1
if unnecessary
See HAProxy README for details.
Create config file
A minimal config file: nuster.cfg
global
nuster cache on data-size 100m
nuster nosql on data-size 200m
master-worker
defaults
mode http
frontend fe
bind *:8080
#bind *:4433 ssl crt example.com.pem alpn h2,http/1.1
use_backend be2 if { path_beg /_kv/ }
default_backend be1
backend be1
nuster cache on
nuster rule img ttl 1d if { path_beg /img/ }
nuster rule api ttl 30s if { path /api/some/api }
server s1 127.0.0.1:8081
server s2 127.0.0.1:8082
backend be2
nuster nosql on
nuster rule r1 ttl 3600
nuster listens on port 8080 and accepts HTTP requests.
Requests start with /_kv/
go to backend be2
, you can make POST/GET/DELETE
requests to /_kv/any_key
to set/get/delete
K/V object.
Other requests go to backend be1
, and will be passed to servers s1
or s2
. Among those requests, /img/*
will be cached for 1 day and /api/some/api
will be cached for 30 seconds.
Start
/usr/local/nuster/sbin/nuster -f nuster.cfg
Docker
docker pull nuster/nuster
docker run -d -v /path/to/nuster.cfg:/etc/nuster/nuster.cfg:ro -p 8080:8080 nuster/nuster
- nuster wiki
- Documentation
- nuster Cache
- nuster NoSQL
- Performance Benchmark
- Web cache server HTTP/2: nuster vs nginx
- Web cache server: nuster vs nginx vs varnish
- Web cache server: nuster vs squid