peatio icon indicating copy to clipboard operation
peatio copied to clipboard

Performance of initial HTTP GET is not great

Open nchigwamba opened this issue 8 years ago • 2 comments

When are I restart my containers, the first HTTP GET to / takes long to return. It appears as if there are some blocking DB reads. Do we have to do the reads synchronously?

peatio_1             | Started GET "/" for 172.18.0.13 at 2018-04-01 23:30:43 +0000
peatio_1             | Processing by WelcomeController#index as HTML
peatio_1             |   Member Load (0.6ms)  SELECT  `members`.* FROM `members` WHERE `members`.`disabled` = 0 AND `members`.`id` = 3  ORDER BY `members`.`id` ASC LIMIT 1
peatio_1             |   Currency Load (0.6ms)  SELECT `currencies`.* FROM `currencies` WHERE `currencies`.`visible` = 1
peatio_1             |   Currency Load (0.7ms)  SELECT  `currencies`.* FROM `currencies` WHERE `currencies`.`type` = 'fiat'  ORDER BY `currencies`.`id` ASC LIMIT 1
peatio_1             |   Account Load (0.6ms)  SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`member_id` = 3
peatio_1             |   Currency Load (0.6ms)  SELECT  `currencies`.* FROM `currencies` WHERE `currencies`.`id` = 1 LIMIT 1
peatio_1             |   Currency Load (0.7ms)  SELECT  `currencies`.* FROM `currencies` WHERE `currencies`.`id` = 2 LIMIT 1
peatio_1             |   Currency Load (0.6ms)  SELECT  `currencies`.* FROM `currencies` WHERE `currencies`.`id` = 3 LIMIT 1
peatio_1             |   Rendered welcome/index.html.erb within layouts/landing (14.7ms)
peatio_1             |   Rendered shared/_meta.html.erb (0.1ms)
peatio_1             |   Rendered shared/_sentry.html.erb (0.1ms)
peatio_1             |   Rendered shared/_theme.html.erb (7.6ms)
peatio_1             |   Rendered shared/_html5.html.erb (27.6ms)
peatio_1             |   Rendered shared/_alert.html.erb (0.3ms)
peatio_1             |   Rendered shared/_footer.html.erb (0.1ms)
peatio_1             | Completed 200 OK in 472ms (Views: 443.2ms | ActiveRecord: 4.4ms)

nchigwamba avatar Apr 01 '18 23:04 nchigwamba

Actually the DB reads are quick but there is a hold up somewhere. Perhaps it's my environment?

nchigwamba avatar Apr 01 '18 23:04 nchigwamba

@nchigwamba Hi

This is normal behaviour since it is required to lazy load many things, initialize libraries, compile ERB templates, and lot of stuff. In case of development env it takes much more time because of Sprockets.

yivo avatar Apr 02 '18 09:04 yivo