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

Use http agents for hook requests #4791

Merged
merged 1 commit into from
May 29, 2018

Conversation

TylerBrock
Copy link
Contributor

We've found that hooks create an enormous amount of http traffic (including dns lookups, socket churning, and port exhaustion).

Using a NodeJS http(s) agent with keepAlive enabled in both the client sdk and parse-server has been valuable for us as we scale our production load so I'm proposing this change upstream as it might help others (and could potentially be the default when people feel comfortable).

@codecov
Copy link

codecov bot commented May 27, 2018

Codecov Report

Merging #4791 into master will decrease coverage by 0.02%.
The diff coverage is 77.77%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4791      +/-   ##
==========================================
- Coverage   92.69%   92.66%   -0.03%     
==========================================
  Files         119      119              
  Lines        8679     8686       +7     
==========================================
+ Hits         8045     8049       +4     
- Misses        634      637       +3
Impacted Files Coverage Δ
src/Controllers/index.js 96.55% <100%> (ø) ⬆️
src/Controllers/HooksController.js 94.59% <75%> (-1.56%) ⬇️
src/RestWrite.js 93.61% <0%> (-0.19%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 32d8c36...da0f607. Read the comment docs.

@TylerBrock TylerBrock requested a review from acinader May 29, 2018 21:45
@TylerBrock
Copy link
Contributor Author

Do you think this is mergable as is?

Copy link
Contributor

@flovilmart flovilmart left a comment

Choose a reason for hiding this comment

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

Yeah let’s go, not a big deal

@@ -131,6 +131,8 @@ export interface ParseServerOptions {
startLiveQueryServer: ?boolean;
/* Live query server configuration options (will start the liveQuery server) */
liveQueryServerOptions: ?LiveQueryServerOptions;
/* Keep hook HTTP connections alive */
hookKeepAlive: ?boolean;
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps we should default to true? What would be the drawback?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we should flip the default (and potentially make it not configurable) in the future. Just wanted to dip our toe in here.

There should be very little drawback to enabling this.

@flovilmart flovilmart merged commit 82fb06f into parse-community:master May 29, 2018
Copy link
Contributor

@acinader acinader left a comment

Choose a reason for hiding this comment

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

leave trailing cr

@flovilmart
Copy link
Contributor

@TylerBrock I believe you forgot to run buildDefinitions to regenerate the parser and options mapper for the CLI :/

@TylerBrock
Copy link
Contributor Author

I'm so sorry, I was totally unaware we had to do that portion of it. Is that documented somewhere?

@flovilmart
Copy link
Contributor

No worry! My bad not catching it.

To rebuild: node resources/buildConfigDefinitions.js.

See https://github.com/parse-community/parse-server/blob/master/resources/buildConfigDefinitions.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants