Top Menu

Jump to content
Home
    Modules
      • Projects
      • Activity
      • Work packages
      • Gantt charts
      • Calendars
      • Team planners
      • Boards
      • News
    • Getting started
    • Introduction video
      Welcome to OpenProject Community
      Get a quick overview of project management and team collaboration with OpenProject. You can restart this video from the help menu.

    • Help and support
    • Upgrade to Enterprise edition
    • User guides
    • Videos
    • Shortcuts
    • Community forum
    • Enterprise support

    • Additional resources
    • Data privacy and security policy
    • Digital accessibility (DE)
    • OpenProject website
    • Security alerts / Newsletter
    • OpenProject blog
    • Release notes
    • Report a bug
    • Development roadmap
    • Add and edit translations
    • API documentation
  • Sign in
      Forgot your password?

      or sign in with your existing account

      Google

Side Menu

  • Overview
  • Activity
    Activity
  • Roadmap
  • Work packages
    Work packages
  • Gantt charts
    Gantt charts
  • Calendars
    Calendars
  • Team planners
    Team planners
  • Boards
    Boards
  • News
  • Forums

Content

Support Installation & Updates
  1. OpenProject
  2. Forums
  3. Support Installation & Updates
  4. [SOLVED] Every page take 4 seconds to load

[SOLVED] Every page take 4 seconds to load

Added by Jasper Visser over 11 years ago

Hi,

I have a fresh local installation of openproject on a fairly high-end laptop (16GB/8-core/SSD). For some reason, every page under http://localhost:3000 takes ~4 seconds to load.

There’s surprisingly little variance. It’s almost 4 seconds for every page, regardless of the page content. If I look at the output of script/server:

  1. First it waits ~3.5 seconds (no logging)
  2. Then follow the queries (each takes 0-2 ms)
  3. Finally it logs something like Completed in 4340ms (View: 3943, DB: 24) | 200 OK [http://localhost/projects/axle/activity]

I tried to google for this problem. My best guess is that it might have something to do the number of gems installed. It does seem likely, because the long wait occurs before the script starts doing any work. I’m not really familiar with Ruby.

Can anyone point me in the right direction of how I could approach solving this problem?

Yours,

Jasper


Replies (8)

RE: Every page take 4 seconds to load - Added by Philipp Tessenow over 11 years ago

Hi Jasper,

the 4 second delay is just normal, because rails reloads most of the OpenProject codebase (and compiles assets) at every request (I experience a similar delay).

To make things fast, run the app in production mode:

  • bundle exec rake generate_secret_token # only required for the very first time
  • bundle exec rake assets:precompile # required every time the assets change, takes some time
  • edit config/environments/production.rb and change the config.serve_static_assets-setting to true (usually a web server serves assets. You probably have no web server configured at your laptop, so we have to tell rails to do the job)
  • RAILS_ENV=production bundle exec rails server

The very first request takes a second. Every other request should be fast. Remember to restart the server, if you change any code in production mode.

Yours,
Philipp

RE: Every page take 4 seconds to load - Added by Jasper Visser over 11 years ago

Hi Philipp,

Good to hear it’s an expected result. It might be worthwhile to add these steps as an encore to the wiki/Download_and_Installation.

Or maybe this is standard Ruby stuff. Like I said, Ruby is not my language, so I have no idea where it ends and openproject specific code starts. :)

bundle exec rake generate_secret_token
This command also starts the server, which seems odd to me. It also doesn’t log anything related to secret tokens:

haploid@boltzmann:~/git/openproject$ sudo script/server bundle exec rake generate_secret_token
/var/lib/gems/1.9.1/gems/activesupport-2.3.18/lib/active_support/inflector.rb:3:in `<top (required)>': iconv will be deprecated in the future, use String#encode instead.
=> Booting WEBrick
=> Rails 2.3.18 application starting on http://0.0.0.0:3000
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /var/lib/gems/1.9.1/gems/rails-2.3.18/lib/rails/gem_dependency.rb:21.
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2013-09-13 12:16:32] INFO  WEBrick 1.3.1
[2013-09-13 12:16:32] INFO  ruby 1.9.3 (2012-04-20) [x86_64-linux]
[2013-09-13 12:16:32] INFO  WEBrick::HTTPServer#start: pid=4656 port=3000

Is that expected?

bundle exec rake assets:precompile
This just echoes:

haploid@boltzmann:~/git/openproject$ sudo bundle exec rake assets:precompile
rake aborted!
Don't know how to build task 'assets:precompile'

For the record, I am on the master branch of the openproject git. Installed as per the procedure listed under 1.3. Manual installation. The changelog calls it v2.4.0.

config/environments/production.rb
There is no such setting yet to change, but I added it. I do actually have Apache running, and occassionally node or Jetty. :)

RAILS_ENV=production bundle exec rails server
I assume that this should be two separate lines:

RAILS_ENV=production
bundle exec rails server

Got it.

However, after the above, if I start script/server, it says:

/var/lib/gems/1.9.1/gems/activerecord-2.3.18/lib/active_record/connection_adapters/postgresql_adapter.rb:941:in `initialize': fe_sendauth: no password supplied (PGError)

with a nice stack trace that doesn’t seem interesting enough to post here. Maybe related to one of the problems mentioned above?

Yours,

Jasper

RE: Every page take 4 seconds to load - Added by Philipp Tessenow over 11 years ago

Oh I should have asked first which OpenProject version you are running (the rails 2 version behaves different than our current rails 3 version).

Can you, please, run

git branch | grep '*'

and give me the output?

RE: Every page take 4 seconds to load - Added by Jasper Visser over 11 years ago

I’m on github/master. These are the last two commits I see:
069b1c9 Merge pull request #320 from marutosi/finn-eof
eafc68f add newline at end of public/422.html

RE: Every page take 4 seconds to load - Added by Philipp Tessenow over 11 years ago

Good to know. I just gave you the instructions for OpenProject 3.0 (which is in beta at the moment, you’ll find it at the feature/rails3 branch).

Give me a minute to adapt my steps to your branch.

RE: Every page take 4 seconds to load - Added by Jasper Visser over 11 years ago

No hurry at all.

Alternatively, I could switch to 3.0. For the moment, I only plan to use it for my own (small) team, and a certain level of instability wouldn’t bother us.

RE: Every page take 4 seconds to load - Added by Philipp Tessenow over 11 years ago

Ok, lets try again :)
With all command sudo shouln’d be needed. Execute the commands as is (without script/server or anything in front of it)

  • execute bundle exec rake generate_session_store if you not have done that before
  • execute RAILS_ENV=production bundle exec script/server to start the server

RE: Every page take 4 seconds to load - Added by Jasper Visser over 11 years ago

Thanks. Sorry it took me a month to get back to this, but I want to make sure that the thread is closed with the words “SOLVED”. :)

  • (1 - 8/8)
Loading...