Coder Social home page Coder Social logo

cachectl's Introduction

cachectl

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

Dependency

posix_fadvise is required.

Build

make gom
make bundle
make

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 0 unit is second
filter string filtering pattern string for target file path .* regular expression with golang's regexp package
rate float rate of puring page cache for file 1.0 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

License

Copyright 2014-2015 Tatsuhiko Kubo

Licensed under the MIT License.

cachectl's People

Contributors

cubicdaiya avatar

Watchers

James Cloos 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.