core icon indicating copy to clipboard operation
core copied to clipboard

Performance concern relating to static publishing

Open brentgriffin opened this issue 9 years ago • 7 comments

Static push of a site with about 100K contentlets took almost 9.5 hours to complete.

I understand that there is extra work in flattening out the site, but this seems way too long to push a site of this size. The complete process takes 34,099 seconds. Which means that on average we are pushing slightly less than 3 contentlets per second.

Here is a breakdown of the push based on log file message (all times are PDT): 15:22 Push Started 20:52 Compression Started 22:07 Started Pushing to S3 00:55 Finished Pushing

I have attached an export trace report from glowroot that shows where the time is being spent. Click on the profile link to expand out the breakdown of how much time was spent in method, etc No one method sticks out to me but perhaps some will to you all.

If no specific method is problematic, typically this means that the real optimization gains are to be had by changing approach. For example, why are we spending over an hour compressing the content only to turnaround and send the individual contents over the wire? Another question: by using the same bundler code as for dynamic push, are we processing dependencies or other things that are not relevant to static push?

Your Environment

  • Project-8 authoring cluster
  • dotCMS version used: Custom build of latest project-8 code (latest as 3pm on 20170808)
  • Operating System and version: aws linux
  • Application Server and version: Tomcat 8.5
  • Java Brand and version: openjdk 8
  • Database and version: Postgres RDS

trace-afterStaticPushOfEntireSiteFinished.html.zip

brentgriffin avatar Aug 09 '17 13:08 brentgriffin

So here is my question, when pushing a fileAsset - are serializing it into the .xml file AND including the file in our bundle? If so, I feel like we don't need to serialize the asset in the .xml (which could be taking a very long time) - just push the included asset.

wezell avatar Aug 09 '17 14:08 wezell

Will i believe this is happening. I was looking at it already

On Wed, Aug 9, 2017 at 10:48 AM Will Ezell [email protected] wrote:

So here is my question, when pushing a fileAsset - are serializing it into the .xml file AND including the file in our bundle? If so, I feel like we don't need to serialize the asset in the .xml (which could be taking a very long time) - just push the included asset.

—

You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/dotCMS/core/issues/12291#issuecomment-321278262, or mute the thread https://github.com/notifications/unsubscribe-auth/ABfteLjEgTbjTRw6pooXjhRND5wF90KVks5sWcaigaJpZM4OyEJT .

dotcmsCodeReview avatar Aug 09 '17 15:08 dotcmsCodeReview

Seems like the tar.gz creation was added here: https://github.com/dotCMS/enterprise-2.x/commit/b62b1d6d9260a9acc12951cf76353f6f81484e32 and I guess it is because it is needed to download the bundle from the portlet? If we want to allow the user to download a Static bundle we should do the tar.gz compress then and not in the Static Push process.

oarrietadotcms avatar Aug 09 '17 15:08 oarrietadotcms

agreed.

On Wed, Aug 9, 2017 at 11:27 AM Oscar Arrieta [email protected] wrote:

Seems like the tar.gz creation was added here: dotCMS/enterprise-2.x@ b62b1d6 https://github.com/dotCMS/enterprise-2.x/commit/b62b1d6d9260a9acc12951cf76353f6f81484e32 and I guess it is because it is needed to download the bundle from the portlet? If we want to allow the user to download a Static bundle we should do the tar.gz compress then and not in the Static Push process.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/dotCMS/core/issues/12291#issuecomment-321290414, or mute the thread https://github.com/notifications/unsubscribe-auth/ABfteIEOahvCT1gZoSLnn377a5-WdKdkks5sWc_rgaJpZM4OyEJT .

dotcmsCodeReview avatar Aug 09 '17 15:08 dotcmsCodeReview

PR (Enterprise/Project-8): https://github.com/dotCMS/enterprise-2.x/pull/500

agomez-dotcms avatar Aug 10 '17 19:08 agomez-dotcms

Hi Guys,

As initial performance improvement following changes were applied via PR documented above:

  1. FileAssetBundler.writeFileToDisk(...): Don't Write File Asset XML on Static Publishing Scenario. It was noticed that XML for the another bundlers (URLMapBundler and HTMLPageAsContentBundler) could not be inhibited because they are subsquently used on remaining bundlers (BinaryExporterBundler, CSSExporterBundler and ShortyBundler).
  2. AWSS3Publisher.process(...): Don't Create Tar file on Static Publishing Scenario. If the user clicks in the UI to download a bundle from a static push, it will give an error - this is acceptable at this time as this will be a known issue for the project-8 build. Functionality will go back to how it was before: https://github.com/dotCMS/core/issues/10740. This known issue will be addressed at some point in the future.

Thanks, Anibal

agomez-dotcms avatar Aug 10 '17 20:08 agomez-dotcms

Passed QA. Tested locally with upgrade from client dataset on dotcms_3.6 to master branch Commit 98c13c555cf1484d3e54dd5dfc2cd4dd49ac6c75 on Sep 28, 2017 Ubuntu 14.04.1 / Postgres 9.3.7 / Chrome v54.0.2840.98 / Tomcat 8 / Java 8

shaydotcms avatar Sep 29 '17 18:09 shaydotcms