Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Promote smile encoding to be preferred over json response encoding #594

Merged
merged 3 commits into from
Apr 28, 2020

Conversation

carterkozak
Copy link
Contributor

Note that this change intentionally does not promote CBOR, which
may be supported on other non-java platforms. This allows us to
minimally take advantage of binary encoding without risking changes
in nonstandard consumers yet.

After this PR

==COMMIT_MSG==
Promote smile encoding to be preferred over json response encoding
==COMMIT_MSG==

Possible downsides?

It's new and different!

Note that this change intentionally does not promote CBOR, which
may be supported on other non-java platforms. This allows us to
minimally take advantage of binary encoding without risking changes
in nonstandard consumers yet.
@changelog-app
Copy link

changelog-app bot commented Mar 30, 2020

Generate changelog in changelog/@unreleased

Type

  • Feature
  • Improvement
  • Fix
  • Break
  • Deprecation
  • Manual task
  • Migration

Description

Promote smile encoding to be preferred over json response encoding

Check the box to generate changelog(s)

  • Generate changelog entry

@ferozco
Copy link
Contributor

ferozco commented Mar 30, 2020

Servers are already configured to respond with Smile right? I think I would like to wait for more roll out the client with the current behaviour before switching over the default

@carterkozak
Copy link
Contributor Author

Sure, we can sit on this until we're ready, but it would be helpful to have a clear definition of when that will be.

@stale
Copy link

stale bot commented Apr 13, 2020

This PR has been automatically marked as stale because it has not been touched in the last 14 days. If you'd like to keep it open, please leave a comment or add the 'long-lived' label, otherwise it'll be closed in 7 days.

@stale stale bot added the stale label Apr 13, 2020
@carterkozak
Copy link
Contributor Author

carterkozak commented Apr 13, 2020 via email

@stale stale bot removed the stale label Apr 13, 2020
@iamdanfox
Copy link
Contributor

Capturing the plan we discussed in the standup today: wait until we've enabled the feign shim by default in WC (as that will switch most clients to dialogue, but they won't get this fancy decoding), then merge this which will give people an extra incentive to move from feign shim -> codgen.

@carterkozak
Copy link
Contributor Author

@iamdanfox Are we ready to turn this on?

@iamdanfox
Copy link
Contributor

iamdanfox commented Apr 28, 2020

So I think the main thing I want to avoid is any possibility of a mega fleetwide P0. In practise I think that risk is pretty small here, because people's dockerized tests should stop this merging if smile encoding somehow breaks, and if they don't have dockerized tests then adjudication should roll them back. It seems like we're not in danger of this spontaneuously breaking in prod. It is a little sad that our exhaustive conjure-verification tests will only cover JSON here, but i guess we can get some confidence from gotham's success with smile.

Then there's the question of tracking the effect of this change. I know we've got params.content-type available in Aries, do we also want some instrumentation so we can track fleet-wide prevalance / response times in DD?

image

(Also it's probably worth mentioning the new behaviour in the README, possibly even giving people the curl equivalents so they can see for themselves what happens if you ask for smile/cbor?)

@ferozco
Copy link
Contributor

ferozco commented Apr 28, 2020

Thoughts on changing the weights in WC instead of dialogue then cutting an RC or exposing a temporary flag so that we can have a bit more of controlled rollout?

@sfackler
Copy link
Member

Out of curiosity, why is smile specifically the choice here? It appears to be a thing created by the Jackson developers and the level of support seems to be orders of magnitude smaller than other formats like CBOR.

@carterkozak
Copy link
Contributor Author

We're recording metrics as server.encoding.request and server.encoding.response. Docs internally at witchcraft/blob/develop/witchcraft-core/metrics.md#serverencoding

For what it's worth we've already rolled this out in our largest product successfully for the past year or two. How would rollout differ from the standard library upgrade, and at what point would it become default enabled?

@carterkozak
Copy link
Contributor Author

@sfackler CBOR is more widely supported but underperformant. In a large internal project we saw a similar benefit moving from JSON to CBOR and CBOR to SMILE.

Copy link
Contributor

@iamdanfox iamdanfox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'm game to give this a shot. It'll only affect pure dialogue clients (so all the feign shim ones won't get this), and adjudication should save us if something goes wrong.

Would still like a few sentences about this negotiation on the README though, especially because the tradeoffs are a little subtle (e.g. gzip achieves a similar response size, but SMILE was preferred for lower compression CPU iirc?)

@bulldozer-bot bulldozer-bot bot merged commit ded27d0 into develop Apr 28, 2020
@svc-autorelease
Copy link
Collaborator

Failed to load project - please reach out to #dev-foundry-infra or check Aries to debug

@bulldozer-bot bulldozer-bot bot deleted the ckozak/promote_smile_response_encoding branch April 28, 2020 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants