librelist archives

« back to archive

Config Change for Dir Cache TTL

Config Change for Dir Cache TTL

From:
Zed A. Shaw
Date:
2011-04-27 @ 16:51
Hey Everyone,

There's been a *bunch* of changes flying out this last week, and just
recently we made a change that requires you to reconfig to run trunk.
After you fossil up and reinstall, do this to your config:

m2sh config

That'll update the schema and add the new option you get for
Dir.cache_ttl.  This is for when you do *not* want that directory to
cache a damn thing, like if you're updating the files under it rapidly
or externally.  You can also increase it to cache things for a very long
time.

You'll also see that latest drops of Mongrel2 are dynamically allocating
ram for the socket register.  At first your m2 instances will use less
ram, then they'll slowly increase as you get overloaded and stay there.
It's all planned, and I'll put some info in the control port so you can
check that mongrel2 is using the right amount of ram.

Let me know how trunk is working out for people.

-- 
Zed A. Shaw
http://zedshaw.com/

Re: [mongrel2] Config Change for Dir Cache TTL

From:
Matt Towers
Date:
2011-04-27 @ 16:53
Do you have any details handy on the config changes?

I'll need to update my code that is generating our config.sqlite as well.

✈ Matt



On Apr 27, 2011, at 09:51 , Zed A. Shaw wrote:

> Hey Everyone,
> 
> There's been a *bunch* of changes flying out this last week, and just
> recently we made a change that requires you to reconfig to run trunk.
> After you fossil up and reinstall, do this to your config:
> 
> m2sh config
> 
> That'll update the schema and add the new option you get for
> Dir.cache_ttl.  This is for when you do *not* want that directory to
> cache a damn thing, like if you're updating the files under it rapidly
> or externally.  You can also increase it to cache things for a very long
> time.
> 
> You'll also see that latest drops of Mongrel2 are dynamically allocating
> ram for the socket register.  At first your m2 instances will use less
> ram, then they'll slowly increase as you get overloaded and stay there.
> It's all planned, and I'll put some info in the control port so you can
> check that mongrel2 is using the right amount of ram.
> 
> Let me know how trunk is working out for people.
> 
> -- 
> Zed A. Shaw
> http://zedshaw.com/

Re: [mongrel2] Config Change for Dir Cache TTL

From:
Zed A. Shaw
Date:
2011-04-27 @ 21:49
On Wed, Apr 27, 2011 at 09:53:22AM -0700, Matt Towers wrote:
> Do you have any details handy on the config changes?
> 
> I'll need to update my code that is generating our config.sqlite as well.

Yep, there's a new column to the directory table that gives a cache_ttl:

CREATE TABLE directory (id INTEGER PRIMARY KEY,
    base TEXT,
    index_file TEXT,
    default_ctype TEXT,
    cache_ttl INTEGER DEFAULT 0);

What I'd do is keep track of what version you've got for the
src/config/config.sql, and then periodically diff each version to see
what changed.  For example, if your last version was a2a2a2a2 then when
you do a fossil up you'd do:

fossil diff -r a2a2a2a2 src/config/config.sql

And that'll spit out exactly what changed.  If you're clever you can
automate that for your product as a unit test of sorts.

-- 
Zed A. Shaw
http://zedshaw.com/

Re: [mongrel2] Config Change for Dir Cache TTL

From:
Dalton Barreto
Date:
2011-04-27 @ 17:07
2011/4/27 Matt Towers <matt@ziplinegames.com>:
> Do you have any details handy on the config changes?
> I'll need to update my code that is generating our config.sqlite as well.
>

Hello Matt,

This cache_ttl change adds one more field to the directory table. See
the patch here [1].


Since mongrel2-1.5, IIRC there was another change: The addition of the
field protocol to the handler table [2].

[1] http://mongrel2.org/fdiff?v1=24c6754415fc74ca&v2=9542ac04db4a30ab
[2] http://mongrel2.org/fdiff?v1=8b336c9099c4afed&v2=488cc1edbb9c44d0


-- 
Dalton Barreto
http://daltonmatos.wordpress.com
http://wsgid.com