Hey guys,
I have a rails app sitting on an Ubuntu 9.10 server located here:
If you hit it initially, it takes about 4 seconds to do its initial load. Once the load has happened the server response nearly instantly. Any thoughts as to why the initial http request is so slow? It definitely shouldn't be loading this slowly the first time especially since its near pure text with zero DB calls.
Here's some info:
Ruby 1.9.1-p376 Rails 2.3.5 Gem 1.3.5 MySQL 5.1
-
Found my question. Thanks guys for anyone who looked at this.
-
You should update your original question to include information such as AWS, Apache HTTPd and Mod_Rails/Phusion Passenger.
To answer your question, you should read Phusion Passenger's Apache HTTPd documentation on Spawn settings.
http://www.modrails.com/documentation/Users%20guide%20Apache.html#RailsSpawnMethod
It sounds like you are in conservative spawning mode, and additionally, the first node is not spawned until the first request is made to the site. So I am not surprised that it is taking 7 seconds for the full rails environment to be loaded from disk, injected into a ruby vm, and setup.
You should also look at the RailsAppSpawnerIdleTime and make sure it is suitable high, so your spawned rails instances do not get recycled. I'm assuming this is a dedicated AWS instance for the express purpose of hosting this site, so this should most likely be set to 0 (to disable) with a max number of nodes that can be spawned.
From Scott Markwell
0 comments:
Post a Comment