Jira (PUP-8014) Create an environment_ttl setting to clear short-lived puppet environments from memory

28 views
Skip to first unread message

Garrett Guillotte (JIRA)

unread,
Oct 6, 2017, 6:31:03 PM10/6/17
to puppe...@googlegroups.com
Garrett Guillotte updated an issue
 
Puppet / Improvement PUP-8014
Create an environment_ttl setting to clear short-lived puppet environments from memory
Change By: Garrett Guillotte
Summary: Create an  evironment_ttl  environment_ttl  setting to clear short-lived puppet environments from memory
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe)
Atlassian logo

Josh Cooper (JIRA)

unread,
Nov 6, 2017, 7:55:05 PM11/6/17
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Team: Platform Core
This message was sent by Atlassian JIRA (v7.0.2#70111-sha1:88534db)
Atlassian logo

Nick Walker (JIRA)

unread,
Sep 21, 2018, 11:53:08 AM9/21/18
to puppe...@googlegroups.com
Nick Walker updated an issue
Change By: Nick Walker
Priority: Normal Major
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Josh Cooper (Jira)

unread,
Apr 29, 2020, 4:46:03 PM4/29/20
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Team: Coremunity Froyo
This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo

Melissa Stone (Jira)

unread,
Apr 29, 2020, 4:51:03 PM4/29/20
to puppe...@googlegroups.com
Melissa Stone commented on Improvement PUP-8014
 
Re: Create an environment_ttl setting to clear short-lived puppet environments from memory

Nick Walker  it sounds like you want per-environment control? Is what you're proposing in this ticket still a direction you want to go in?

Nick Walker (Jira)

unread,
Apr 29, 2020, 8:53:04 PM4/29/20
to puppe...@googlegroups.com
Nick Walker commented on Improvement PUP-8014

Melissa Stone this should be a global setting IMO ( stated in the last sentence of "the solution").  Everything in the ticket still looks correct in today's world.  

Molly Waggett (Jira)

unread,
May 5, 2020, 5:35:03 PM5/5/20
to puppe...@googlegroups.com
Molly Waggett commented on Improvement PUP-8014

off the top of my head, I think the only difference with versioned-deploys would be that we'd presumably want to clean up all versions of an environment. But even then, any leftover dirs should get cleaned up by the versioned-dirs-ttl.

Nick Walker (Jira)

unread,
May 22, 2020, 1:41:03 PM5/22/20
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Jun 8, 2020, 12:37:04 PM6/8/20
to puppe...@googlegroups.com

Maggie Dreyer (Jira)

unread,
Aug 14, 2020, 2:12:03 PM8/14/20
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Aug 20, 2020, 8:57:03 PM8/20/20
to puppe...@googlegroups.com
Josh Cooper commented on Improvement PUP-8014
 
Re: Create an environment_ttl setting to clear short-lived puppet environments from memory

I think the easiest approach would be to define an environment_ttl setting in puppet and a new type of cache entry (https://github.com/puppetlabs/puppet/blob/ec8bcbd5287ccdd67ff06618bb2d0d568a3f2328/lib/puppet/environments.rb#L437-L447) that keeps track of when the environment was last accessed. In order to eagerly evict environments, we could use Concurrent::TimerTask to evict expired environments. We'd also need to remove the environment_timeout setting at the same time.

I think it would be difficult to implement this in puppetserver, because we still need to support the "never cache" vs "cache if unused after" use cases, where "never cache" would still be the default.

 

Josh Cooper (Jira)

unread,
Sep 16, 2020, 6:04:04 PM9/16/20
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Sep 16, 2020, 6:05:04 PM9/16/20
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Sep 17, 2020, 7:51:04 PM9/17/20
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Oct 5, 2020, 2:57:04 PM10/5/20
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Fix Version/s: PUP 6.19.0
Fix Version/s: PUP 7.0.0

Josh Cooper (Jira)

unread,
Oct 9, 2020, 12:39:04 PM10/9/20
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Oct 9, 2020, 12:48:04 PM10/9/20
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Release Notes: New Feature
Release Notes Summary: Adds a new setting `environment_ttl` which is controls the environment cache like the `environment_timeout` setting. However, `environment_ttl` will evict environments from the cache if they haven't been recently used to compile a catalog within the last `environment_ttl` seconds. This is different from the `environment_timeout` setting which will evict environments at a specific time, regardless of whether the environment has been recently used or not.

For the `environment_ttl` setting, a value of `0` will disable caching. This setting can also be set to`unlimited`, which will cache environments until the server is restarted or told to refresh the cache. All other values will result in Puppet server evicting environments that have not been accessed within that ttl.

You should change this setting once your Puppet deployment is doing non-trivial work. We chose the default value of `0` because it lets new users update their code without any extra steps, but it lowers the performance of your Puppet server.

We recommend setting this to a number that will keep your most actively used environments cached, but allow testing environments to fall out of the cache and reduce memory usage. A value of 3 minutes (3m) is a reasonable value.

Once you set `environment_ttl` to a non-zero value, you need to tell Puppet server to read new code from disk using the `environment-cache` API endpoint after you deploy new code. See the docs for the Puppet Server [administrative API](https://puppet.com/docs/puppetserver/latest/admin-api/v1/environment-cache.html).

If the `environment_ttl` setting is explicitly configured in `puppet.conf` then it will override whatever global `environment_timeout` is set in `puppet.conf` and any per-environment `environment_timeout` set in `$codedir/environments/<environment>/environment.conf`.

Claire Cadman (Jira)

unread,
Oct 12, 2020, 9:23:02 AM10/12/20
to puppe...@googlegroups.com

Claire Cadman (Jira)

unread,
Oct 12, 2020, 9:23:02 AM10/12/20
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Oct 12, 2020, 2:34:04 PM10/12/20
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Oct 13, 2020, 12:33:03 PM10/13/20
to puppe...@googlegroups.com
Josh Cooper commented on Improvement PUP-8014

Reopening this issue as we don't want to ship with environment_ttl. PR incoming.

Reply all
Reply to author
Forward
0 new messages