局域网内测速这么写,怎么样?

2014-02-18 18:07:55 +08:00
 Draplater
服务器上写一个脚本,建立一个HTTP Server,返回大量数据:
#!/usr/bin/python
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
class TestHTTPHandler(BaseHTTPRequestHandler):
def do_GET(self):
self.protocal_version = "HTTP/1.1"
self.send_response(200)
self.send_header("Welcome", "Contect")
self.end_headers()
while 1:
self.wfile.write('A'*100000)

http_server = HTTPServer(('0.0.0.0', 8080), TestHTTPHandler)
http_server.serve_forever()

然后局域网内另一台机器:
wget http://xxx.xxx.xxx.xxx:8080/ -O /dev/null
3300 次点击
所在节点    服务器
2 条回复
pfitseng
2014-02-18 18:37:57 +08:00
dd if =dev/zero | ssh target 'cat dev/null '
little_cup
2014-02-18 18:41:33 +08:00
可以用iperf
服务端:
iperf -s
客户端:
iperf -c 192.168.1.xx

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/100793

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX