简体   繁体   English

Python负载测试套接字通信

[英]Python load testing socket communication

I have this two Python script server.py and client.py which connects using socket, server just looks like: 我有这两个Python脚本server.py和client.py,它们使用套接字连接,服务器看起来像:

while True:
    try:
        conn, addr = server.accept()
        handle(conn, addr)
    except KeyboardInterrupt:
        break

So it just handles one client at a time then later I'll add gevent so it can handle clients concurrently. 因此,它一次只能处理一个客户端,然后稍后我将添加gevent使其可以同时处理客户端。

How do I benchmark this to determine client request/second with vs without gevent? 如何在不使用gevent与不使用gevent的情况下对此进行基准测试以确定客户端请求/秒?

I found a lot of HTTP base benchmarking tool but what about TCP? 我找到了很多HTTP基本基准测试工具,但是TCP呢? Ideally I'd like the test to run several of my client.py script and use that as a test. 理想情况下,我希望该测试运行多个client.py脚本并将其用作测试。

最终写了我自己的线程基准测试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM