11

I am using play framework 1.2.5, for past two days I had a very big issue on load testing that is for every API call to the sever it takes around 1200-1400ms as average, but today I just changed the following only one line in the file application.conf which dramatically reduces the average time to 20 - 50 ms , the line as follows,

  application.mode=prod
  %prod.application.mode=prod

initially it was like

  application.mode=dev 
  %prod.application.mode=prod

So from this I could understand that changing from dev to production makes something and what I found in Internet is, In dev mode play.pool=1 by default whereas in production mode play.pool = no of processors + 1, my ubuntu machine is 4 processor so it uses 5 thread. Now coming to the Problem,if what I found is true then when I change the play.pool = 5 manually in the application.conf does not gives me a faster result neither if i set play.pool=1 and run in production mode also doesnot slows down my application loadtest results, So I need to know what happens when I change from dev to prod mode, other than this play.pool which makes my application faster. because I am facing problem In UAT where no good results for changing in prod mode also, it only works in my localhost.please find me a solution sooner thanks in Advance.

UPDATE :

Yes I do know all those stuffs like in DEV mode the application reloads and compiles but, perhaps its not for each and every request only at the initial program loading i think , but my Problem is this prod mode working fine at my localhost and my local server, when I go for UAT I get a bad results at load test around 800ms as average. the application is slow even in prod even I am performing the loadtest locally(the jmeter is installed in the server machine and I am load-testing it using Remote Desktop Connection). So other than compilation and reloading, I need to know what are all the changes performed in the application.conf file when I change from DEV to PROD mode like the play.pool changes from 1 thread to (no of processors + 1) thread. FYI: my localhost system is 4 processor machine, and local server machine is 4 processor, but the UAT machine is 2 processor, if this is the issue I even tried of changing the pool threads to 10(play.pool=10) and no good results at UAT.

Wiki
  • 235
  • 3
  • 13

3 Answers3

3

Additionally to the single thread, in dev mode the application start is delayed until the first request is send. In prod mode the app will start immediately. This obviously affects the load time of the first request.

I guess the 'bad' performance in dev mode is mostly caused by the feature to reload and compile classes while running. On each request classes are checked for changes and may be reloaded. I think this feature is very worth increased loading times and I don't know if it is even possible to deactivate.

You probably shouldn't run any performance/acceptance tests in dev mode. Here's a short a discussion about it. Instead of trying to increase dev mode performance, you should just use the prod mode.

kapex
  • 26,163
  • 5
  • 97
  • 111
  • Yes I do know all that stuffs of reloading and compilingin dev mode, but what my problem is the idea of changing from DEV to PROD mode works fine in my localhost and the local server but that idea is not good in the UAT(Testing site at America). Please see my UPDATE in the question – Wiki Aug 23 '13 at 04:31
1

You should do some more analysis before jumping to your guns.
Firstly you try to understand where that extra time is spent.

  • Rendering the templates?
  • Hanging waiting for DB Connections?
  • Are there any thread locks?
  • Has the database been optimized with indexes?
  • Have you measured the processor and memory usage?
  • Are you doing any costly IO Operations?
  • Are any other processes running on this machine?
emt14
  • 4,676
  • 7
  • 33
  • 57
0

how are you launching play on the production server?

I hope you have read: http://www.playframework.com/documentation/1.2.5/production

Your question is really about a performance problem. There could be many things causing a performance difference from your local environment and production. Aside from Play, is the DB running on the same box?

Tom Carchrae
  • 5,916
  • 2
  • 32
  • 33