# 1 minute initial 'load' with RUM/js agent 1.0 and APM server 6.4

**URL:** <https://discuss.elastic.co/t/1-minute-initial-load-with-rum-js-agent-1-0-and-apm-server-6-4/146124>\
**Category:** APM\
**Created:** [August 27, 2018, 8:07am UTC](https://discuss.elastic.co/t/1-minute-initial-load-with-rum-js-agent-1-0-and-apm-server-6-4/146124 "2018-08-27T08:07:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![peter.hanraets](https://avatars.discourse-cdn.com/v4/letter/p/e9c0ed/32.png) [@peter.hanraets](https://discuss.elastic.co/u/peter.hanraets)\
**Post date:** [August 27, 2018, 8:07am UTC](https://discuss.elastic.co/t/1-minute-initial-load-with-rum-js-agent-1-0-and-apm-server-6-4/146124/1 "2018-08-27T08:07:48Z")

</div>

I have setup a 6.4 APM server for testing RUM with the javascript code. I am testing this on an Atlassian Confluence instance using it's Custom HTML feature to load and initialize RUM.

My apm-server.yml looks like this (removed the comments). I have both frontend and rum in the config under apm-server as documentation said it should be rum but the reference config file only shows frontend:  
apm-server:

```
  host: "0.0.0.0:8200"

  frontend:
    enabled: true
    rate_limit: 100000
    allow_origins: ['*']
    library_pattern: "node_modules|bower_components|~"
    exclude_from_grouping: "^/webpack"
    source_mapping.cache.expiration: 5m
    source_mapping.index_pattern: "apm-*-sourcemap*"
 
  rum:
    enabled: true
    rate_limit: 100000
    allow_origins: ['*']
    library_pattern: "node_modules|bower_components|~"
    exclude_from_grouping: "^/webpack"
    source_mapping.cache.expiration: 5m
    source_mapping.index_pattern: "apm-*-sourcemap*"

  ssl.enabled: true
  ssl.certificate : "D:/Applications/Elastic/APM-Server/vanderlande.com.pem"
  ssl.key : "D:/Applications/Elastic/APM-Server/vanderlande.com.key"

setup.template.settings:

  index:
    number_of_shards: 1
    codec: best_compression

setup.kibana:

  host: "srv02182.vi.corp:5601"

output.elasticsearch:
  hosts: ["srv02182.vi.corp:9200"]

  indices:
    - index: "apm-%{[beat.version]}-sourcemap"
      when.contains:
        processor.event: "sourcemap"

    - index: "apm-%{[beat.version]}-error-%{+yyyy.MM.dd}"
      when.contains:
        processor.event: "error"

    - index: "apm-%{[beat.version]}-transaction-%{+yyyy.MM.dd}"
      when.contains:
        processor.event: "transaction"

    - index: "apm-%{[beat.version]}-span-%{+yyyy.MM.dd}"
      when.contains:
        processor.event: "span"

```

The code I put in the Custom HTML for Confluence:  
elasticApm.init({  
serviceName: 'vikipedia-acc',  
serverUrl: '[https://elastic-apm.vanderlande.com:8200](https://elastic-apm.vanderlande.com:8200)',  
})

I am seeing Page Load data on this service so connection seems to be working. However the first time I access the application in a new session (browser restart or new tab) the js file loads in 24ms but than the initialization (presumably) takes 1 minute. Subsequent actions on the application do not show this 'delay'.

Here is a screenshot from the client  
 ![elastic-apm-initial-load](https://us1.discourse-cdn.com/elastic/original/3X/e/e/ee0ef17f800e5d9792968690eb913ccc6fb87720.png)

What could be causing this (what seems like a timeout somewhere). How could I troubleshoot this?

---

<div class="post-metadata">

**Author:** ![Hamidreza](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hamidreza/32/21369_2.png) [@Hamidreza](https://discuss.elastic.co/u/Hamidreza)\
**Post date:** [August 27, 2018, 8:49am UTC](https://discuss.elastic.co/t/1-minute-initial-load-with-rum-js-agent-1-0-and-apm-server-6-4/146124/2 "2018-08-27T08:49:51Z")

</div>

Hi Peter,

Thanks for using Elastic APM.  
The correct configuration (for 6.4+) is `rum` therefore `frontend` section can be removed. The `apm-server.yml` file is updated to use `rum` in the configuration as of 6.4 release. Would you please report the name of the file that has the wrong `frontend` section so we can fix it?

The load time that is shown in the networks panel of the dev tools is purely for fetching the JavaScript file, you can see the breakdown of time spent on different phases of the download by hovering the mouse over the bar under the waterfall column. You can find a detail explanation of timing breakdown phases [here](https://developers.google.com/web/tools/chrome-devtools/network-performance/reference#timing-explanation).  
In your case the blue bar is "Content Download" which means the browser is receiving the content of the file (15.3 KB in size). A number of factors can cause this slowness in downloading the content, including the content provider and network situations.

As a side note, very little synchronous code execution happens during the initialisation process and it's mostly used for registering event listeners and create service objects.

I hope this helps. Let me know if you have more questions.

Cheers,  
Hamid

---

<div class="post-metadata">

**Author:** ![peter.hanraets](https://avatars.discourse-cdn.com/v4/letter/p/e9c0ed/32.png) [@peter.hanraets](https://discuss.elastic.co/u/peter.hanraets)\
**Post date:** [August 30, 2018, 5:38am UTC](https://discuss.elastic.co/t/1-minute-initial-load-with-rum-js-agent-1-0-and-apm-server-6-4/146124/3 "2018-08-30T05:38:26Z")

</div>

Hi Hamid,

It seems somehow Tomcat/Confluence was causing this 1 minute delay. Why it did so I still do not know. For now I have just setup an apache server that only hosts the RUM js file and it is now loaded in 12ms into the application.

The frontend stuff was in a apm-server.reference.yml which shipped with APM server 6.3.2 and was still in my APM server working directory as it is no longer shipped with the 6.4.0 release. Although such a reference file is quite useful it is not really an issue on the current release.

Thanks for your help! I'll dive into RUM a bit further now this hurdle has been overcome.

Cheers,  
Peter

---

<div class="post-metadata">

**Author:** ![Hamidreza](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hamidreza/32/21369_2.png) [@Hamidreza](https://discuss.elastic.co/u/Hamidreza)\
**Post date:** [August 30, 2018, 7:23am UTC](https://discuss.elastic.co/t/1-minute-initial-load-with-rum-js-agent-1-0-and-apm-server-6-4/146124/4 "2018-08-30T07:23:17Z")

</div>

> [@peter.hanraets](#):
>
> The frontend stuff was in a apm-server.reference.yml which shipped with APM server 6.3.2 and was still in my APM server working directory as it is no longer shipped with the 6.4.0 release. Although such a reference file is quite useful it is not really an issue on the current release.

Glad to know that it works now.  
I'm looking forward to hear your feedback.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [September 20, 2018, 3:23am UTC](https://discuss.elastic.co/t/1-minute-initial-load-with-rum-js-agent-1-0-and-apm-server-6-4/146124/5 "2018-09-20T03:23:22Z")

</div>

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.
