Last active
August 29, 2015 14:02
-
-
Save panbanda/4710d07990b960697097 to your computer and use it in GitHub Desktop.
Upgrade Latest Python & PIP on EC2 for Locust Swarms
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Build tools | |
sudo yum install make automake gcc gcc-c++ kernel-devel git-core -y | |
# Install python 2.7 and change default python symlink | |
sudo yum install python27-devel -y | |
sudo rm /usr/bin/python | |
sudo ln -s /usr/bin/python2.7 /usr/bin/python | |
# yum still needs 2.6, so write it in and backup script | |
sudo cp /usr/bin/yum /usr/bin/_yum_before_27 | |
sudo sed -i s/python/python2.6/g /usr/bin/yum | |
sudo sed -i s/python2.6/python2.6/g /usr/bin/yum | |
# Install pip for 2.7 | |
sudo curl -o /tmp/ez_setup.py https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py | |
sudo /usr/bin/python27 /tmp/ez_setup.py | |
sudo /usr/bin/easy_install-2.7 pip | |
sudo pip install virtualenv | |
# See if everything worked | |
pip -V && virtualenv --version | |
# Install locust io | |
sudo pip install locustio | |
# Install zmq for distributed systems | |
sudo easy_install pyzmq | |
# The load settings for allowing various connections and whatnot | |
sudo echo “10152 65535″ > /proc/sys/net/ipv4/ip_local_port_range | |
sudo sysctl -w fs.file-max=128000 | |
sudo sysctl -w net.ipv4.tcp_keepalive_time=300 | |
sudo sysctl -w net.core.somaxconn=250000 | |
sudo sysctl -w net.ipv4.tcp_max_syn_backlog=2500 | |
sudo sysctl -w net.core.netdev_max_backlog=2500 | |
sudo ulimit -n 10240 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment