Boost Image Delivery Speed with Bolt: A Fast Real-Time Image Resizing Server
Bolt is a high‑performance real‑time image cropping and compression server that processes each image only once, uses an LRU cache to limit memory, and offers flexible command‑line options for installation, usage, and scaling on CPU‑rich servers.
Bolt is a real‑time image cropping and compression server that processes each image only once, making it more than twice as fast as Nginx’s image_filter.
It uses a single‑threaded processing model per image, so concurrent requests for the same image do not trigger duplicate work.
Bolt replaces the cache mechanism: processed images are stored and not re‑processed unless memory is insufficient, at which point an LRU algorithm evicts rarely accessed images. The maximum memory can be set with the "--max-cache" startup parameter.
Use cases
Bolt is suitable for servers with abundant memory and CPU, and it reduces disk usage while accelerating image loading.
Installation
1) Install libevent (http://libevent.org/)
2) Install ImageMagick (http://www.imagemagick.org/script/index.php)
3) Install Bolt
$ git clone https://git.oschina.net/liexusong/bolt.git $ cd bolt $ make
Usage
Access images via URL pattern: http://your-host/filename_(width)x(height)_(quality).jpg
Bolt startup options
--host: set binding IP
--port: set listening port
--workers: number of worker threads for image processing
--logfile: path to log file
--logmark: log level (DEBUG|NOTICE|ALERT|ERROR)
--max-cache: maximum memory for Bolt (bytes)
--gc-threshold: GC threshold as a percentage of max-cache (0‑99)
--path: source image directory
--watermark: watermark image path
--daemon: run as daemon
--help: display help
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
21CTO
21CTO (21CTO.com) offers developers community, training, and services, making it your go‑to learning and service platform.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
