如何对 SOAP 接口进行负载测试(SOAP 函数调用是原子的)?

发布于 2024-09-19 01:24:39 字数 361 浏览 8 评论 0原文

服务器提供SOAP函数调用接口。
数百甚至数千台 PC 调用该函数。
我需要使用一台 PC 对其进行负载测试。

目前我只有一个 for 循环。这样就够了吗?如果不是,我怎样才能使测试更加真实?

我曾考虑过线程化,但如果 SOAP 函数调用是原子的,那么这并没有什么意义。即使是这样,我的测试 PC 上仍然只能有一个活动线程(每个 CPU)。

我希望这是清楚的,如果不清楚,请询问更多信息。

在一台电脑上模拟多台电脑来测试这一点的最佳方法是什么?


更新一下,我正在使用 VB Express 2008。我不敢相信 .NET 的构造如此之深,以至于它会在 SOAP 远程过程调用期间阻塞 CPU……是吗?

A server offers a SOAP function call interface.
Hundreds, perhaps a few thousand, of PCs call that function.
I need to load test this using a single PC.

At the moment I just have a for loop. Is that good enough? If not how can I make the test more realistic?

I had thought of threading, but if the SOAP function call is atomic then that doesn't buy anything. Even if it does, there can still only be one active thread (per CPU) on my tester PC.

I hope that is clear, please ask for further info if not.

What's the best way to test this, simulating many PCs on one?


Update, I am using VB Express 2008. I can't believe that .NET is so constructed that it will block the CPU for the duration of a SOAP Remote Procedure Call ... or does it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

萤火眠眠 2024-09-26 01:24:39

使用 for 循环,您可能仅发出一个同时请求。运行循环的线程可能会被阻塞,等待响应。请注意,这会阻塞线程,但不会阻塞整个 CPU,它可以由许多线程共享。因此,通过使用多个线程,您可以同时发出多个请求。

现在,服务器上的 SOAP 处理程序可以是单线程的 - 这意味着它只能同时处理 1 个请求。这种情况的可能性要小得多 - 因为服务器框架是专门设计的,以这种方式工作。希望您不会发现这种情况。

您是否已确定需要处理多少同时请求?根据具体情况,即使有 10,000 个活动客户端的集合也可能只生成 10 个并发请求。这将取决于呼叫的频率以及响应持续时间。请求速率(请求/秒)将决定您是否能够可靠/准确地模拟来自单台计算机的所需负载。

Using a for loop, you are probably only issuing one simultaneous request. The thread running the loop will likely be blocked, waiting for the response. Note that this blocks the thread, but not the entire CPU, which can be shared by many threads. Therefore, by using multiple threads you can issue multiple requests simultaneously.

Now, the SOAP handler on the server could be single-threaded - which would mean that it can only handle 1 request simultaneously. This is much less likely - as server frameworks are specifically designed to not work this way. Hopefully you'll not discover this is the case.

Have you determined how many simultaneous requests you need to handle? Depending on the scenario, even a collection of 10,000 active clients may only be generating 10 simultaneous requests. This will depend on the frequency of the calls as well as the response duration. The request rate (requests/sec) will determine if you will be able to reliably/accurately simulate the desired load from a single computer.

じ违心 2024-09-26 01:24:39

SOAP 调用的原子性对线程的有用性影响不大。

在减慢测试机器速度之前,您应该创建系统允许的尽可能多的线程。即使线程数多于 CPU 仍会产生大量负载,因为 SOAP 调用可能不会立即返回。如果您有 4 个 CPU,则前 4 个线程可能会同时进行 SOAP 调用,然后接下来的 4 个线程可以在原始 4 个线程完成之前进行另外 4 个调用。虽然这并不能完全模拟多个机器调用者,但如果没有一组测试机器和一组脚本来立即调用服务,您将无法准确模拟该场景。

编辑:修正了上面的拼写错误,这个词应该是“可能”而不是“喜欢”

The atomicity of the SOAP call has little impact on the usefulness of threading.

You should create as many threads as your system will allow before it slows down your test machine. Even more threads than CPUs will still generate a lot of load because the SOAP call will likely not return immediately. If you have 4 CPUs, the first 4 threads may simultanously make a SOAP call, then the next 4 threads can make another 4 calls before the original 4 are complete. While this does not exactly simulate multiple machine callers, you wont be able to exactly simulate that scenario without a set of test machines and a set of scripts to call the service at once.

EDIT: Fixed typo above, word should have been "likely" instead of "like"

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文