Slow performance
gavD opened this issue · comments
Gavin Davies commented
Hello,
I'm trying to migrate from the apparently abandoned gulp-s3.
My site has only a handful of files - 5mb in total. Each one seems to take 30 seconds to a minute to upload - gulp-s3 went through the whole site in about 1 minute so something's clearly wrong.
snippet:
[12:03:33] Starting 'aws-deploy'...
[12:03:33] [cache] apple-touch-icon-precomposed.png
[12:05:35] [update] default.js
[12:05:36] [skip] favicon.ico
[12:05:36] [skip] feed.xml
[12:05:38] [update] index.html
[12:05:38] [skip] robots.txt
[12:05:38] [skip] sitemap.xml
[12:05:39] [update] activity/index.html
[12:05:53] [update] blog/index.html
[12:05:55] [skip] img/c04.gif
here's part of my gulp file:
gulp.task('aws-deploy', ['build'], function() {
var publisher = awspublish.create({
"params": {
"Bucket": "redacted"
},
"accessKeyId": "redacted",
"secretAccessKey": "redacted"
});
// define custom headers
var headers = {
'Cache-Control': 'max-age=86400, no-transform, public'
};
return gulp.src('./build/**')
.pipe(publisher.publish(headers))
.pipe(publisher.cache())
.pipe(awspublish.reporter());
});
Note the lag between the icon and default.js
Where can I start diagnosing this problem?
Thanks,
- Gavin
Gavin Davies commented
Parallelizing this as per the docs gave me a speed boost:
return gulp
.src('./build/**/*.*')
.pipe(parallelize(publisher.publish(headers), 50))
.pipe(publisher.cache())
.pipe(awspublish.reporter());