So, I've deployed my first rails app, however I'm the only one hitting it for now.
I've noticed that the first time I hit the app after some long period, it takes a really long time to respond (2-3 seconds). After that, it's very fast.
At first, I thought it might be my VPS "waking up" from some sleep state, but Rails does log the long load time (log below).
My app just uses the database for login/user auth. Otherwise, it serves up pages on the filesystem in textile and renders them as HTML. There is no explicit caching done by me, and the filesystem/ textile/rendering is all hand-rolled (so there's no caching done implicitly).
What are some things I should look for to understand why this happens?
log of two sequential requests for the same page:
Processing WikiPagesController#show (for 98.218.223.189 at 2009-08-12 20:16:41) [GET] Parameters: {"id"=>"MainPage"} Rendering template within layouts/application Rendering wiki_pages/show User Columns (1.3ms) SHOW FIELDS FROM `users` User Load (0.4ms) SELECT * FROM `users` WHERE (`users`.`id` = 4) LIMIT 1 Repopulating the stop words Rendered common/_header (16.7ms) Rendered common/_nav (4.4ms) Rendered common/_search (2.4ms) Rendered common/_footer (0.6ms) Completed in 2422ms (View: 134, DB: 2) | 200 OK [http://myserver.com/ wiki_pages/MainPage]
Processing WikiPagesController#show (for 98.218.223.189 at 2009-08-12 20:17:04) [GET] Parameters: {"id"=>"MainPage"} Rendering template within layouts/application Rendering wiki_pages/show User Load (0.4ms) SELECT * FROM `users` WHERE (`users`.`id` = 4) LIMIT 1 Rendered common/_header (10.9ms) Rendered common/_nav (1.6ms) Rendered common/_search (1.7ms) Rendered common/_footer (0.2ms) Completed in 138ms (View: 53, DB: 0) | 200 OK [http://myserver.com.com/ wiki_pages/MainPage]