SJWS 7 Agonizingly Slow Deploys
Hi,
I recently migrated from SJWS6.1 to 7 and the deploy on 7 takes forever. It also consumes up to 10 GB of disk space as it zips and moves and all that jazz multiple times (total filze size of my app is 1.2GB).
When I first tested SJWS7 I put the web-app in from scratch (no migration) and the deploys were quick as they only deployed the changes to the config files.
Is there any way to turn off SJWS7's zipping and rezipping and coping of my web-app? and only have it deploy config file changes?
Thanks!
# 1
Just incase anyone has experienced this and wants to know the answer (I finally figured it out):
SJWS 7 is suppose to zip up your current {$WEBROOT}/{$CONFIG-NAME}/web-app/* directory to {$WEBROOT}/admin-server/config-store/{$CONFIG-NAME}/current.zip. Now this zip is (as far as i can tell) not zipped from your {$WEBROOT}/{$CONFIG-NAME}/web-app/* like it's suppose to be, it's actually zipped up from {$WEBROOT}/admin-server/config-store/{$CONFIG-NAME}/web-app. That web-app directory is a copy of when the web-app was intially migrated from 6.1 to 7 and is not updated at all (even after you've made changes to your current web-app). As a result, you always get really long zip times (depending on the size of your web-app) for no practical reason.
The thing is, the configuration doesn't actually need to have a {$WEBROOT}/admin-server/config-store/{$CONFIG-NAME}/web-app directory, so if you wipe out everything under it webserver7 stops telling you that you need to deploy (when you don't) and stops wasting time zipping code when you don't need it too.
Deleting everything under that directory saves me 50 mins of waiting when I want to deploy changes. As a bonus it now only says I need to deploy when I've actually made a change. It's saved me a lot of head banging and I hope this helps someone else out there too.
# 2
Let's assume only a very small change was done to the configuration, say a JVM property was added.
Now, when the configuration is being deployed only the difference (only the changed file) will be deployed to the instances.
BUT, the entire configuration will be zipped up again.
Why?
Let's say that we create another instance of this configuration later. Then we need this zip to be pushed to the instance so that the instance can have the same configuration that was pushed to the other instances earlier.
why zip the configuration at the point of deploy?
So that we do not include any transient (undeployed) changes to be pushed to the newly created instance(s).
So, if you have a really huge application (app. 1.2 GB) then the zip time and the initial deploy time (right after the web application is deployed) will be naturally greater.
To address your problem, try using the directory deployment. This means that the web application will not be residing within the config-store and consequently will not be zipped or deployed, thereby drastically reducing the deploy times.
How to do directory deployment?
1. Unzip your web application to a directory (on the server-side)
2. Use the --file-on-server option to add-webapp
3. Give the path to the extracted web application directory as the war file path
# 3
Instead of unzipping, you can also use the --directory option and get the war file extracted in a location outside of the config-store.
The above step replaces the points 1 and 2 of the previous post.