我是负载测试的新手,但我搜索了很多并在亚马逊上配置了测试系统。 该系统包括: Websocket服务器, Play框架,以及一些负载测试机器。我尝试了这样的负载测试工具: Tsung 和 Gatling 。 我的测试场景:我创建了> 10k用户,每个用户都连接到服务器并开始每秒发送消息。我调整了linux以处理超过10万个连接。我使用JAVA_OPTS进行游戏以获取内容(添加了更多内存和ParallelGC用法)。我在服务器端使用akka进行游戏以处理100-300个调度程序线程。我为服务器机器订购了36个带有60 GB RAM和10GBit通道的vCPU机器。 但结果是同一个Tsung和Gatling从一台机器每秒发送近10k条消息(我只发送短信< 160Bytes)。 有人能解释我吗为什么我不能达到超过10k并发用户(每秒1条消息)。我做错了什么?
actor {
default-dispatcher = {
fork-join-executor {
throughput = 1000
parallelism-factor = 36.0
parallelism-max = 154
}
}
}
JAVA_OPTS="-Xmx3800m -Xms3800m -Xmn2g -XX:+UseParallelGC -XX:ParallelGCThreads=20"
sudo ulimits -n> 999999 sudo vim /etc/sysctl.conf
# General gigabit tuning
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.ipv4.tcp_rmem = 4096 4096 16777216
net.ipv4.tcp_wmem = 4096 4096 16777216
#
# # This gives the kernel more memory for TCP
# # which you need with many (100k+) open socket connections
net.ipv4.tcp_mem = 4096 65536 16777216
#
# # Backlog
net.core.netdev_max_backlog = 65535
net.ipv4.tcp_max_syn_backlog = 65535
net.ipv4.tcp_syncookies = 1
# Controls IP packet forwarding
net.ipv4.ip_forward = 0
# Controls source route verification
net.ipv4.conf.default.rp_filter = 1
# Do not accept source routing
net.ipv4.conf.default.accept_source_route = 0
# Controls the System Request debugging functionality of the kernel
kernel.sysrq = 0
# Controls whether core dumps will append the PID to the core filename.
# Useful for debugging multi-threaded applications.
kernel.core_uses_pid = 1
# Controls the use of TCP syncookies
net.ipv4.tcp_syncookies = 0
# Disable netfilter on bridges.
net.bridge.bridge-nf-call-ip6tables = 0
net.bridge.bridge-nf-call-iptables = 0
net.bridge.bridge-nf-call-arptables = 0
# Controls the default maxmimum size of a mesage queue
kernel.msgmnb = 65535
# Controls the maximum size of a message, in bytes
kernel.msgmax = 65535
# Controls the maximum shared segment size, in bytes
kernel.shmmax = 68719476736
# Controls the maximum number of shared memory segments, in pages
kernel.shmall = 4294967296
net.ipv4.ip_local_port_range = 1024 65535
net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_max_syn_backlog = 65535
net.ipv4.tcp_synack_retries = 5
net.ipv4.tcp_orphan_retries = 5
fs.file-max = 999999
net.ipv4.tcp_max_orphans = 819200
net.core.somaxconn = 65535
net.ipv4.tcp_congestion_control = cubic
我测试了5台客户端计算机,我发现play框架上的服务器端每秒可以处理50k用户的50k消息。有这样的配置。问题是一台客户端机器不能从10k用户发送超过10k的mps。也许有人知道其他负载测试工具可以从10k用户那里发送超过10k的电压。