简体   繁体   中英

Google Compute Engine web sessions hanging

I've set up a Ruby on Rails server on Google Compute Engine, using Google Cloud SQL and Cloud DNS.

I'm running Debian with Passenger/NGinx installed from packages from the Phusion repositories, I believe that all vhosts etc are set up correctly, I have passenger minimum instances set to 2.

All good so far, App is up and running all good, but very regularly when trying to access the application browsers hang forever saying 'waiting for [domain name]' and eventually time out. This happens from multiple browsers in various locations throughout the day, but it is intermittent.

This is NOT the application instances having timed-out and having to start up, I have a minimum of 2 running continuously (and they don't take THAT long to start).

I have used the same Chef recipes to build the server as I have done on AWS and never had this problem there.

I have two domain A records pointing to this server (with and without www) and bizarrely it sometimes happens on only one of them while the other one is ok (which make me think network problems, as the two are configured identically) I am strongly inclined to think I am having DNS or network issues here and wonder if anyone has had similar issues or if any Googlers are watching??

Much appreciate any tips that could help me diagnose the problem as I love Compute Engine and would like to keep using it.

Does your app rely on the hostname you used to contact it? If not, it seems useful to try connecting to the app using only the IP address. If that never has a problem, then DNS is strongly implicated as the source of the trouble.

If even the IP-addressed connection has the problem, you can try running tcpdump on the VM to see if when you have a problem whether the traffic is even reaching the instance or not. If it isn't, network problems are implicated. If it is, the app is implicated.

Check if after calling the application from browser you soon get an entry in nginx access log to see if connection is received.

Try telnetting your web server on port 80 with different domains and see if response is immediate.

I suggest you to test the application from different locations with http://www.webpagetest.org/ and see if it happens from there too and see if it's a time to first byte problem with http://www.bytecheck.com/ .

Check even for application problems due to cookie or session related to different domain names.

Regards. Paolo

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM