简体   繁体   English

Google Compute Engine网络会话挂起

[英]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. 我已经使用Google Cloud SQL和Cloud DNS在Google Compute Engine上设置了Ruby on Rails服务器。

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. 我正在运行Debian,并从Phusion存储库的软件包中安装了Passenger / NGinx,我相信所有虚拟主机等都已正确设置,我的乘客最少实例设置为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. 到目前为止,App一切正常,并且运行良好,但是在尝试访问应用程序浏览器时,经常会永久挂起,一直挂着“等待[域名]”,最终超时。 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). 这不是应用程序实例已经超时并且必须启动,我至少要连续运行2个(并且启动它们的时间不会太长)。

I have used the same Chef recipes to build the server as I have done on AWS and never had this problem there. 我使用与在AWS上完成过的厨师食谱相同的方法来构建服务器,但从未遇到过此问题。

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?? 我有两个指向该服务器的域A记录(带有和不带有www),奇怪的是,有时它仅发生在其中一个上,而另一个则可以(这使我认为网络问题,因为两个配置相同)倾向于认为我在这里遇到DNS或网络问题,想知道是否有人遇到过类似的问题,或者是否有Google员工在监视?

Much appreciate any tips that could help me diagnose the problem as I love Compute Engine and would like to keep using it. 非常感谢所有可以帮助我诊断问题的技巧,因为我喜欢Compute Engine并且希望继续使用它。

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. 如果没有,尝试仅使用IP地址连接到应用程序似乎很有用。 If that never has a problem, then DNS is strongly implicated as the source of the trouble. 如果那永远不会有问题,那么DNS就是造成问题的根源。

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. 如果甚至IP地址连接也有问题,则可以尝试在VM上运行tcpdump,以查看是否有问题时流量是否甚至到达实例。 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. 从浏览器调用应用程序后,检查您是否很快就在nginx访问日志中获得一个条目,以查看是否收到连接。

Try telnetting your web server on port 80 with different domains and see if response is immediate. 尝试使用不同的域在端口80上远程登录Web服务器,然后查看响应是否立即生效。

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/ . 我建议您使用http://www.webpagetest.org/从不同位置测试该应用程序,并查看它是否也从那里发生,并查看是否是时候使用http://www.bytecheck.com/解决第一个字节问题。

Check even for application problems due to cookie or session related to different domain names. 甚至检查由于Cookie或与不同域名相关的会话而导致的应用程序问题。

Regards. 问候。 Paolo 保罗

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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