gatling系列教程(翻譯)-(附加一)系統環境

Gatling主要針對由Oracle提供的JDK8軟件包進行測試。 gatling須要JDK8。 咱們建議您使用最新的JDK。java

若是某些啓動腳本選項在您的JVM上不可用,例如 由於您運行32位版本,請編輯腳本並刪除不受支持的選項。linux

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:shell

IPv6(在Java上默認啓用)有時會致使一些性能問題,所以啓動腳本經過如下選項禁用它:bash

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

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

OS Tuning

Noteapp

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.ssh

Open Files Limit

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

$ 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.ide

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
相關文章
相關標籤/搜索