Code Monkey home page Code Monkey logo

pike's Introduction

pike

Build Status

与varnish类似的HTTP缓存服务器,主要的特性如下:

  • 提供WEB的管理配置界面,简单易上手
  • 支持br与gzip两种压缩方式,根据客户端自动选择。对于可缓存与不可缓存请求使用不同的压缩配置,更佳的时间与空间的平衡
  • 仅基于Cache-Control生成缓存有效期,接口缓存完全由接口开发者决定,准确而高效(开发比运维更清楚接口是否可缓存,可缓存时长)
  • 配置支持文件与etcd两种形式存储,无中断的配置实时更新
  • 支持H2C的转发,提升与后端服务的调用性能(如果是内网转发,不需要启用)
  • 与upstream的调用支持gzipbrotlilz4snappy以及zstd压缩,可根据与upstream的网络线路选择合适的压缩方式
  • 支持upstream检测失败时回调告警,可及时获取异常upstream信息
  • 支持自定义日志,可配置按日期与大小分割日志并压缩
  • LUR与持久化存储(可选)配合使用,可根据内存使用选择更小的LRU缓存并增加持久化存储的方式
  • 持久化存储支持以下形式:badger(文件)、redis以及mongodb

启动方式

启动参数主要如下:

  • config 配置保存地址,可以指定为etcd或者本地文件,如:etcd://user:[email protected]:2379/pike,本地文件:/opt/pike/config.yml
  • admin 配置管理后台的访问地址,如:--admin=:9013
  • log 日志文件目录,支持单文件与lumberjack形式,如/var/pike.loglumberjack:///tmp/pike.log?maxSize=100&maxAge=1&compress=true,lumberjack会根据文件内容大小与时间将文件分割

使用文件保存配置

# linux etcd,管理后台使用9013端口访问
./pike --config=etcd://127.0.0.1:2379/pike --admin=:9013
# linux file,配置文件保存在/opt/pike.yml,管理后台使用9013端口访问
./pike --config=/opt/pike.yml --admin=:9013

# docker
docker run -it --rm \
    -p 9013:9013 \
    vicanso/pike:4.0.0-alpha --config=etcd://172.16.183.177:2379/pike --admin=:9013

TODO

  • 缓存查询(如果缓存量较大,有可能导致查询性能较差,暂时未支持)

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.