gatling系列教程(翻译)-(附加一)系统环境

好久不见. 提交于 2019-12-04 20:31:40

Gatling主要针对由Oracle提供的JDK8软件包进行测试。 gatling需要JDK8。 我们建议您使用最新的JDK。

如果某些启动脚本选项在您的JVM上不可用,例如 因为您运行32位版本,请编辑脚本并删除不受支持的选项。

IPv4 vs IPv6

IPv6 (enabled by default on Java) was found to sometimes cause some performance issues, so the launch scripts disable it with the following options:

IPv6(在Java上默认启用)有时会导致一些性能问题,因此启动脚本通过以下选项禁用它:

-Djava.net.preferIPv4Stack=true
-Djava.net.preferIPv6Addresses=false

If you really need to prefer IPv6, please edit the launch scripts.

OS Tuning

Note

Those instructions below are excerpts from the great Riak documentation. Please refer to Open Files Limit and Kernel and Network Tuning sections for more details or for instructions for OS X.

Open Files Limit

Most operating systems can change the open-files limit using the ulimit -n command. Example:

$ ulimit -n 65536

However, this only changes the limit for the current shell session. Changing the limit on a system-wide, permanent basis varies more between systems.

To permanently set the soft and hard values for all users of the system to allow for up to 65536 open files ; edit /etc/security/limits.conf and append the following two lines:

*       soft    nofile  65535
*       hard    nofile  65535

Save the file. Start a new session so that the limits take effect. You can now verify with ulimit -a that the limits are correctly set.

保存文件。 开始一个新的会话,使限制生效。 您现在可以使用ulimit -a验证限制是否正确设置。

For Debian and Ubuntu, you should enable PAM user limits. To do so, add session required pam_limits.so in:

  • /etc/pam.d/common-session
  • /etc/pam.d/common-session-noninteractive if the file exists
  • /etc/pam.d/sshd if you access the machine via SSH

Also, if accessing the machine via SSH, be sure to have UseLogin yes in /etc/ssh/sshd_config

For more tuning, you may want to do the following:

# more ports for testing
sudo sysctl -w net.ipv4.ip_local_port_range="1025 65535"

# increase the maximum number of possible open file descriptors:
echo 300000 | sudo tee /proc/sys/fs/nr_open
echo 300000 | sudo tee /proc/sys/fs/file-max

Kernel and Network Tuning

Consider tuning kernel and network and add this kind of following settings in /etc/sysctl.conf:

net.ipv4.tcp_max_syn_backlog = 40000
net.core.somaxconn = 40000
net.core.wmem_default = 8388608
net.core.rmem_default = 8388608
net.ipv4.tcp_sack = 1
net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_fin_timeout = 15
net.ipv4.tcp_keepalive_intvl = 30
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_moderate_rcvbuf = 1
net.core.rmem_max = 134217728
net.core.wmem_max = 134217728
net.ipv4.tcp_mem  = 134217728 134217728 134217728
net.ipv4.tcp_rmem = 4096 277750 134217728
net.ipv4.tcp_wmem = 4096 277750 134217728
net.core.netdev_max_backlog = 300000

 

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!