L***s 发帖数: 1148 | 1 http://www.mitbbs.com/article_t0/JobHunting/32638431.html
一个web服务器与50,000个手机保持着TCP连接,
突然服务器崩溃重启,所有的TCP连接全部terminated
(不是半开,要重新从FIN开始握手)。
服务器瞬间要负担50,000个TCP重连请求,
问:服务器端应如何加速这一重连过程? |
b********e 发帖数: 595 | 2 initcwnd 到10?
”服务器崩溃重启“是指server reboot还是crash了,如果是crash有可能 tcp_no_
metrics_save, reboot估计就无关了。 |
g*****g 发帖数: 34805 | 3 What's important for me was to do local caching on the user session, and
the restore can be possible without reading DB and reconstruction. If the
users will be
redistributed, a separate caching server like memcache can be used.
【在 L***s 的大作中提到】 : http://www.mitbbs.com/article_t0/JobHunting/32638431.html : 一个web服务器与50,000个手机保持着TCP连接, : 突然服务器崩溃重启,所有的TCP连接全部terminated : (不是半开,要重新从FIN开始握手)。 : 服务器瞬间要负担50,000个TCP重连请求, : 问:服务器端应如何加速这一重连过程?
|
L***s 发帖数: 1148 | 4 多谢,增大initcwnd应该是有效方法。
应该是reboot。不过缓存ssthresh这一点,虽然在reboot情况下没用,要是提一下还是
加分的。
【在 b********e 的大作中提到】 : initcwnd 到10? : ”服务器崩溃重启“是指server reboot还是crash了,如果是crash有可能 tcp_no_ : metrics_save, reboot估计就无关了。
|
L***s 发帖数: 1148 | 5 多谢指点,豁然开朗!我还是没有系统设计经验,思维局限在单机。
有备份机memcache的话,可以对每个手机终端(IMEI)缓存ssthresh和cwnd,
理论上重启、TCP握手后,貌似server可以恢复到断之前的congestion windows size。
但client端TCP貌似还是要slow start?除非hack TCP协议。
【在 g*****g 的大作中提到】 : What's important for me was to do local caching on the user session, and : the restore can be possible without reading DB and reconstruction. If the : users will be : redistributed, a separate caching server like memcache can be used.
|
g*****g 发帖数: 34805 | 6 I think recovery on application layer is more than enough. If immediate
recovery is critical, a failover strategy should be used instead. e.g. The
next heartbeat/request can be redirected by load balancer to a different
node and the user
session can be recovered from there, instead of waiting on the failed node.
【在 L***s 的大作中提到】 : 多谢指点,豁然开朗!我还是没有系统设计经验,思维局限在单机。 : 有备份机memcache的话,可以对每个手机终端(IMEI)缓存ssthresh和cwnd, : 理论上重启、TCP握手后,貌似server可以恢复到断之前的congestion windows size。 : 但client端TCP貌似还是要slow start?除非hack TCP协议。
|
b********e 发帖数: 595 | 7
客户端应该不会slow start了,当时这个参数的调整就是google对web服务器用来解决
slow start的。发文章的两位里有一位还是华裔呦。
http://www.ietf.org/proceedings/10mar/slides/iccrg-4.pdf
tcp fastopen什么的没有仔细学习,好像是这两年才支持的,一直没关注了,不知道是
不是面试官希望的答案。
http://research.google.com/pubs/author39277.html
我不确认面试问的具体是tcp还是应用层面的问题,如果面的是应用的dev一般不改问这
么底层的东西。
应用层面应该goodbug 更有经验。
【在 L***s 的大作中提到】 : 多谢指点,豁然开朗!我还是没有系统设计经验,思维局限在单机。 : 有备份机memcache的话,可以对每个手机终端(IMEI)缓存ssthresh和cwnd, : 理论上重启、TCP握手后,貌似server可以恢复到断之前的congestion windows size。 : 但client端TCP貌似还是要slow start?除非hack TCP协议。
|
l*****c 发帖数: 316 | 8 求问这些system design的问题看那些书或资源能够自学提高。
.
【在 g*****g 的大作中提到】 : I think recovery on application layer is more than enough. If immediate : recovery is critical, a failover strategy should be used instead. e.g. The : next heartbeat/request can be redirected by load balancer to a different : node and the user : session can be recovered from there, instead of waiting on the failed node.
|
g*****g 发帖数: 34805 | 9 这个主要还是来源于工作经验吧,各大公司的tech blog也不错,了解一下动态,有选
择性的深入了解。
【在 l*****c 的大作中提到】 : 求问这些system design的问题看那些书或资源能够自学提高。 : : .
|
l*****c 发帖数: 316 | 10 有入门的书吗?本人web菜鸟一枚
多谢
【在 g*****g 的大作中提到】 : 这个主要还是来源于工作经验吧,各大公司的tech blog也不错,了解一下动态,有选 : 择性的深入了解。
|