[
https://issues.apache.org/jira/browse/TC-32?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15767968#comment-15767968
]
ASF GitHub Bot commented on TC-32:
----------------------------------
Github user dg4prez commented on a diff in the pull request:
https://github.com/apache/incubator-trafficcontrol/pull/141#discussion_r93505948
--- Diff:
traffic_ops/app/db/migrations/20161216094845_add_scope_parameters.sql ---
@@ -0,0 +1,146 @@
+
+-- +goose Up
+-- SQL in section 'Up' is executed when this migration is applied
+INSERT INTO
+ PARAMETER (name, config_file, VALUE)
+ SELECT
+ 'scope',
+ config_file,
+ 'server'
+ FROM
+ PARAMETER
+ WHERE
+ name = 'location'
+ AND config_file LIKE 'to_ext_%'
+ OR name = 'location'
+ AND config_file = '12M_facts'
+ OR name = 'location'
+ AND config_file = 'ip_allow.config'
+ OR name = 'location'
+ AND config_file = 'parent.config'
+ OR name = 'location'
+ AND config_file = 'records.config'
+ OR name = 'location'
+ AND config_file = 'remap.config'
+ OR name = 'location'
+ AND config_file = 'hosting.config'
+ OR name = 'location'
+ AND config_file = 'traffic_ops_ort_syncds.cron'
+ OR name = 'location'
+ AND config_file = 'cache.config';
+INSERT INTO
+ PARAMETER (name, config_file, VALUE)
+ SELECT
+ 'scope',
+ config_file,
+ 'cdn'
+ FROM
+ PARAMETER
+ WHERE
+ name = 'location'
+ AND config_file LIKE 'cacheurl%'
+ OR name = 'location'
+ AND config_file LIKE 'hdr_rw_%'
+ OR name = 'location'
+ AND config_file LIKE 'regex_remap_%'
+ OR name = 'location'
+ AND config_file = 'regex_revalidate.config'
+ OR name = 'location'
+ AND config_file LIKE 'set_dscp_%'
+ OR name = 'location'
+ AND config_file = 'ssl_multicert.config'
+ OR name = 'location'
+ AND config_file = 'bg_fetch.config';
+INSERT INTO
+ PARAMETER (name, config_file, VALUE)
+ SELECT
+ 'scope',
+ config_file,
+ 'profile'
+ FROM
+ PARAMETER
+ WHERE
+ name = 'location'
+ AND config_file = '50-ats.rules'
+ OR name = 'location'
+ AND config_file = 'astats.config'
+ OR name = 'location'
+ AND config_file = 'drop_qstring.config'
+ OR name = 'location'
+ AND config_file = 'logs_xml.config'
+ OR name = 'location'
+ AND config_file = 'plugin.config'
+ OR name = 'location'
+ AND config_file = 'storage.config'
+ OR name = 'location'
+ AND config_file = 'sysctl.conf'
+ OR name = 'location'
+ AND config_file LIKE 'url_sig_%'
+ OR name = 'location'
+ AND config_file = 'volume.config';
+INSERT INTO
--- End diff --
Sure.
To clarify, we're adding the scope parameters for each config_file, then
using the existing location parameters for those config files to identify the
profiles they are assigned to and assign the new scope parameters to the same
profiles.
> Improve efficiency of ATS config generation
> -------------------------------------------
>
> Key: TC-32
> URL: https://issues.apache.org/jira/browse/TC-32
> Project: Traffic Control
> Issue Type: Improvement
> Components: Traffic Ops API
> Reporter: Derek Gelinas
> Assignee: Derek Gelinas
> Fix For: 1.9.0
>
>
> Currently when generating ATS configuration files, each server calls for its
> individual files from traffic ops. This is a very database-intensive process
> that is not scalable enough. I propose the following changes:
> 1) Generate the configuration files only as many times as needed - many files
> are the same (or can be) for the entire CDN or server profile.
> 2) Once generated, the files can be cached locally. Requests for the files
> by ORT will result in pulling down these cached files rather than many
> hundreds of DB queries each time.
> 3) Migrate the routes for these files to the API. Each call will have
> multiple options - a request made with no options would return the cached
> file, another option would return the current DB data, and a third option
> would update the cached file with the current information in the DB.
> 4) When an update is queued, generate and cache the configuration files, then
> activate the update flag for the relevant servers once the cached file
> generation is completed.
> In this way, triggering updates for the caches will result in an initial
> increase in activity as traffic ops generates the files needed, followed by
> the much lower impact of the files themselves being requested by the caches.
> I believe we can cut down the number of server-specific configuration files
> to only 5 intially, and potentially fewer by having ORT fill in certain
> fields on files like records.config with local data during processing.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)