windows 网络应用程序的带宽和流量模拟器?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/155329/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 11:21:46  来源:igfitidea点击:

bandwidth and traffic simulator for web apps?

windowslinuxsimulation

提问by paranoio

can you suggest how to create a test enviroment to simulate various types of bandwidths and traffic in a web app ?

你能建议如何创建一个测试环境来模拟 Web 应用程序中的各种类型的带宽和流量吗?

Or maybe a program open source wich does this against localhost ?

或者也许是一个针对本地主机执行此操作的开源程序?

I think this is a very important subject when programming web apps but it is not a usual topic, the only way i can imagine to create such kind of enviroment is to use somekind of proxy in a local network but before start looking into the squid documentation i would like to hear your suggestions .

我认为在编写 Web 应用程序时这是一个非常重要的主题,但它不是一个常见的主题,我可以想象创建这种环境的唯一方法是在本地网络中使用某种代理,但在开始查看鱿鱼文档之前我想听听你的建议。

回答by Owen

if you're using apache you may want to take a look at apache ab

如果您使用的是 apache,您可能想看看apache ab

回答by rupello

There are two approaches to shape network traffic to simulate a network link:

有两种方法可以塑造网络流量以模拟网络链接:

  1. Run some software on the client or server that sits somewhere in the networking stack and shapes the traffic between the app and the network interface
  2. Run the traffic shaping software on a dedicated machine with 2 network interfaces through which your traffic is routed
  1. 在位于网络堆栈中某处的客户端或服务器上运行一些软件,并调整应用程序和网络接口之间的流量
  2. 在具有 2 个网络接口的专用机器上运行流量整形软件,您的流量通过这些接口路由

(2) is a better solution if you don't want to install software on the client or server (and possibly impact performance), but requires more hardware fiddling.

(2) 如果您不想在客户端或服务器上安装软件(并且可能影响性能),但需要更多的硬件摆弄,则是更好的解决方案。

Some other features you might want to think about are what shaping parameters can be simulated. Most do delay and packet loss, some do jitter and bandwidth limiting as well. Some solutions can selectively filter traffic (for instance by port number, TCP or UDP etc).

您可能想要考虑的其他一些功能是可以模拟哪些整形参数。大多数都做延迟和丢包,有些做抖动和带宽限制。一些解决方案可以选择性地过滤流量(例如通过端口号、TCP 或 UDP 等)。

Here is a list of some of the systems I've found:

以下是我找到的一些系统的列表:

Open Source or Freeware

开源或免费软件

DummyNetis an open source BSD Unix-based for dedicated devices. It is not clear if the software is being actively maintained

DummyNet是一个开源的基于 BSD Unix 的专用设备。不清楚软件是否正在积极维护

NistNetis an open source Linux-based system for dedicated devices. The software has not been actively maintained for several years.

NistNet是一个基于 Linux 的开源系统,用于专用设备。该软件已多年未得到积极维护。

Commercial

商业的

Apposite Technoligiessell dedicated hardware solutions for simulating WAN links, with a Web based GUI for configuring the settings and collecting traffic measurements

Apposite Technoligies销售用于模拟 WAN 链接的专用硬件解决方案,带有基于 Web 的 GUI 用于配置设置和收集流量测量

East Coast DataComsell hardware dedicated simulators for simulating routers and modems

East Coast DataCom出售用于模拟路由器和调制解调器的硬件专用模拟器

Itrinegyoffer both dedicated device solutions, and solutions for running on clients or servers.

Itrinegy提供专用设备解决方案,以及在客户端或服务器上运行的解决方案。

Network FXoffer several dedicated device products for simulating network impairments between the client & server

Network FX提供多种专用设备产品,用于模拟客户端和服务器之间的网络损伤

NetLimiteris a client side system that allows throttling of individual applications, and includes a firewall.

NetLimiter是一个客户端系统,允许对单个应用程序进行节流,并包括防火墙。

Shunra Softwareoffer a range of products, from high end enterprise WAN simulation and testing, to a simple client-resident emulator.

Shunra Software提供一系列产品,从高端企业 WAN 模拟和测试,到简单的客户端驻留模拟器。

回答by Gulzar Nazim

The closest I can think of is doing something similar with VEDekstopfrom Shunra..

我能想到的最接近的是与Shunra 的VEDekstop做类似的事情。

Simulating High Latency and Low Bandwidth in Testing of Database Applications

在数据库应用程序测试中模拟高延迟和低带宽

Shunra VE Desktop Standard is a Windows-based client software solution that simulates a wide area network link so that you can test applications under a variety of current and potential network conditions – directly from your desktop.

Shunra VE Desktop Standard 是一种基于 Windows 的客户端软件解决方案,可模拟广域网链接,以便您可以直接从桌面测试各种当前和潜在网络条件下的应用程序。

回答by MarkR

If you are running a Linux box as your server, Linux box as your client, or have the capability to put (perhaps a VM) a Linux router between your client and server, you can use NetEm.

如果您运行 Linux 机器作为服务器,Linux 机器作为您的客户端,或者有能力在客户端和服务器之间放置(可能是虚拟机)Linux 路由器,您可以使用 NetEm。

NetEmis a Linux TC (Traffic Control) discipline which can delay (i.e. add latency) packets leaving a host. Although it's tricky to set up clever rules (e.g. add latency to some traffic, not to others), it's easy to add a simple "delay everything leaving the interface by 50ms" type rules and some recipes are provided.

