Are there any SBT options, JVM options or Scala compiler options that would positively or negatively influence SBT's startup and compile time. What are the options that I can play around with? Documentation is very poor and doesn't specify anything.
Background: I switched from from a 2 year old Macbook Air to a brand new Macbook Pro. Same OS, same configuration. The new one, has a much faster CPU and twice as much memory. For some reason, starting SBT and compiling my Play2 application is significantly faster on my old, much weaker, machine. The difference is consistently as high as 10 seconds compile time.
Turns out it was 2 things:
There was a conflicting dependency on SLF4J, which caused an SBT warning every time it started. I assume SBT tried to resolve the dependency in the background, significantly slowing down startup speed. Once that was removed, I saved 3-4 seconds.
When the compilation of the Play2 application was triggered by hitting http://localhost:9000 in the browser, there was another issue related to the hostname. I don't know exactly why this was having such a big impact, but after running scutil –set HostName “localhost” I reduced the time it takes to compile the application and get the Play2 application in the browser by nearly 10 seconds!
So overall, these 2 little changes saved me more than 10 seconds in the development cycle. I hope somebody finds this useful as well.
Related
Still very new to service fabric but I'm surprised that something as advanced as this is so slow to debug. I'm using a fairly fast machine but it takes 4-5 minutes to tear down and restart the cluster. I've googled it and can't see that anyone else has reported this as being a show stopper.
Some clues to help with your slow development turnaround time:
When developing locally, consider using a One-node cluster in order
to speed-up deployments and upgrades (less Upgrade/Fault Domains):
https://learn.microsoft.com/en-us/azure/service-fabric/service-fabric-get-started-with-a-local-cluster#one-node-and-five-node-cluster-mode
You need to setup/create your cluster once and than start it and
keep it running between debugging sessions, Visual Studio will take
care of uninstalling/upgrading the SF Apps when starting the
debugger.
You can modify the properties of the SF Application project to
decide if your SF App will be uninstalled and install or upgraded
when starting the debugger, which impacts the deployment time.
Consider running from a SSD drive which will speed up compilation and
deployment (file intensive).
Expect less than one minute to compile, deploy and attach debugger for a SF App with 2-3 services.
Yes, we have the same issue, we have around 10 services in our application and debugging is very slow, VS fails to refresh 1 node cluster all the time, so cluster reset is only solution. So every debug run takes about 5 minutes.
Yes, very disappointment development process, the only advantage is some reuse of C# code, if you have not decided what to use for your cloud solution, abandon C# as early as possible. Go for any JST based language having no intermediate binaries.
Is it possible to keep the cache 'loaded' between recompiles?
Using auto-compile mode (play ~run) it calls out to several external APIs to build the response. If I am just tweaking code it is a pain to have to wait to rebuild the whole page every time.
That's the nature of development mode. The server is restarted for every recompile, and the EhCachePlugin is reinitialized. In production however, you shouldn't be using the EhCachePlugin anyway, as it not designed for a distributed environment (since each instance has it's own local cache).
I use the Play2-Memcached plugin for my production servers, and after a lot of similar frustration, I just decided to install memcached on my local machine and use that in development mode as well. I'm only kicking myself for not doing it sooner. It also comes with the added bonus of being able to flushall from the command line.
Liferay 6.1 takes roughly 60-120 seconds to start on my developer machine. Unfortunately we have to start Liferay very often, so this delay hurts. Actually, most features of Liferay aren't needed by a developer (at least not for us). Is it possible to reduce the amount of time Liferay takes to start? Maybe by removing unused functionality, such as blog, chat and forum?
Please note that I'm not talking about deployment time, which can be reduced a little by following the hints in another StackOverflow thread.
removing unused functionality - that's a good idea, just it will be hard on Liferay 6.1. This is what modularity promises to make possible for Liferay 7, where you should be able to remove the unwanted OSGi bundles. Unfortunately Liferay 7 is not out yet (as of the time of writing this answer beta4 is out) and you're explicitly asking about 6.1.
You could try to deactivate several components - most likely by changing several of the spring configuration files in an ext plugin. However, this has rarely been done, so it might have consequences that nobody has ever seen. Also, it will probably be hard to maintain and upgrade this configuration.
Another way to solve this problem is to ask "Why do you have to restart so often?". In fact, utilizing JRebel for deployments - especially on a developer machine - has shown to be quite effective.
In the answer to Meera Prince's answer you're stating the "generous memory settings" of 1024G - while I agree that this shouldn't limit you in the upstart time, you might want to monitor it, so that you at least don't run into garbage collection during startup time. For a Java application the size of Liferay, 1G memory might be sufficient, but I'd not call it "generous".
Note that 8G RAM on a development machine might be your limitation: As soon as your machine hits virtual memory and starts paging to disk, all bets are off and you'll suffer. And I have no clue what else you're running: Browsers, IDE, Editors, Word Processor, Liferay, random other applications and services. You're hopefully on a 64bit OS.
If you have 8GB of RAM, then put more for Liferay e.g.
CATALINA_OPTS="-Xms4G -Xmx4G -XX:MaxPermSize=512m"
using of CATALINA_OPTS is better then JAVA_OPTS, because JAVA_OPTS will be allocated by shutdown of tomcat too, and CATALINA_OPTS only by startup.
And you can disable not necessary Filters in portal-ext.properties, e.g.
com.liferay.portal.servlet.filters.sso.cas.CASFilter = false
com.liferay.portal.servlet.filters.sso.ntlm.NtlmFilter = false
com.liferay.portal.servlet.filters.sso.ntlm.NtlmPostFilter = false
com.liferay.portal.servlet.filters.sso.opensso.OpenSSOFilter= false
com.liferay.portal.sharepoint.SharepointFilter = false
com.liferay.portal.servlet.filters.gzip.GZipFilter = false
See Liferay: How to configure Liferay Portal
If you are using Tomcat to run Liferay, the following will greatly reduce the time it takes to startup. Modifying your catalina.properties file attributes shown below. The article goes into the details.
org.apache.catalina.startup.ContextConfig.jarsToSkip=*
org.apache.catalina.startup.TldConfig.jarsToSkip=*
tomcat.util.scan.DefaultJarScanner.jarsToSkip=*
http://www.gpickin.com/index.cfm/blog/how-to-get-your-tomcat-to-pounce-on-startup-not-crawl
You may buy an SSD HD
8G RAM must be enough for Liferay 6.1 + Browser + Eclipse, however I have 16G, but I very often have two Liferays running an 20+ open browser windows
A CPU with 4 core can be relevant
Undeploy deployed but not needed portlets
Its depends on resource allocation for liferay JVM means heap and permzen space.
and also depends on your system RAM size
find java script and css related proprieties in liferay portal.proeprties file.
Use Java_OPTS as follows
-Xms1024m -Xmx1024m -XX:MaxPermSize=512m
https://www.liferay.com/community/wiki/-/wiki/Main/Liferay+Developer+Modee
http://www.liferaysavvy.com/2013/12/liferay-environment-challenges-and.html
https://www.liferay.com/documentation/liferay-portal/6.1/development/-/ai/lp-6-1-theme-developer-mode
I think, using ramdisk may worth a try.
Windows 7:
http://www.laptopmag.com/articles/faster-than-an-ssd-how-to-turn-extra-memory-into-a-ram-disk
Linux:
http://www.jamescoyle.net/how-to/943-create-a-ram-disk-in-linux
If you have many deployed plugins, it can shorten the startup time.
Without deployed plugins (only with marketplace) I measured the same starttime than with my hdd.
I'm having a problem with play framework: when I compile after modifying a single file and run it, it often runs the old compiled code. Seems to be using something like an internal cache.
system:
play 2.2.1 built with Scala 2.10.2 (running Java 1.7.0_25)
issue:
After recompiling the project and refreshing browser's view it is often still executed the previous code.
fix:
clean compile will fix it, by the way it's quite time consuming.
Thank you,
Pietro
Well this is because you are not running it in development mode i.e. play run.
In this mode, the server will be launched with the auto-reload feature enabled, meaning that for each request Play will check your project and recompile required sources. If needed the application will restart automatically.
I want to know how can I speed up RSA 7.5( which is an IDE by IBM having eclipse under the hood with websphere server runtimes) mainly server start. The first time I start it after computer reboot it loads after, but after that it takes for ever to start/stop the server. The debug mode for server takes for ever to start.
I am using server 7 run time for IBM RSA 7.5.
So bascially RAD/RSA has websphere run times which allows to configure the server runtime start/stop within RAD/RSA. The run time allows you to develop webapps and test time on the server on deploy it on the websphere run time.
The problem I am facing is with the websphere runtime which works fine after computer reboot but is very slow after several deployments/publishing of the same web app.
I would be grateful you give performance tips for speed up RSA server start/shutdown and overall performance tips. I have plenty of memory like 12 GB with i7 Core 6 cores on Win7.
Of course of your are running the server in debug mode it's going to be a lot slower, but you have a few options like putting the server in development mode or doing some fine tuning as to which applications should start. Take a look at these articles:
Rational Application Developer Performance Tips- Case study: Tuning WebSphere Application Server V7 and V8 for performance
Performance tuning WebSphere Application Server 7 on AIX 6.1
WebSphere tuning for the impatient: How to get 80% of the performance improvement with 20% of the effort
WebSphere Performance Monitoring & Tuning
Some of these are a bit dated but they have some good information that may still be relevent to your issues; especially the first one.
Make sure that the workspaces are stored on a local disk.
edit - forgot this: buy a SSD disk. It makes a huge difference when developing.
If you have a virus scanner, disable on-access scan in the SDP installation directory including the server plugin, and in all your workspaces.
Uninstall any applications (ears) you are not using - the more you have installed the longer the server takes to startup. If your server is taking too long to start, RAD/RSA will assume it has timed out and stop it before it finishes starting - if this happens then increase the start timeout limit by double-clicking your server in the Servers tab and modifying the values in the Timeouts section.
Oh, and If you have a lot of datasources defined, and autostarting connection pools with alot of connections, it may also take a while to start the pools.
But that can't explain it all... I haven't tested, but since WAS and RSA seems to spend a lot of time doing absolutely nothing, I am starting to suspect it's trying to download schemas or something. If you have the time, you could try to trace and see if you find something like that...
I came across this post while trying to troubleshoot my RSA performance. I figured I would update it with a recommendation for improving performance on RSA 8.0.4.
http://publib.boulder.ibm.com/infocenter/radhelp/v8/index.jsp?topic=/com.ibm.performance.doc/topics/cperformance.html has some excellent tips on improving performance in the "Performance Tips" section. After implementing just some of the "Always" tips I've found my memory reducing significantly and performance being much faster.
You should start with the "Always" tips and then move to the "Sometimes" and "Rarely" ones for finer tuning.