简体   繁体   中英

Java Play Framework 1.4x - Development Server

I am interested in what Development Server does Play use under the hood? (Web & Application server)

While developing locally i have huge page load times (5-10 seconds) comparing to deployed application page loads (1-2 sec). I suppose something is wrong with development server since there is a huge difference in speed.

Is there a specific location of the development server Play. 1?4 uses? Can i switch development server?

Play uses netty, but the performence difference is because in dev mode all the frameworks (not only play) disable all kind of caches or precompiled things and recompile everything all the time to have a good dev experience, in production things are compiled only once.

Play FW uses a single thread in DEV mode(default) for better debugging. If you have blocking threads (multiple queries being excuted with ajax requests etc), the others will be waiting for that thread to be released. So you will have longer wait times relative to deployed version.

You can change this behaviour to use specified number of threads (eg 5), in application.conf like this:

# Default to 1 thread in DEV mode or (nb processors + 1) threads in PROD mode.
# Try to keep a low as possible. 1 thread will serialize all requests (very useful for debugging purpose)
play.pool=5

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM