腾讯TGW简介

腾讯网关TGW基础原理入门 在十几年前,中国的网络运营商主要有电信和联通两大运营商,又戏称南电信北网通,电信和网通分别布设了光缆,同一个运营商内相互联通,但运营商与运营商间互通需要经过专门的网络通道,一个是带宽有限,另一个是互通通道主要布置在骨干网,所以,在南方地区用电信的客户去访问网通的网站或者游戏,访问路径会变长,带宽受限,访问延迟高,反之也一样。首先看 TGW 的业务特点。但随着平台的迭代演进,随着性能和可靠性的提升,如何在兼顾性能和可靠性的前提下,不断给 TGW 新增新的功能,保障其可扩展性和可维护性,也会有很多技术挑战。 阅读详情

1. 什么是TGW?

TGW,全称Tencent GateWay,是一套实现多网统一接入、外网网络请求转发、支持自动负载均衡的系统。
TGW向开发者免费提供服务,基于HTTP协议的应用可以直接接入,基于其他私有协议的应用只需要进行少量改造即可快速接入。
TGW自动进行域名解析,应用接入TGW后,即可使用域名方式对外提供服务,以及电信/联通/移动三网接入。
此外,TGW支持后端带权重的负载均衡,应用无需关注负载均衡。

2. 为什么需要进行外网收敛?

IPV6由国际组织负责,由于IP地址是网络资源,涉及全球各方利益,需要多方协调斡旋,短期内看不到飞跃性进展。
而作为当前主流的IPV4,其IP地址资源在可以预计的几年内将会被全部占用,即将出现外网IP资源用完的情形。

目前互联网上的许多业务和应用,特别是多区多服的WebGame,常常会有多个专区,每个专区一个域名,对应一台服务器,由服务器自身的外网IP直接提供80和443服务。这种情形在未来IP资源短缺的情况下,将会遭遇危机。
因此,应该尽早考虑收敛外网IP,以应对上述危机。

3. 为什么选择TGW?

TGW具有低成本、高价值、优服务的优势:

1. 极大降低成本
TGW大量节省Real Server上的外网IP,收敛比为:30:1,原本要30个外网IP服务器才能支撑的应用,接入TGW后只需1个外网IP服务器,因此节省了申请带外网IP机器的成本。

2. 统一接入,多网合一
TGW适用所有外网访问请求,业务接入TGW后即默认具备电信 、联通、移动三网接入能力。业务接入TGW简单迅速,基于HTTP的应用不用改造,其他私有协议的应用只需进行少量代码改造。
除此之外,还能解决电信、联通用户访问延时大的问题。

3. 更优的接入层负载均衡
TGW是一个替代现有LVS和QHTTPD的接入层负载均衡方案,具有动态负载均衡、系统监控、容灾切换、告警通知、平滑扩容、安全备份等特性。

4. 更安全
接入服务器去掉外网之后,不会直接受到攻击,提高了服务器的安全性。
由于TGW自身服务器具备专业的网络防御能力,并减少了业务服务器暴露在外网的IP数量,因此能有效防范业务服务器遭受外网攻击。

下一代 TGW 从13Mpps到50Mpps性能优化之旅 本文作者:janmeshe,腾讯 TEG 后台开发工程师0 导语性能优化是一条既充满挑战又充满魔力的道路,非常幸运如今基于 X86 的性能优化方法及工具已经比较成熟,在 TGW 产品架构... 阅读详情

相关推荐

万台服务器一人挑的奥秘

本文根据 2018 GOPS·深圳站演讲整理发布作者: 张黎明作者介绍:张黎明,SNG组件运维团队负责人,有八年的运维经验。参与了国内社交平台QQ、Qzone发展壮大到成...

高效运维 5425

腾讯TEG技术工程事业群-技术运营一面凉经

腾讯TEG技术工程事业群-技术运营一面凉经 1.介绍腾讯TEG事业群的工作内容 2.你对技术运营岗位的看法 3.你都用过哪些Linux开源程序 apache、vsftpd、bind 4.了解过nginx吗 5.你在使用apache过程中遇到过什么问题,怎么分析的 这个地方问了很多,比如进程的问题,为什么apache访问速度慢,什么原因导致的 6.获取当前系统中的tcp连接数 7.获取一小时内每个IP访问服务器的次数 8.用过awk吗?如果我要替换文中字符,行间用tab分割,用awk怎么解决? 9.一行命令完

weixin_46775266的博客 2600

腾讯网关TGW:用户无感知快速迁移及故障自愈能力

腾讯网关团队与清华大学联合撰写的学术论文《TGW: Operating an Efficient and Resilient Cloud Gateway at Scale》成功入选2025年度USENIX年度技术会议(USENIX ATC '25)。该论文详细介绍了腾讯TGW云网关架构,重点展示了其无损快速迁移、故障自愈及高精度故障定位等核心能力。TGW系统已在腾讯生产环境中稳定运行多年,支持游戏、直播、金融等业务场景,具备高效转发、秒级弹性伸缩、智能高可用等特性。论文还深入解析了TGW的架构设计、关键技术

银行信息系统应用架构详解 1311

腾讯云公网负载均衡技术实现详解

CLB简介传统的LVS负载均衡是一种集群(Cluster)技术,采用IP负载均衡技术和基于内容请求分发技术。LVS有三种工作模式DR模式、NAT模式及TUNNEL模式,三...

Java 架构师之路 670

ftxproxy:不到100行代码实现代理服务,并穿透腾讯TGW进行tcp代理,项目借用国外大神代码 http

ftxproxy 不到100行代码实现代理服务,并穿透腾讯TGW进行tcp代理,项目借用国外大神代码 使用方式 # l:绑定本地端口 # r:绑定远端代理IP:端口 # t:信任IP[可选],设定本参数后(仅支持单一IP),只有此IP可以连接l绑定的端口 chmod +x ftxproxy.py ./ftxproxy.py l:local_port r:remote_ip:remote_port [t:trust_ip] 注意事项 当远端出错或者拒绝连接时程序会退出,可以使用supervisor管理进程 每个进程只支持绑定一个代理端口 本脚本没有进行大规模并发测试,请勿用于关键系统 联系方式 Email: puluto#gmail.com QQ: 34201567 欢迎提出建议以及pull request.

tencent-apigateway:使用无服务器组件轻松配置腾讯API网关

腾讯云API网关组件 简介 通过API网关组件,可以快速,方便的创建,配置和管理腾讯云的API网关产品。 快速开始: 1.安装 通过npm安装最新版本的 $ npm install -g serverless 2.配置 本地创建serverless.yml文件,在其中进行如下配置 $ touch serverless.yml # serverless.yml org : orgDemo app : appDemo stage : dev component : apigateway name : apigwDemo inputs : region : ap-guangzhou pro

半小时学会Amazon Transit Gateway

Amazon Transit Gateway (TGW) 是一个强大的网络连接服务,用于在不同的VPC(虚拟私有云)之间实现高效互联。本文将指导您如何创建和配置TGW,以便实现跨账户和跨区域的VPC互联。

改变世界,改变自己 1984

《腾讯公网网关 TGW 的十年演进和思考.pdf》

《腾讯公网网关 TGW 的十年演进和思考.pdf》

腾讯TGW连接中要注意的问题

一,根据腾讯的TGW协议改造客户端。 二,在进行socket连接的时候,客户端连接的ip是腾讯分给的域名,不能用ip地址直接连接 三,在接入tgw的时候,端口需要在腾讯管理平台进行和域名绑定。 四,服务器端在接第一个包含tgw包的时候,只解析出不,不要做任何反回信息。只忽略就可以了。

王广帅--游戏开发-服务器开发 2755

保姆级教程:用SOEM主站搞定汇川SV660N伺服驱动器的EtherCAT通讯(附完整C代码)

本文提供了一份详细的SOEM主站与汇川SV660N伺服驱动器EtherCAT通讯的实战教程,涵盖环境搭建、状态机理解、PDO映射配置、CiA402状态机实战、实时性能优化及诊断调试等关键步骤,并附完整C代码示例,帮助开发者快速实现工业级EtherCAT控制。

weixin_28292761的博客 302

从YOLOv8到RTDETR:如何将训练后的YOLO指标无缝转换为COCO格式

本文详细介绍了如何将训练后的YOLOv8指标无缝转换为COCO格式,特别适用于RTDETR模型的评估。通过数据准备、指标转换流程和实际项目经验,帮助开发者解决YOLO与COCO指标差异问题,提升模型评估的准确性和权威性。

weixin_29085151的博客 378

关于腾讯socket的tgw的转发问题

对于flash跟其他语言对接的socket通讯问题   由于腾讯取消了ip的分配  取而代之的是使用域名  所有 他重2012-6-1号之 所有接入腾讯的socket通讯都必须采用tgw通讯模式   843端口已有腾讯服务器做过处理  因此第三方针对于843端口 不 需要做任何修改  但是对于其他socket端口的话      必须对原有通讯协议做修改   具体

做个充实的人 2173

STM32 ADC精准采集12V电池电压:从分压电路到软件校准全解析

本文详细解析了STM32 ADC精准采集12V电池电压的全过程,涵盖分压电路设计、电阻选型、ADC配置优化及软件校准方法。针对电池电压监测中的噪声、温漂等挑战,提供了硬件滤波与软件过采样等实战技巧,确保测量精度达到1%以内,满足嵌入式设备对电源管理的严苛要求。

tech5的博客 1013

长连接网关技术专题(十一):揭秘腾讯公网TGW网关系统的技术架构演进

本文从腾讯公网TGW网关系统的应用场景、背景需求讲起,重点解析了从山海1.0架构到山海2.0架构需要解决的问题和架构规划与设计实现,以及对于未来TGW山海网关的发展和演进方向。

hellojackjiang2011的博客 402

MQL5教程 01 MT5有关EA的操作、MetaEditor 工具栏主要功能

MQL5教程 01 MT5有关EA的操作、MetaEditor 工具栏主要功能

weixin_42830015的博客 3983

Mamba-YOLO实战:环境配置+模型训练+精度调优全流程指南(附Colab代码)

在目标检测领域,一场由状态空间模型引发的技术革新正在悄然改写行业格局。近期国际顶级学术期刊连续发布的YOLOv5_mamba、FER-YOLO等突破性成果,不仅刷新了检测精度记录,更开创了结构化状态空间模型(SSM)与经典检测框架的创新融合范式。当前该领域涌现的十大标杆性研究,已在以下维度取得突破性进展:√ 遮挡目标识别准确率提升38%√ 小样本场景泛化能力增强2.7倍√ 视频流检测延迟降低至17ms√ 多目标交叉干扰抑制效果达SOTA。

2501_90555291的博客 1581

腾讯网络技术TGW

TGW全称为Tencent Gateway,是一套实现多网统一接入、外网网络请求转发、支持自动负载均衡的系统。 1、服务器接入TGW可以节约外网IP地址,原来每个服务器需要一个外网IP,现在30个服务器只需一个外网IP,节约了申请外网IP的费用。 2、接入TGW的业务默认具备电信、移动、联通三网接入能力。 3、接入TGW可以实现动态负载均衡、系统监控...

weixin_34041003的博客 1420

【Bug已解决】Codex Desktop 更新后无法启动/闪退解决方案

方案适用场景推荐指数清理本地缓存重启最常见、最应优先尝试的方案⭐⭐⭐⭐⭐完全卸载重装缓存清理无效时的进阶方案⭐⭐⭐⭐详细日志定位崩溃环节需要精确诊断问题原因⭐⭐⭐⭐锁定旧稳定版本确认是特定版本缺陷时的过渡方案⭐⭐⭐反馈官方支持团队自助方式无效时的最终途径⭐⭐⭐⭐Codex Desktop 更新后无法启动/闪退的本质通常是新版本程序在启动时读取到了旧版本遗留的、格式不兼容的本地缓存或配置数据,导致启动流程中途崩溃。

一键难忘的博客 6286

求教:可组合的网络协议设计与实现

赖勇浩(http://laiyonghao.com)最近在折腾项目在腾讯开放平台的上线问题。其中有一点是网络协议的设计与实现。应用层协议很容易解决:我们使用 google protobuf 的 RPC。一开始,我们直接在 TCP 协议之上实现的,随着以下 3 个需求的出现,我的麻烦大了:1、服务器应用运行在腾讯云计算服务器时,需要接入 TGW(见 http://wiki.open.qq.com/w

赖勇浩的编程私伙局 8156

Python 爬虫教程:财经新闻实时抓取(最新资讯 + 关键词提取)

在当今信息爆炸的时代,财经新闻的实时获取对于投资者、研究人员以及普通大众来说都具有重要的价值。通过 Python 爬虫技术,我们可以高效地抓取财经新闻,并提取其中的关键信息,以便更好地进行数据分析和决策支持。本文将详细介绍如何使用 Python 编写一个财经新闻实时抓取系统,并结合关键词提取技术,帮助读者快速掌握 Python 爬虫的核心技能。

yansideyucsdn的博客 1049

基于YOLOv10的机器人抓取引导系统:从物体检测到精准抓取

python# 数据标注工具简化版import os"""启动标注工具""""""标注单张图像"""print(f"标注图像: {os.path.basename(img_path)}")print("请在图像上绘制抓取矩形框...")# 这里应该实现交互式标注界面# 简化版本直接返回示例标注# 示例标注数据"""保存标注结果"""# 保存为YOLO格式# 转换为YOLO格式。

YOLO 377

[架构]负载均衡

待续!

xxx 132

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

腾讯云事件总线:构建毫秒级响应的下一代事件驱动架构

腾讯云事件总线通过。

wenghongzhang的博客 1043

IMSL CNL 7.0.0 (x86-64)Crack

IMSL CNL 7.0.0 (x86-64)Crack intel的算法库破解文件,这是C++版本的破解文件

VC中sqlite的使用

在VC中对sqlite的使用,实现数据库大批数据的快速插入,读取数据库中的数据在ListCtrl中显示

上一篇: NoSQL 在腾讯应用实践
下一篇: 高性能Web服务器 Lighttpd
kobejayandy
博客等级 码龄18年 2853粉丝 43原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值