NetEm是 Linux TC(流量控制)规程,它可以延迟(即添加延迟)数据包离开主机。尽管设置巧妙的规则很棘手(例如,为某些流量添加延迟,而不是为其他流量),但添加简单的“将所有离开接口的所有内容延迟 50 毫秒”类型规则很容易,并且提供了一些方法。

By sticking a Linux VM between your client and server, you can simulate as much latency as you like. And you can turn it on and off dynamically. Linux has other TC disciplines which can be combined with NetEm to restrict bandwidth (but the script to set this up can be somewhat complicated). NetEm can also randomly drop packets.

通过在客户端和服务器之间插入 Linux VM,您可以根据需要模拟尽可能多的延迟。您可以动态打开和关闭它。Linux 有其他 TC 学科,可以与 NetEm 结合使用来限制带宽(但设置它的脚本可能有些复杂)。NetEm 还可以随机丢弃数据包。

I use it and it works a treat :)

我用它,它很好用:)

回答by Matthew Smith

I wrote a php script awhile back which used CURL to run a sequence of page requests against my server which represented a typical use scenario. I had it output the times that it took for the server to respond to each of the requests. I then had another script which spawned a bunch of these test case scripts simultaneously for a sustained period and correlated the results into a file which I could then look at in a spreadsheet to see average times. This way I could simulate the number of users hitting the site that I wanted. The limitations are that you need to run the test script on a different server to the web server and that the client machine can become too loaded to give meaningful results past a certain point. I've since left the job otherwise I would paste the scripts here.

不久前我写了一个 php 脚本,它使用 CURL 对我的服务器运行一系列页面请求,这代表了一个典型的使用场景。我让它输出服务器响应每个请求所需的时间。然后我有另一个脚本,它在一段持续时间内同时生成一堆这些测试用例脚本,并将结果关联到一个文件中,然后我可以在电子表格中查看平均时间。通过这种方式,我可以模拟访问我想要的站点的用户数量。限制是您需要在与 Web 服务器不同的服务器上运行测试脚本,并且客户端机器可能会变得负载过大而无法在超过某个点时提供有意义的结果。我已经离开了这份工作,否则我会把脚本贴在这里。

回答by sammich

As other people have mentioned, Apache's ab(comes with Apache, so you probably have it already) is good.

正如其他人所提到的,Apache 的 ab(随 Apache 一起提供,所以您可能已经有了)很好。

Other good options are:

其他不错的选择是:

I personally like ab and JMeter the best.

我个人最喜欢 ab 和 JMeter。

回答by devXen

回答by Assembler

I haven't used it for years (lack of need, not because I'd found anything else), but xat webspeedwould be the first thing I would point toward

我已经多年没有使用它了(不需要,不是因为我发现了其他任何东西),但是xat webspeed将是我首先要指出的

回答by Maksim

Do not forget about Wanulator (http://www.wanulator.de/). The name Wanulator comes from "WAN" and "simulator. This pretty much describes what the software does: It simulates different Internet conditions such as delay or packet loss. Furthermore it simulates user access line speeds e.g. modem, ISDN or ADSL. Wanulator is currently packaged as a Linux boot CD based on SLAX. This will give you a full out of the box experience. You can turn any PC into a test-system within a blink - just by booting the Wanulator CD. The package already includes useful client SW such as web-browser and network sniffer (Wireshark). Nevertheless if the PC has 2 network interfaces the system can run as an intermediate system between your server and your client - as a switch - without any configuration hassles.

不要忘记 Wanulator (http://www.wanulator.de/)。Wanulator 的名称来自“WAN”和“模拟器”。这几乎描述了该软件的作用:它模拟不同的 Internet 条件,例如延迟或数据包丢失。此外,它还模拟用户访问线路速度,例如调制解调器、ISDN 或 ADSL。Wanulator 目前是打包为基于 SLAX 的 Linux 引导 CD。这将为您提供完整的开箱即用体验。您可以在眨眼间将任何 PC 变成测试系统 - 只需引导 Wanulator CD。该软件包已经包含有用的客户端软件例如网络浏览器和网络嗅探器 (Wireshark). 然而,如果 PC 有 2 个网络接口,系统可以作为服务器和客户端之间的中间系统运行 - 作为交换机 - 没有任何配置麻烦。

回答by Kalpesh Patel

We use Loadrunner to do bandwidth and traffic simulation in our App. Loadrunner is can start agents on various machines and you can simulate one machine as running on dialup modem v/s another on DSL v/s another on Cable internet. We also use Loadrunner to simulate various kinds of traffic conditions from 10 user run to 500 user run. We can also insert think times in the script and simulate a real user executing the http request. The best part is that it comes with a recording studio where it will plug in with Internet explorer and you can record the whole scenario/Usecase that can be as simple as hitting one page to a full blown 50-60 page script or more.

我们使用 Loadrunner 在我们的应用程序中进行带宽和流量模拟。Loadrunner 可以在各种机器上启动代理,你可以模拟一台机器在拨号调制解调器上运行,另一台在 DSL 上运行,另一台在有线互联网上运行。我们还使用 Loadrunner 来模拟从 10 用户运行到 500 用户运行的各种交通状况。我们还可以在脚本中插入思考时间并模拟执行 http 请求的真实用户。最好的部分是它带有一个录音室,它可以插入 Internet Explorer,您可以记录整个场景/用例,就像点击一页到完整的 50-60 页脚本或更多一样简单。