Meteor building app takes about 35minutes, is it normal?

Hi, I would like to ask, if Meteor (middle size react app) building time about 30minutes in Gitlab shared runners is normal /I’m calculating only real building time without time to build docker container, without npm install and etc./.

On my 4-years old notebook with Ubuntu20.04, 32GB RAM and i7, in localhost, building time is about 7minutes.

I also tried to connect my virtual server with 6CPU cores and 8GB memory to Gitlab Shared runners, the building time is also about 30minutes.

5minutes of building is ok, but 30min? It’s too much I think.
How long takes an app building in your case? What I can do to make building faster?

Thanks a lot for each help.

It shouldn’t take 30 minutes. I wrote a blog post about how to optimize it for CI: Optimizing CI for Meteor, but even without those optimizations it shouldn’t be that slow. To know why it is slow, you can set the METEOR_PROFILE env var to 100. While Meteor builds the app, it will log how long each step in the build process took.

1 Like

How much memory are the runners configured to use?

Meteor builds tend to be RAM intensive and if there’s not enough, will slow down with agressive swapping to disk.

Im goying to try it and I will let you know.

Runners are currently set to 8GB RAM // WRONG INFO

Runners are currently set to 24GB RAM and 8 CPU cores. Yesterday I was trying to build app with this runner, but after 30minutes, I manually stopped building.

Hi @coagmano, I’m really sorry for the later answer. I buyed a new server for the runner with the latest generation of Xeon 2245 and 256GB ECC RAM, I’m using only native Ubuntu 20.04 and Docker /no virtual or nothing else/ - the building is taking now about 6min., it’s much better, but still I think, that this is not normal.

Because, I have enough RAM, I set the gitlab-runner to use a ramdisk, but still the building is taking about 5-6min.

Thanks a lot for your help.

Hi @zodern, as I written to @coagmano, I changed the runner server for the new one, with latest Xeon 2245 and 256GB ECC RAM, the building takes about 6 minutes, but it’s still a long time.

By your recommendation, I used the METEOR_PROFILE env variable and I’m sending the result:

| Top leaves:
| other Target#minifyJs…53,242 ms (2)
| Babel.compile…23,870 ms (765)
| meteorNpm.runNpmCommand…14,960 ms (15)
| other Builder#copyNodeModulesDirectory…12,137 ms (120)
| files.readFile…9,728 ms (304955)
| CssTools.minifyCss…7,619 ms (64)
| files.watchFile…7,345 ms (1405229)
| files.stat…7,083 ms (464360)
| files.writeFile…4,655 ms (150290)
| other compileUnibuild (the app)…4,057 ms (3)
| files.rm_recursive…3,816 ms (402)
| other…3,558 ms (1202273)
| other minifyCssFiles…3,328 ms (62)
| other ImportScanner#scanImports for the app…2,890 ms (3)
| other _downloadMissingPackages…2,861 ms (1)
| other reifyCompileWithCache…2,853 ms (4081)
| linker File#computeAssignedVariables…2,008 ms (5883)
| sha1…1,867 ms (152291)
| files.lstat…1,750 ms (187192)
| files.mkdir…1,524 ms (17915)
| getPrelinkedFiles toStringWithSourceMap…1,392 ms (329)
| other optimistic hashOrNull…1,336 ms (133734)
| linker File#getPrelinkedOutput…1,213 ms (6300)
| other Input#loadFromCatalog…1,161 ms (1)
| other ImportScanner#resolve…801 ms (14983)
| files.unwatchFile…784 ms (94615)
| other Builder#_ensureDirectory…658 ms (14224)
| other meteorNpm.isPortable…529 ms (16963)
| files.readdir…522 ms (18216)
| CssTools.stringifyCss…466 ms (32)
| generate constraints…458 ms (1)
| other meteorNpm.rebuildIfNonPortable…450 ms (107)
| other linker Module#getPrelinkedFiles…449 ms (288)
| other PackageSource#_findSources for os…414 ms (1)
| files.copyFile…402 ms (15607)
| other ImportScanner#scanImports for base64…349 ms (2)
| other optimistic readFile…316 ms (272422)
| plugin fourseven:scss…301 ms (2)
| sqlite query…264 ms (392)
| other bundler writeSiteArchive…237 ms (1)
| other ImportScanner#scanMissingModules for react-meteor-data.232 ms (2)
| shouldWatch…198 ms (108475)
| CssTools.parseCss…191 ms (32)
| other Target#_emitResources…191 ms (3)
| require("./security.js")…187 ms (6)
| other PackageSourceBatch#_linkJS…180 ms (288)
| files.readdirWithTypes…169 ms (19343)
| other linker.fullLink…146 ms (288)
| other JsImage#write…144 ms (9)
| CssTools.rewriteCssUrls…139 ms (32)
| other optimistic lstat…134 ms (131333)
| other PackageSourceBatch.computeJsOutputFilesMap…128 ms (3)
| other ImportScanner#readFile…125 ms (2704)
| files.rename…101 ms (4942)
| minimize conflicts…101 ms (1)
| (#1) Total: 340,087 ms (meteor build)




“dependencies”: {
“devDependencies”: {




meteor-base@1.4.0 # Packages every Meteor app needs to have
mobile-experience@1.1.0 # Packages for a great mobile UX
mongo@1.10.0 # The database Meteor supports right now
reactive-var@1.0.11 # Reactive variable for tracker
tracker@1.2.0 # Meteor’s client-side reactive programming library

standard-minifier-js@2.6.0 # JS minifier run for production mode
es5-shim@4.8.0 # ECMAScript 5 compatibility for older browsers
ecmascript # Enable ECMAScript2015+ syntax in app code
shell-server@0.5.0 # Server-side component of the meteor shell command



Meteor version 1.11.1

The meteor_js_resource file with using dynamic imports have 742kB.