You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mesos.apache.org by Ben Mahler <be...@gmail.com> on 2012/10/20 04:17:23 UTC

Review Request: Encoding HTTP Responses with gzip by default. Decoding incoming compressed messages.

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/7681/
-----------------------------------------------------------

Review request for mesos, Benjamin Hindman and Vinod Kone.


Description
-------

see summary.

This helps with the performance of the webui and json endpoints.
In production, when using the webui, we send ~900KB uncompressed data from master/state.json (every 3 seconds, the update interval). This becomes ~90KB compressed!


Diffs
-----

  third_party/libprocess/src/decoder.hpp 5f8d70e068a9ec71555454fe4140d37993a92cc0 
  third_party/libprocess/src/encoder.hpp 1ff84af197e2ecafe4da29310b97027805734365 

Diff: https://reviews.apache.org/r/7681/diff/


Testing
-------

This was exercised by the existing tests.
All the tests that expect response strings (LoggingTest, FilesTest, etc).


Thanks,

Ben Mahler


Re: Review Request: Encoding HTTP Responses with gzip by default. Decoding incoming compressed messages.

Posted by Vinod Kone <vi...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/7681/#review12658
-----------------------------------------------------------

Ship it!



third_party/libprocess/src/decoder.hpp
<https://reviews.apache.org/r/7681/#comment26998>

    sounds like you can pull out a helper?


- Vinod Kone


On Oct. 20, 2012, 2:17 a.m., Ben Mahler wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/7681/
> -----------------------------------------------------------
> 
> (Updated Oct. 20, 2012, 2:17 a.m.)
> 
> 
> Review request for mesos, Benjamin Hindman and Vinod Kone.
> 
> 
> Description
> -------
> 
> see summary.
> 
> This helps with the performance of the webui and json endpoints.
> In production, when using the webui, we send ~900KB uncompressed data from master/state.json (every 3 seconds, the update interval). This becomes ~90KB compressed!
> 
> 
> Diffs
> -----
> 
>   third_party/libprocess/src/decoder.hpp 5f8d70e068a9ec71555454fe4140d37993a92cc0 
>   third_party/libprocess/src/encoder.hpp 1ff84af197e2ecafe4da29310b97027805734365 
> 
> Diff: https://reviews.apache.org/r/7681/diff/
> 
> 
> Testing
> -------
> 
> This was exercised by the existing tests.
> All the tests that expect response strings (LoggingTest, FilesTest, etc).
> 
> 
> Thanks,
> 
> Ben Mahler
> 
>


Re: Review Request: Encoding HTTP Responses with gzip by default. Decoding incoming compressed messages.

Posted by Benjamin Hindman <be...@berkeley.edu>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/7681/#review12736
-----------------------------------------------------------

Ship it!



third_party/libprocess/src/decoder.hpp
<https://reviews.apache.org/r/7681/#comment27177>

    The name unzipped is fine here, but maybe for consistency with the rest of this review (and thus the codebase), call it decompressed?



third_party/libprocess/src/decoder.hpp
<https://reviews.apache.org/r/7681/#comment27175>

    This stuff has been orphaned, please put it back up with the http::decode stuff above. Also, by setting decoder->query to the decoded version I'm assuming that you're going to use decoder->query for that someplace else (not just in the next line), so I'd suggest just using decoded.get() in the next line instead (sorry I missed this before).



third_party/libprocess/src/decoder.hpp
<https://reviews.apache.org/r/7681/#comment27178>

    Ditto above.



third_party/libprocess/src/decoder.hpp
<https://reviews.apache.org/r/7681/#comment27176>

    Ditto above re: orphan.



third_party/libprocess/src/encoder.hpp
<https://reviews.apache.org/r/7681/#comment27179>

    Ditto above re: zipped/compressed.



third_party/libprocess/src/encoder.hpp
<https://reviews.apache.org/r/7681/#comment27180>

    You don't need to erase, you'll just overwrite below.


- Benjamin Hindman


On Oct. 20, 2012, 2:17 a.m., Ben Mahler wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/7681/
> -----------------------------------------------------------
> 
> (Updated Oct. 20, 2012, 2:17 a.m.)
> 
> 
> Review request for mesos, Benjamin Hindman and Vinod Kone.
> 
> 
> Description
> -------
> 
> see summary.
> 
> This helps with the performance of the webui and json endpoints.
> In production, when using the webui, we send ~900KB uncompressed data from master/state.json (every 3 seconds, the update interval). This becomes ~90KB compressed!
> 
> 
> Diffs
> -----
> 
>   third_party/libprocess/src/decoder.hpp 5f8d70e068a9ec71555454fe4140d37993a92cc0 
>   third_party/libprocess/src/encoder.hpp 1ff84af197e2ecafe4da29310b97027805734365 
> 
> Diff: https://reviews.apache.org/r/7681/diff/
> 
> 
> Testing
> -------
> 
> This was exercised by the existing tests.
> All the tests that expect response strings (LoggingTest, FilesTest, etc).
> 
> 
> Thanks,
> 
> Ben Mahler
> 
>


