mars/create-react-app-buildpack

High memory consumption - is there anything one can do?

donatoaz opened this issue ยท 3 comments

I am running a simple SPA, nothing fancy, but each time I deploy I get several memory exceed errors on my Hobby tier dyno.

Is there anything I can do to debug or optimize this?

image

mars commented

Hi @donatoaz ๐Ÿ˜„

That high memory usage does seem strange, because this buildpack launches Nginx to serve the React build. It typically consumes less than 30MB memory.

Wondering if you are launching a different process:

Have you defined a Procfile? If so, what does it contain?

Otherwise, have you combined this app with more buildpacks? What does heroku buildpacks return?

mars commented

Do you have a lot of traffic/visitors to your app?

Hi @mars thanks so much for the attention. It is totally my fault. I had the buildpack set up on the prod env (which is also a paid dyno) and therefore had a really low mem consumption, but not on my staging env -- which was still using heroku's own heroku/nodejs.

All good now (see before/after shot when I changed to your buildpack ๐ŸŽ‰)
image

heroku buildpacks --app ctw-staging
=== ctwportal Buildpack URL
mars/create-react-app