Repository navigation
improvements to play-java - #40
Conversation
pk11
commented
Mar 31, 2013
- thread-safe jackson ObjectMapper is kept on class level
- blocking tasks were moved off from main thread pool
- increased default threadpool size as well as configured Akka plugin for blocking tasks
- thread-safe jackson ObjectMapper is kept on class level - blocking tasks were moved off from main thread pool - increased default threadpool size as well as configured Akka plugin for blocking tasks
There was a problem hiding this comment.
Shouldn't each one of these finds be executed in parallel? From memory I think that is what the node sample is doing.
There was a problem hiding this comment.
not sure how much that would buy us in practice, considering that we are also limited by the db pool, but I guess it's worth a try. I will look into it.
There was a problem hiding this comment.
The play-scala executes each one in parallel so we should be consistent there. I shall do a PR and fix that.
There was a problem hiding this comment.
Sorry about the delay! I have not not sent a new PR since my benchmarks were inconclusive. The next thing I wanted to try is increase the db pool size and send everything via Futures but if you are already on this, I will let you handle it :)
|
Thanks @pk11! You mentioned you might be working on a few other changes (database pool perhaps?), so we're looking forward to the next pull request. |
|
Now created #63 in terms of my contributions mainly around async db handling |
|
why do you guys use default settings for db pool (10 connections) |
|
same for play-scala |
|
@OlegYch yep, that's a good point, I noticed that too, hence my comment above. |
|
I'm going to create another PR w.r.t. sizing the connection pool. The PR should be up in the next hour or so. |
|
Thanks for picking that one up. I think you guys have told us about the connection pool size a couple times but we didn't get the change done ourselves. |
|
@bhauer may be you can let me know quickly - what's the max number of connections you've been configuring elsewhere? |
|
I can only speak definitively to Gemini since I set that one up, and in that case we use a little over 256 so that we can be sure to have one "ready" database connection available for every active HTTP connection. Without knowing the particular behavior of Play, my instinct is that you would want to have the same number for the same reason. Although I wrote the Servlet test as well, I used the stock MySQL connection pool in that case, and I believe it too is using a similar number but don't quote me on that. |
|
Thanks. Looking at the node configuration there is a max of 800 connections and a concurrency level of 100. I'll try and reproduce that and then see where we're at. |
|
#96 is my placeholder for connection pooling changes |
|
I implemented something like that in my fork, and it seems to be 2 - 3 times faster: https://groups.google.com/d/msg/play-framework/SX_pg7fVQ0A/ciDCs8NMRFkJ The commit: Maybe you can use this to compare it with your changes. It uses 96 Threads for the DB and 96 Threads for the FutureContext to match that. EDIT - the idea behind this was to not to go over 256 Threads (because some user on the mailing list stated that compojure (if I recall correctly) uses 256 threads) For I7 (with 4 Cores + 4*HT) Netty worker pool - 16 + X Threads (I think, not sure though) Total: ~232 Threads |
|
Thanks @Skamander - I shall incorporate your recommendations in the next hour or two. Can we subsequently take this discussion to #96 - thanks. |
... and shamelessly copied the dispatch settings from here: TechEmpower/FrameworkBenchmarks#40