Skip to content

The Prefetch Plugin is not working #8216

Closed

Description

@stackexpress-jawed

I am using Prefetch Plugin as per this doc - https://docs.trafficserver.apache.org/en/9.0.x/admin-guide/plugins/prefetch.en.html

But It’ not prefetching the objects.
Prefetch Pattern - --fetch-path-pattern=/(.*-)(\d+)(.*)/$1{$2+1}$3/

Prefetch Plugin Logs (confirms that plugin is loaded successfully)

[Aug 05 03:23:53.171] [ET_NET 12] DIAG: (prefetch) prefetch/plugin.cc:450:contHandleFetch() event: TS_EVENT_HTTP_TXN_CLOSE (60012)
[Aug 05 03:26:50.162] traffic_server DIAG: (prefetch) prefetch/configs.cc:86:init() processing --fetch-policy=simple
[Aug 05 03:26:50.162] traffic_server DIAG: (prefetch) prefetch/configs.cc:86:init() processing --fetch-path-pattern=/(.*-)(\d+)(.*)/$1{$2+1}$3/
[Aug 05 03:26:50.162] traffic_server DIAG: (prefetch) prefetch/pattern.cc:331:compile() compiling pattern:'(.*-)(\d+)(.*)', replacement:'$1{$2+1}$3'
[Aug 05 03:26:50.162] traffic_server DIAG: (prefetch) prefetch/configs.cc:86:init() processing --fetch-count=3
[Aug 05 03:26:50.162] traffic_server DIAG: (prefetch) prefetch/configs.cc:160:finalize() front-end: false
[Aug 05 03:26:50.162] traffic_server DIAG: (prefetch) prefetch/configs.cc:161:finalize() exact match: false
[Aug 05 03:26:50.162] traffic_server DIAG: (prefetch) prefetch/configs.cc:162:finalize() API header name: X-AppleCDN-Prefetch
[Aug 05 03:26:50.162] traffic_server DIAG: (prefetch) prefetch/configs.cc:163:finalize() next object header name: X-AppleCDN-Prefetch-Next
[Aug 05 03:26:50.162] traffic_server DIAG: (prefetch) prefetch/configs.cc:164:finalize() fetch policy parameters: simple
[Aug 05 03:26:50.162] traffic_server DIAG: (prefetch) prefetch/configs.cc:165:finalize() fetch count: 3
[Aug 05 03:26:50.162] traffic_server DIAG: (prefetch) prefetch/configs.cc:166:finalize() fetch concurrently max: 0
[Aug 05 03:26:50.162] traffic_server DIAG: (prefetch) prefetch/configs.cc:167:finalize() replace host name:
[Aug 05 03:26:50.162] traffic_server DIAG: (prefetch) prefetch/configs.cc:168:finalize() name space: default
[Aug 05 03:26:50.162] traffic_server DIAG: (prefetch) prefetch/configs.cc:169:finalize() log name:
[Aug 05 03:26:50.162] traffic_server DIAG: (prefetch) prefetch/fetch.cc:123:BgFetchState() initialized lock
[Aug 05 03:26:50.162] traffic_server DIAG: (prefetch) prefetch/fetch.cc:130:BgFetchState() initialized lock
[Aug 05 03:26:50.162] traffic_server DIAG: (prefetch) prefetch/fetch_policy.cc:40:getInstance() getting 'simple' policy instance, params: (null)
[Aug 05 03:26:50.162] traffic_server DIAG: (prefetch) prefetch/fetch_policy_simple.cc:29:init() initialized simple fetch policy

Logs when accessing contents - http://prefetch.cache.<mydomain>.com/texts/demo-1.txt

The following objects should be prefetched (but unable to fetch following objects)

  • http://prefetch.cache.<mydomain>.com/texts/demo-2.txt
  • http://prefetch.cache.<mydomain>.com/texts/demo-3.txt
  • http://prefetch.cache.<mydomain>.com/texts/demo-4.txt
[Aug 05 03:29:33.192] [ET_NET 13] DIAG: (prefetch) prefetch/plugin.cc:450:contHandleFetch() event: TS_EVENT_HTTP_POST_REMAP (60017)
[Aug 05 03:29:33.192] [ET_NET 13] DIAG: (prefetch) prefetch/plugin.cc:272:appendCacheKey() cache key: /origin1.cdn.opspi.com/80/texts/demo-1.txt
[Aug 05 03:29:33.192] [ET_NET 13] DEBUG: <MIME.cc:2670 (mime_field_block_describe)> (http) V: "http://prefetch.cache.<mydomain>.com/texts/", V_LEN: 43,
[Aug 05 03:29:33.193] [ET_NET 13] DIAG: (prefetch) prefetch/plugin.cc:450:contHandleFetch() event: TS_EVENT_HTTP_CACHE_LOOKUP_COMPLETE (60015)
Referer: http://prefetch.cache.<mydomain>.com/texts/
Referer: http://prefetch.cache.<mydomain>.com/texts/
Referer: http://prefetch.cache.<mydomain>.com/texts/

Activity

  1. stackexpress-jawed commented on Feb 1, 2022

    @stackexpress-jawed
    Author

    No, not solved.

  2. assigned and unassigned on Apr 18, 2022
  3. moonchen commented on Apr 26, 2022

    @moonchen
    Contributor

    Have you tried setting @pparam=--front=true?

  4. ywkaras commented on Apr 26, 2022

    @ywkaras

    Have you tried setting @pparam=--front=true?

    No. Currently I am trying to get it to work for single tier. Would you set that for single tier?

  5. moonchen commented on Apr 26, 2022

    @moonchen
    Contributor

    Have you tried setting @pparam=--front=true?

    No. Currently I am trying to get it to work for single tier. Would you set that for single tier?

    I believe so.

  6. ywkaras commented on Apr 27, 2022

    @ywkaras

    Following moonchen's suggestion, I was able to get the plugin to work: #8810 . But I still don't understand why it's needed.

  7. ywkaras commented on May 23, 2022

    @ywkaras

    For now, I'm going to assume that everyone is OK with using the front parameter, as used in this Au test: https://github.com/apache/trafficserver/blob/master/tests/gold_tests/pluginTest/prefetch_simple/prefetch_simple.test.py . If not, please reopen this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions