elastic / apm-agent-rum-js

https://www.elastic.co/guide/en/apm/agent/rum-js/current/index.html
MIT License
279 stars 135 forks source link

Optimize the payload size #158

Open hmdhk opened 5 years ago

hmdhk commented 5 years ago

We will initially have a look at the current payload size and see if there are obvious things to improve.

vigneshshanmugam commented 5 years ago

I did couple of experiments checking the payload size of our current master with few changes that should not result in any issues with APM Server and Kibana. The below tests are really small changes that we can do today without modifying any of the schema intake API changes in APM server level.

Scenario

RequestPayload Size without any changes

Payload Size - 23745 Bytes

Step 1

Payload Size - 18412 Bytes (~4kB reduction)

Step 2

This change might impact the UI in future, But I could not think anything broken at the moment

Payload Size - 17449 Bytes (~5kB reduction)

Even though step2 is not in the right direction, I would like to get thoughts on both of the steps. We can look in to advanced techniques like compressing the payload, sending in chunks later on if becomes a huge concern.

Thoughts @jahtalab @roncohen @alvarolobato ?

alvarolobato commented 5 years ago

These measures are all uncompressed right? Do you know the compressed values and improvements? What are we trying to achieve here? reduce APM server load? Bandwidth? ES storage? All of it?

vigneshshanmugam commented 5 years ago

Yes all the measurement above are uncompressed, We are trying to optimise the Payload size that we are sending to the APM server which in turn would reduce the bandwidth consumption for the users.

hmdhk commented 5 years ago

Had a meeting with @vigneshshanmugam, we discussed the specific optimisations we want to do:

hmdhk commented 4 years ago

We're currently block by optimization on apm server

hmdhk commented 4 years ago

Does the span_count need to be the actual value for unsampled transactions? if so the agent needs to send the value for unsampled transactions.

cc @jalvz

jalvz commented 4 years ago

@jahtalab the original spec for span_count is here: https://github.com/elastic/apm-server/issues/280