Giter Club home page Giter Club logo

bolt's Introduction

Bolt

Bolt - The Realtime Image Compress System


介绍

    Bolt是一个实时裁剪压缩图片服务器,其比nginx的image_filter快2倍以上,主要是因为Bolt对一张图片只做一次处理,就算在处理图片的过程中,其他的客户端也在请求此图片,Bolt也能保证只有一个线程在处理此图片。

    另外Bolt替换缓存机制,处理过的图片不再进行第二次处理,除非内存不足的时候,Bolt才会处理LRU算法来删除缓存中的图片,在启动Bolt的时候可以使用“--max-cache”启动参数来设置最大内存限制。Bolt使用LRU算法来淘汰缓存的图片,也就是说一般只会淘汰较少访问的图片,这就可以很好的限制Bolt的内存使用。

用在哪里

Bolt可以用在内存和CPU都过剩的服务器,另外使用Bolt可以减少磁盘的使用,加快图片的加载速度。

安装

$ git clone https://github.com/liexusong/bolt
$ cd bolt
$ make

使用方式

访问URL:http://your-host/filename_(width)x(height)_(quality).jpg

Bolt启动项说明

  • --host 设置绑定的IP
  • --port 设置监听的端口
  • --workers 启动多少个worker线程(用于裁剪图片)
  • --logfile 日志文件输出的路径
  • --logmark 日志要显示的级别,可以选择(DEBUG|NOTICE|ALERT|ERROR)
  • --max-cache 设置Bolt可以使用的最大内存(单位为字节)
  • --gc-threshold GC要清理的阀值(也就是说GC会清理到max-cache的百分之多少停止,可选值为0 ~ 99)
  • --path 要进行裁剪的图片源路径
  • --watermark 水印图片路径
  • --daemon 是否启动守护进程模式
  • --help 显示帮助信息
如果各位发现bug,请向本人提出,本人深深感谢。如果希望提供什么样的新功能也可以提出。

bolt's People

Contributors

liexusong avatar

Watchers

James Cloos avatar yiliaofan avatar

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.