PhantomJS CPU(核心)是否绑定? [英] Is PhantomJS CPU (core) bound?

查看:158
本文介绍了PhantomJS CPU(核心)是否绑定?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始进行一些基于并行浏览器的测试,并希望了解在达到100%CPU之前,我可以在EC2大盒子上并行运行多少个浏览器.

I'm starting to do some parallel browser based testing and want to see how many browsers I can run in parallel on an EC2 large box before hitting 100% CPU.

我正在使用JMeter Webdriver插件实际运行浏览器.

I'm using the JMeter webdriver plugin to actually run the browsers.

使用FireFox,每个CPU内核实际上只有1个浏览器.在4核盒子上的4个浏览器大约有80%的CPU.使用5种浏览器时,这一比例为95%(不利于性能测试).

With FireFox it's literally 1 browser per CPU core. 4 browsers on a 4 core box is about 80% CPU. With 5 browsers it's 95% (which isn't good for performance testing).

在我开始使用PhatomJS之前,是否有任何基准可以并行运行时将PhantomJS与FireFox(甚至Chrome)进行比较?

Before I go down the path of PhatomJS, are there any benchmarks that compare PhantomJS to FireFox (or even Chrome) in terms of CPU usage when running in parallel?

您知道在达到85%的CPU之前我可以在EC2大盒子上并行运行多少个PhantomJS实例吗?

Any idea how many PhantomJS instances I'll be able to run in parallel on a EC2 large box before hitting 85% CPU?

谢谢 詹姆斯.

推荐答案

按照 Web驱动程序指南

请注意,它主要用于补充JMeter的HTTP Sampler . Web Driver Sampler旨在与HTTP Sampler一起运行,以便从服务器的角度来看,负载类似于生产.同时,Web采样器将模拟服务器负载时与网站/webapp交互的用户体验,从而同时测量真实用户的体验.

it is important to note that this is mainly used to complement JMeter's HTTP Sampler. The Web Driver Sampler is meant to be run in conjunction with a HTTP Sampler so that from the server's perspective, the load is production like. At the same time, the web sampler will simulate the user experience of interacting with the website/webapp whilst the server is under load, hence measuring the real user's experience at the same time.

因此,无论运行完整的还是无头的,运行多个浏览器的想法都不太好. WebDriver JMeter插件的想法是要测试一个一个真实的浏览器实例,以测试Web应用程序,以查看负载是否对实际用户产生负面影响,这些用户在JMeter设计无法覆盖的区域(例如执行JavaScript) /AJAX调用等.

So your idea of running multiple browsers, no matter full or headless, doesn't look good. The idea of WebDriver JMeter plugin is to have one real browser instance crawling web application under test to see whether load has negative impact on real-life users on areas which JMeter can't cover by design like executing JavaScript / AJAX calls, etc.

JMeter中有几个可用的配置元素,使其更像真实的浏览器.考虑使用:

There are several configuration elements available in JMeter to make it pretend more like a real browsers. Consider using:

  • HTTP Cookie Manager - to represent browser cookies and deal with cookie-based authentication challenges
  • HTTP Cache Manager - to act like browser cache (i.e. download embedded resources only once)
  • HTTP Header Manager - to represent browser-derived headers like User-Agent

请参见如何使JMeter的行为更像真实的浏览器指南,以获取更多提示和技巧.

See How to make JMeter behave more like a real browser guide for more tips and tricks.

如果您的用例假设仅基于的基于浏览器的负载测试,建议您参考 Selenium Grid ,它能够编排在不同主机上运行的多个WebDriver实例.

If you use case assumes only browser-based load testing I'd recommend looking into Selenium Grid which is capable of orchestrating multiple WebDriver instances running on different hosts.

这篇关于PhantomJS CPU(核心)是否绑定?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