W
W
WebDev2019-07-10 11:15:25
Vue.js
WebDev, 2019-07-10 11:15:25

Why is nuxt so slow?

Developed a site on NuxtJs with server rendering. Load tests show that the Application withstands 4 times less load than the same one in PHP. The main load goes to the processor. As I understand it, nuxt builds the project on the fly every time and gives it to the client, although it probably could somehow cache it.
There is no information on this subject on the Internet. Does anyone have experience with nuxt? How do you deal with his slowness?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Evgeniy S, 2019-07-10
@evgensenin

Also noticed the same. (but not directly real slowness, just the response of php applications is an order of magnitude less in milliseconds (ms) than on nuxt), perhaps nodejs features Please
try https://github.com/arash16/nuxt-ssr-cache and write
to just in case - https://nuxtjs.org/api/configuration-build/#cache

D
Dima Pautov, 2019-07-10
@bootd

As I understand it, nuxt every time "on the fly" collects the project and gives it to the client

no, the build was made 1 time and only work is being done with it.
Already a dozen sites are made on nuxt.js and there are no brakes. The assembly on the server is really long (although it is not desirable to assemble it this way, but not about that), but this does not affect the operation of the site in any way.
Because you have brakes, it doesn’t have to be nuxt.js to blame, maybe you have a lot of places that need to be optimized on the front. If you have a rest api, where php is the backend, then you should probably pay attention to the work of the backend and the optimization of mysql queries (if there is a muscle). Because if the api responds for a long time, then nuxt will wait a long time for data, from which it will display the page for a long time, I know, I passed.
There was and is now a project that I did on freelance, because. we have 100500k products, then at the start of the project, when we tested it, in some places the page loading could take about a minute, because inside the backend (php, yii2) the code was organized somewhat poorly. Over time, requests were licked, caching of requests was made, and everything as a whole became ok.
Well, the server itself, the larger the site, the more power you need. We have 4GB so far, 2 cores on Digital Ocean. In the near future, we plan to increase the capacity, because the influx of users is increasing.
When we were just developing the site, we had 1GB and 1 core. This was enough for a couple of months, because. the server could not withstand the load. I had to increase the RAM to 2 GB. And the finished version, as I wrote above, up to 4GB and 2 cores

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question