I’ve got very ugly results with static site deployment on DO App Platform. Site based on Hugo builder and contain 15k pages. Build time as part whole process take about 2 min which is good result for sure.
But then starting total nightmare. Deployment to CDN stage could take from 34 to infinity minutes. In most cases deployment fails cause there limit for run applied for 1 hour as i remember.
I have try alternative build method with Gitlab CI/CD runner and deploy via rsync to alternative CDN. Whole process take 6 minutes for run and about 5-10 min for changes propagation inside CDN.

So please explain, if possible, why deploy stage took so long time? My results for deployment to DO Spaces ams3 bucket on top of 100Mbit connection from Ukraine via rclone utility:

Transferred:      183.740M / 183.740 MBytes, 100%, 314.105 kBytes/s, Checks:               452 / 452, 100%
Transferred:        17638 / 17638, 100%
Elapsed time:      9m59.4s

Impressive? It is not 34 min and not an hour or more.
Maybe there reasonable to implement deployment by rclone?

1 comment
  • Hi @kamaln7

    Deploy performance is still slow. Any news in created internal ticket from DO engineers?
    regarding to run Hugo in live mode. There is small problem, cause there Hugo crashing too frequently when try to serve 16k pages. in this case simplest thing is to upload files into bucket and serve them through nginx. But this is workaround and completely broke apps concept in my mind.
    Thanks for help

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
Submit an Answer
3 answers
kamaln7 October 1, 2021
Pinned Answer

Hey @DenysK & @eillarra,

A few days ago we released an update to the static site upload process that has brought significant improvements to upload and processing times. If you’re still experiencing slow upload times, please open a support ticket and we’ll take a closer look.

Sorry for the inconvenience and I hope you’ll like the improved performance :)

Hi @DenysK,

Thanks for reporting this. I’ve filed an internal ticket to look into why the file upload is so slow. Until this is addressed, you can run Hugo as a Service instead of a Static Site. This will skip the file upload process, but it does mean that you won’t be able to make use of the 3 free static sites perk. It will still be fronted by the Cloudflare CDN so you can make use of caching.

If you’d like to try it out, a run command such as this one should work. You might want/need to customize it a bit based on your site. Also, look into configuring Cache-Control headers as well. If you want to replicate the Static Sites’ headers, you can use Cache-Control: public,max-age=10,s-maxage=86400.

Run command:

hugo server --bind=0.0.0.0 --port=$PORT --appendPort=false --disableBrowserError=true --minify=true --watch=false

Thanks for the update @DenysK. We are still working on the upload issue. I apologize for the inconvenience here. I’d recommend trying to build the static site one more time in case it was a temporary networking issue. Another option, if Hugo built-in server can’t handle this many files, is to use a Dockerfile to compile the assets and then serve them using nginx. If that would work for you I’d be happy to help you create the Dockerfile.

I’ll let you know once we have an update on the underlying issue.

  • Hi @kamaln7

    Thanks for status update and for help proposal with Dockerfile. I think that i familiar enough with Docker to run nginx as you recommend. This idea already visit my mind, but in this case nginx could be as bottleneck in comparison of serving through CDN.

    Also build fails it is not about of automation if they happens too frequently. I need check for success or failure from my side. In this case there build hook notification to 3dparty url would be useful thing.

    Anyway, thanks for help and have a nice day

    • I understand. Alerts and notifications is another feature we’re working on. Regarding nginx being a bottleneck, Services also use the Cloudflare CDN. So if you set a Cache-Control header like the one I posted above most of the requests will be cached by Cloudflare and so nginx won’t get as much traffic.

      Thanks, you have a nice day as well! :)

  • What is the status of this issue? I am facing similar problems with the static files for a Django application: the static build needs around 10 minutes to complete the “Uploading files to Spaces” part… for 776 files (all small css and js files, icons, etc.).

    If it helps, I have checked the timestamps in the logs and it seems that the upload is happening in chunks of 75 files per minute: upload 75 files, wait a minute, upload 75 files, and so forth.

    • Hi @eillarra, that’s very interesting. Can you please open a support ticket so we can look into this further? We do have some planned work to improve the process of uploading static sites to Spaces, hopefully that will help but unfortunately I don’t have an ETA that I can share.