Re: Review Request: Encoding HTTP Responses with gzip by default. Decoding incoming compressed messages.

Posted by Ben Mahler <be...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/7681/
-----------------------------------------------------------

(Updated Oct. 25, 2012, 9:38 p.m.)


Review request for mesos, Benjamin Hindman and Vinod Kone.


Changes
-------

Benh review.


Description
-------

see summary.

This helps with the performance of the webui and json endpoints.
In production, when using the webui, we send ~900KB uncompressed data from master/state.json (every 3 seconds, the update interval). This becomes ~90KB compressed!


Diffs (updated)
-----

  third_party/libprocess/src/decoder.hpp 5f8d70e068a9ec71555454fe4140d37993a92cc0 
  third_party/libprocess/src/encoder.hpp 1ff84af197e2ecafe4da29310b97027805734365 

Diff: https://reviews.apache.org/r/7681/diff/


Testing
-------

This was exercised by the existing tests.
All the tests that expect response strings (LoggingTest, FilesTest, etc).


Thanks,

Ben Mahler


Re: Review Request: Encoding HTTP Responses with gzip by default. Decoding incoming compressed messages.

Posted by Ben Mahler <be...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/7681/#review12671
-----------------------------------------------------------



third_party/libprocess/src/decoder.hpp
<https://reviews.apache.org/r/7681/#comment27012>

    I have a TODO at the top of this file related to the duplication.
    
    // TODO: Make DataDecoder abstract and make RequestDecoder a concrete subclass.
    
    Right now there's a lot of duplicate code across the DataDecoder and Response decoder, so rather than adding helpers we need to subclass properly here.
    
    Punting on that refactor for now.


- Ben Mahler


On Oct. 20, 2012, 2:17 a.m., Ben Mahler wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/7681/
> -----------------------------------------------------------
> 
> (Updated Oct. 20, 2012, 2:17 a.m.)
> 
> 
> Review request for mesos, Benjamin Hindman and Vinod Kone.
> 
> 
> Description
> -------
> 
> see summary.
> 
> This helps with the performance of the webui and json endpoints.
> In production, when using the webui, we send ~900KB uncompressed data from master/state.json (every 3 seconds, the update interval). This becomes ~90KB compressed!
> 
> 
> Diffs
> -----
> 
>   third_party/libprocess/src/decoder.hpp 5f8d70e068a9ec71555454fe4140d37993a92cc0 
>   third_party/libprocess/src/encoder.hpp 1ff84af197e2ecafe4da29310b97027805734365 
> 
> Diff: https://reviews.apache.org/r/7681/diff/
> 
> 
> Testing
> -------
> 
> This was exercised by the existing tests.
> All the tests that expect response strings (LoggingTest, FilesTest, etc).
> 
> 
> Thanks,
> 
> Ben Mahler
> 
>


Re: Review Request: Encoding HTTP Responses with gzip by default. Decoding incoming compressed messages.

Posted by Ben Mahler <be...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/7681/#review12690
-----------------------------------------------------------


Are there any clients that will hit our endpoints that do not support gzip encoding? (Things collecting stats perhaps?)

If so, we'll have to try to properly only encode when 'Accept-Encoding' contains gzip in the request. It's currently a bit tricky to wire that up to happen automatically without having to change every endpoint to look for the header.

- Ben Mahler


On Oct. 20, 2012, 2:17 a.m., Ben Mahler wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/7681/
> -----------------------------------------------------------
> 
> (Updated Oct. 20, 2012, 2:17 a.m.)
> 
> 
> Review request for mesos, Benjamin Hindman and Vinod Kone.
> 
> 
> Description
> -------
> 
> see summary.
> 
> This helps with the performance of the webui and json endpoints.
> In production, when using the webui, we send ~900KB uncompressed data from master/state.json (every 3 seconds, the update interval). This becomes ~90KB compressed!
> 
> 
> Diffs
> -----
> 
>   third_party/libprocess/src/decoder.hpp 5f8d70e068a9ec71555454fe4140d37993a92cc0 
>   third_party/libprocess/src/encoder.hpp 1ff84af197e2ecafe4da29310b97027805734365 
> 
> Diff: https://reviews.apache.org/r/7681/diff/
> 
> 
> Testing
> -------
> 
> This was exercised by the existing tests.
> All the tests that expect response strings (LoggingTest, FilesTest, etc).
> 
> 
> Thanks,
> 
> Ben Mahler
> 
>