[
https://issues.apache.org/jira/browse/TC-32?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15655337#comment-15655337
]
Derek Gelinas commented on TC-32:
---------------------------------
{code}
$r->get("/api/$version/profiles/:id/file/#filename/configfiles/generic_profile.config")->over(
authenticated => 1 )->to ( 'GenConfig#generic_profile_config', namespace =>
$namespace );
$r->get("/api/$version/profiles/:id/configfiles/50-ats.rules")->over(
authenticated => 1 )->to ( 'GenConfig#ats_dot_rules', namespace => $namespace );
$r->get("/api/$version/profiles/:id/configfiles/drop_qstring.config")->over(
authenticated => 1 )->to ( 'GenConfig#drop_qstring_dot_config', namespace =>
$namespace );
$r->get("/api/$version/profiles/:id/configfiles/logs_xml.config")->over(
authenticated => 1 )->to ( 'GenConfig#logs_xml_dot_config', namespace =>
$namespace );
$r->get("/api/$version/profiles/:id/configfiles/storage.config")->over(
authenticated => 1 )->to ( 'GenConfig#storage_dot_config', namespace =>
$namespace );
$r->get("/api/$version/profiles/:id/configfiles/volume.config")->over(
authenticated => 1 )->to ( 'GenConfig#volume_dot_config', namespace =>
$namespace );
$r->get("/api/$version/cdn/:name/configfiles/bg_fetch.config")->over(
authenticated => 1 )->to ( 'GenConfig#bg_fetch_dot_config', namespace =>
$namespace );
$r->get("/api/$version/cdn/:name/file/#filename/configfiles/cacheurl.config")->over(
authenticated => 1 )->to ( 'GenConfig#cacheurl_dot_config', namespace =>
$namespace );
$r->get("/api/$version/cdn/:name/file/#filename/configfiles/hdr_rw_.config")->over(
authenticated => 1 )->to ( 'GenConfig#header_rewrite_dot_config', namespace =>
$namespace );
$r->get("/api/$version/cdn/:name/file/#filename/configfiles/regex_remap_.config")->over(
authenticated => 1 )->to ( 'GenConfig#regex_remap_dot_config', namespace =>
$namespace );
$r->get("/api/$version/cdn/:name/configfiles/regex_revalidate.config")->over(
authenticated => 1 )->to ( 'GenConfig#regex_revalidate_dot_config', namespace
=> $namespace );
$r->get("/api/$version/cdn/:name/file/#filename/configfiles/set_dscp_.config")->over(
authenticated => 1 )->to ( 'GenConfig#set_dscp_dot_config', namespace =>
$namespace );
$r->get("/api/$version/cdn/:name/configfiles/ssl_multicert.config")->over(
authenticated => 1 )->to ( 'GenConfig#ssl_multicert_dot_config', namespace =>
$namespace );
$r->get("/api/$version/cdn/:name/file/#filename/configfiles/url_sig_.config")->over(
authenticated => 1 )->to ( 'GenConfig#url_sig_dot_config', namespace =>
$namespace );
$r->get("/api/$version/servers/hostname/:name/configfiles/12M_facts")->over(
authenticated => 1 )->to ( 'GenConfig#facts', namespace => $namespace );
$r->get("/api/$version/servers/hostname/:name/configfiles/cache.config")->over(
authenticated => 1 )->to ( 'GenConfig#cache_dot_config', namespace =>
$namespace );
$r->get("/api/$version/servers/hostname/:name/file/#filename/configfiles/generic_server.config")->over(
authenticated => 1 )->to ( 'GenConfig#generic_server_config', namespace =>
$namespace );
$r->get("/api/$version/servers/hostname/:name/extension/:ext_name/configfiles/to_ext.config")->over(
authenticated => 1 )->to ( 'GenConfig#to_ext_dot_config', namespace =>
$namespace );
$r->get("/api/$version/servers/hostname/:name/configfiles/hosting.config")->over(
authenticated => 1 )->to ( 'GenConfig#hosting_dot_config', namespace =>
$namespace );
$r->get("/api/$version/servers/hostname/:name/configfiles/ip_allow.config")->over(
authenticated => 1 )->to ( 'GenConfig#ip_allow_dot_config', namespace =>
$namespace );
$r->get("/api/$version/servers/hostname/:name/configfiles/parent.config")->over(
authenticated => 1 )->to ( 'GenConfig#parent_dot_config', namespace =>
$namespace );
$r->get("/api/$version/servers/hostname/:name/configfiles/remap.config")->over(
authenticated => 1 )->to ( 'GenConfig#remap_dot_config', namespace =>
$namespace );{code}
> 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)