Skip to content

Comments

Adds support for batching requests.#3

Merged
bradoyler merged 1 commit intobradoyler:masterfrom
johncoder:master
Jul 31, 2014
Merged

Adds support for batching requests.#3
bradoyler merged 1 commit intobradoyler:masterfrom
johncoder:master

Conversation

@johncoder
Copy link
Contributor

@bradoyler Previously, route-cache would allow a big burst of requests to flow into the handler, resulting in a bunch of identical calls to hbs render. This change lets the first one slip in, and batches up each subsequent request until the render completes. As soon as the render is complete, the queued up batch of requests is drained. From the moment the request comes back, a new cache value should be available, which prevents new requests from getting queued up while the queue is drained. So far, I have seen about ~280% increase in requests per second.

@bradoyler
Copy link
Owner

💯

You've achieved the anti-DogPile badge 🚫 🐕

This looks great... and also a reason to bump version to 0.1.0

@bradoyler
Copy link
Owner

Curious... what was the exact test u ran to see the ~280% increase?

@johncoder
Copy link
Contributor Author

Sample application with a handler that renders a decent chunk of data in a handlebars view, and running the following apache benchmark test before/after:

ab -n 10000 -c 1000 http://127.0.0.1:9001/

Before I had seen somewhere between 70-90 requests per second. After it leaped to 330-350. Not too scientific, but the results were pretty consistent.

bradoyler added a commit that referenced this pull request Jul 31, 2014
Adds support for batching requests.
@bradoyler bradoyler merged commit 08eafdf into bradoyler:master Jul 31, 2014
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.

2 participants