All Projects → cubicdaiya → Cachectl

cubicdaiya / Cachectl

Licence: mit
Page cache controller for regular file in Go

Programming Languages

go
31211 projects - #10 most used programming language

Labels

Projects that are alternatives of or similar to Cachectl

Python Microjet
Python 3 asynchronous microservices framework powered by asyncio.
Stars: ✭ 11 (-88.42%)
Mutual labels:  daemon
Spm
A process manager similar to systemd and foreman with stop feature, written in Go.
Stars: ✭ 44 (-53.68%)
Mutual labels:  daemon
Pebble
Unofficial Pebble watch support for SailfishOS/Jolla
Stars: ✭ 71 (-25.26%)
Mutual labels:  daemon
Ipmonitor
IP Monitor is a simple application which monitors your public IP address for changes and lets you set different kinds of notifications such as email, audio, pop up or executing a command
Stars: ✭ 28 (-70.53%)
Mutual labels:  daemon
Processmanager
PHP Process Control tools
Stars: ✭ 43 (-54.74%)
Mutual labels:  daemon
Xsuspender
👀 💻 💤 🔋 Save battery by auto-suspending unfocused X11 applications.
Stars: ✭ 53 (-44.21%)
Mutual labels:  daemon
Auto Cpufreq
Automatic CPU speed & power optimizer for Linux
Stars: ✭ 843 (+787.37%)
Mutual labels:  daemon
Moolticute
Mooltipass crossplatform daemon/tools
Stars: ✭ 82 (-13.68%)
Mutual labels:  daemon
Eventd
A simple daemon to track remote or local events and do actions the user wants to
Stars: ✭ 43 (-54.74%)
Mutual labels:  daemon
Oragono
A modern IRC server (daemon/ircd) written in Go.
Stars: ✭ 1,171 (+1132.63%)
Mutual labels:  daemon
Leoric
PoC of fighting against force-stop kill process on Android
Stars: ✭ 946 (+895.79%)
Mutual labels:  daemon
Deluge
Deluge BitTorrent client - Git mirror, PRs only
Stars: ✭ 1,012 (+965.26%)
Mutual labels:  daemon
Bulwark Explorer
Block explorer for Bulwark Cryptocurrency
Stars: ✭ 57 (-40%)
Mutual labels:  daemon
Linkliar
🔗 Link-Layer MAC spoofing GUI for macOS
Stars: ✭ 885 (+831.58%)
Mutual labels:  daemon
Git Repo Watcher
A simple bash script to watch a git repository and pull upstream changes if needed.
Stars: ✭ 73 (-23.16%)
Mutual labels:  daemon
Temper Hum Hid
🌡 TemperHum HID query API in C
Stars: ✭ 10 (-89.47%)
Mutual labels:  daemon
Jiacrontab
简单可信赖的任务管理工具
Stars: ✭ 1,052 (+1007.37%)
Mutual labels:  daemon
Jd4
Judging daemon for programming contests
Stars: ✭ 85 (-10.53%)
Mutual labels:  daemon
Yubikeylockd
Simple daemon for locking and unlocking macOS with Yubikey
Stars: ✭ 78 (-17.89%)
Mutual labels:  daemon
Peerflix Server
Streaming torrent client for Node.js with web ui.
Stars: ✭ 1,157 (+1117.89%)
Mutual labels:  daemon

cachectl

cachectl is a controller for regular file's page cache.

Dependency

posix_fadvise is required.

Installation

go get -u github.com/cubicdaiya/cachectl/...

If you don't have go-runtime, you may download the binary from here.

Show page cache stat for file

cachectl -f /var/log/access_log

Purge page cache for file

cachectl -op purge -f /var/log/access_log

If you want to leave a cache appended recently, assigning a rate for purging page cache with -r is recommended.

cachectl -op purge -f /var/log/access_log -r 0.9

cachectld

cachectld is a daemon for scheduled purging page cache. Its behavior is described by TOML.

cachectld -c conf/cachectld.toml

Configuration for cachectld

A configuration for cachectld has one or multiple targets.

name type description default note
path string target file path directory or file path
purge_interval int interval for purging page cache for file 3600 unit is second. if -1 is set, purge does not run.
filter string filtering pattern string for target file path .* regular expression with golang's regexp package
rate float rate of purging page cache for file 0.0 0.0 and 1.0 is same behavior (0.0 <= rate <= 1.0)

A example is below.

[[targets]]
path = "/vagrant/cachectl.go"
purge_interval = 30

[[targets]]
path = "/vagrant/cachectld.go"
purge_interval = 20

[[targets]]
path = "/vagrant/cachectl"
purge_interval = 5
filter = "\\.go$"
rate = 0.9

Signal trigger

From v0.3.0, you can trigger with SIGUSR1 to run the targets for cachectld.

$ pkill -USR1 cachectld

When SIGUSR1 is received, cachectld runs all targets including the targets purge_interval is set -1.

License

Copyright 2014-2016 Tatsuhiko Kubo

Licensed under the MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].