Performance
wrk - a Modern HTTP benchmarking tool
wrk is a modern HTTP benchmarking tool capable of generating significant load when run on a single multi-core CPU. It combines a multithreaded design with scalable event notification systems such as epoll and kqueue. |
Scalable Load Testing Tools
Locust - An open source load testing tool. Define user behaviour with Python code, and swarm your system with millions of simultaneous users. http://locust.io/ Boomer is a better load generator for locust, written in golang. It can spawn thousands of goroutines to run your code concurrently. It will listen and report to the locust master automatically, your test results will be displayed on the master's web UI. https://github.com/myzhan/boomer |
Troubleshooting UDP packets being dropped
Test to find fragmented UDP packets (larger than MTU) being dropped between hosts in different subnets:
they ran a test from a "good" host by sending a UDP request larger than the allowed MTU:
They ran the same test on a "bad" host:
sudo ifconfig eth0 mtu 800 ip route flush cache ping -s 1520 -M dont -i 0.8 192.168.1.1
tcpdump -vv -i eth0 host 192.168.1.1 and udp -n so to turn on tcp_mtu_probing # echo 2 > /proc/sys/net/ipv4/tcp_mtu_probing Possible values 0: disabled 1: enabled when black hole detected 2: always enabled root@sd6pstg-69c4:~# tracepath -n 192.168.1.1 1?: [LOCALHOST] pmtu 1464 1: 169.254.154.42 1.429ms 1: 169.254.154.42 1.058ms 2: 169.254.32.144 2.134ms 3: 169.254.32.19 1.034ms 4: no reply tcpdump -nnvvXSs 1514 -i eth0
host3:~# cat /proc/sys/net/ipv4/ip_default_ttl 64
sudo sysctl net.ipv4.ip_default_ttl=129 |
Open Source Web Performance Dashboard
The speedgun.io and PhantomJS 2 can be used to measure website performance: ![]() Here is another solution, based on Docker containers: http://dashboard.sitespeed.io/ Read more on their blog: ![]() |
Making HTTPS Fast(er) with nginx
Nginx has all the right HTTPS performance knobs and features... but the defaults can be optimized to deliver a much better out-of-the-box experience. In fact, this applies to just about every server out there. |
Talk about the use of Redis at Twitter
Interesting behind-the-scenes look at how Twitter uses Redis: 10K+ instances, 100TB+ of memory, and ~40M QPS! All of the timelines are stored in Redis.. and that's a lot of memory! The talk also covers the use of twemproxy aka nutcracker is a fast and lightweight proxy for memcached and redis protocol. It was primarily built to reduce the connection count on the backend caching servers. https://github.com/twitter/twemproxy |
Google's PageSpeed Module
PageSpeed Module - Optimizing For BandwidthPageSpeed's default
This option is suitable for use in a root configuration at a hosting service, CDN, or multi-site setup, in conjunction with InheritVhostConfig. In this mode, PageSpeed does not alter HTML at all. It compresses and transcodes images in place, and minifies JavaScript and CSS. By avoiding changes to URL syntax and to HTML, the potential problem of user-written JavaScript encountering unexpected DOM elements is elimimated. There is still latency benefit due to the reduced size of resources, as well as substantial bandwidth reduction. |
Minify HTML, CSS and JS
Code minification, if done right, can boost the performance of most websites. Here are a few useful tools: |
Penthouse is a tool generating critical path css for your web pages
penthouse
AboutPenthouse is a tool generating critical path css for your web pages and web apps in order to speed up page rendering. Supply the tool with your site's full CSS, and the page you want to create the critical CSS for, and it will return all the CSS needed to render the above the fold content of the page. Read more about critical path css here. The process is automatic and the generated css is production as is. If you run in to problems however, check out the Problems section further down on this page. |