views:

411

answers:

4

I issue a simple GET request to my server, and it's coming back after ~1.2 seconds on average (using firebug NET tab, the "waiting for reqponse" part- not even the whole reponse time)

My ping to the server is 0.250

Using Passenger with rails 2.3.3, in the rails log the request is taking ~0.023

My server is on GoDaddy, so I checked their homepage with firebug also- the "waiting for reqponse" time for their page is ~0.320

Worst case should be around 0.4... so where did I lose the other 0.8 seconds?

What else can I check?

Edit:

Seems like it's unrelated to rails- An image request (that only apache responds to, doest hit the rails at all) takes ~1.2 seconds also

A: 

Where your files are hosted from for GoDaddy is not the same as where their homepage is hosted from.

Have you checked other pages you have hosted on the same server? Possibly due to database connections or "slow" connections like that can cause the page to take awhile before it's sent back to the client.

Agent_9191
I checked an image (strait from apache, doesn't hit the rails server at all) and it took ~1.2 also..
amikazmi
A: 

Try setting PassengerPoolIdleTime to 0 in your Servers or VHosts configuration. Maybe your server is shutting down the application instances to fast and spawns a new instance with every request which usualy takes quite long.

Take a look at the documentation for more information on this setting: http://modrails.com/documentation/Users%20guide%20Apache.html#PassengerPoolIdleTime

Mato
already at 0 :)
amikazmi
Try running an instance of your application with mongrel or thin. If the problem still occures you know it's an application bug otherwise it's a problem with apache+mod_rails. Have you installed the latest version of mod_rails? If not you should try updating.
Mato
actually, it seems like it's unrelated to rails- as I commented to 9191, a request to an image from apache takes the same time
amikazmi
will try to update to latest mod_rails..
amikazmi
If the same problem occures when requesting an image then every apache module could cause this problem. Try turning off one by one. You should also check which Multi-Processing-Modul apache is using. If it's an other than mpm-prefork try installing prefork. In my experience prefork is the most relyable MPM for apache.
Mato
A: 

Doesn't sound like it is your problem, but the ISP's.

Can you do a wget to an internal ip/port to your rails app directly (or apache) from the same server? That will tell you if the probaby is in the app stack or further upstream.

If you can, you can use apache tool, called ab "apache benchmark" to help.

The key is having a ssh access to your computer.

bstiles
+1  A: 

GoDaddy may have a reverse-proxy between you and your HTTP server.

They may be doing something like sending you the response headers right away, then possibly serving you the contents of the response from cache.

So, from the standpoint of your HTTP server, the response is transmitted. Then it goes to GoDaddy's reverse-proxy, then finally to your web browser.

shadit
I'd bet that's exactly the problem. As an active podcaster and former Wordpress consultant I've heard of GoDaddy pulling all kinds of weird crap to manage bandwidth and/or security -- and finding someone with a clue who can tell you what's going on when things get broken is nigh impossible.If this app is important, _do not_ host it on GoDaddy. Either get a virtual server slice from somewhere (e.g. SliceHost) or deploy to a dedicated Rails service like Heroku.
SFEley