user4227507
user4227507

Reputation:

Ruby on Rails Extremely Slow to Load Pages and Once Load have to Refresh for Buttons to Work

I am creating a cinema system in Ruby on Rails and I BIG problem I am having is that the pages take ages to load, and when they do load the buttons don't work so I have to refresh the page.

I don't know why it does it, but I have a huge CSS, and because its a cinema site I have film images and film trailers; in total the directory is 359MB, with the videos folder (in the public folder) being 266MB.

When I first run the server using rails s I get this output:

Screenshot Screenshot Screenshot Screenshot

I am precompiling the videos and images in config/intitializers/assets.rb:

Rails.application.config.assets.version = '1.0'
Rails.application.config.assets.precompile += ['public/videos']
Rails.application.config.assets.precompile += ['app/assets/images']

I am using Firefox (but its the same on all browsers) and Windows 7.

Can someone please advise me on how to improve this issue.

Upvotes: 0

Views: 1096

Answers (1)

argentum47
argentum47

Reputation: 2382

I think

Firstly its Windows. Ruby is slow in windows, therby rails is slow.

Secondly try puma

Thirdly altough I can't see what the queries are, but I feel you should preload the whatever association you have, if possible, which would reduce the number of queries.

Fourthly, you could run linux on a VM and run rails on it.

Lastly I haven't tried this, see if it is possible to run rails with jRuby. it supports multi-threading and should be faster.

Here is a tutorial on integration of Jruby with existing rails proj..

From Heroku and From other resource, :) , You can skip the pg sql part and replace the pgsql sql driver with mysqll jdbc driver..

Upvotes: 1

Related Questions