... or Why Pipelining Is Not That Easy
Golang Concurrency Patterns for brave and smart.
By @kachayev
... or Why Pipelining Is Not That Easy
Golang Concurrency Patterns for brave and smart.
By @kachayev
| # -*- coding: utf-8 -*- | |
| from hashlib import md5 | |
| from urllib import urlencode | |
| #网关 | |
| GATEWAY = 'http://wappaygw.alipay.com/service/rest.htm' | |
| class Alipay(object): | |
| '支付宝移动服务网关' |
| net.core.wmem_max = 12582912 | |
| net.core.rmem_max = 12582912 | |
| net.ipv4.tcp_rmem = 10240 87380 12582912 | |
| net.ipv4.tcp_wmem = 10240 87380 12582912 | |
| net.ipv4.ip_local_port_range = 18000 65535 | |
| net.ipv4.netfilter.ip_conntrack_tcp_timeout_time_wait = 1 | |
| net.ipv4.tcp_window_scaling = 1 | |
| net.ipv4.tcp_max_syn_backlog = 3240000 | |
| net.core.somaxconn = 3240000 | |
| net.ipv4.tcp_max_tw_buckets = 1440000 |
| # inspired by | |
| # Master NGINX - Dimitri Aivaliotis | |
| # http://www.amazon.com/Mastering-NGINX-Dimitri-Aivaliotis-ebook/dp/B00B90PJR4 | |
| # Chapter 8 - Switching binaries at runtime | |
| # We get the pid of the 'to be replaced' nginx master process | |
| export nginx_old_pid=`cat /var/run/nginx.pid` | |
| # we send an USR2 signal to tell 'to be replaced' process | |
| # to start a new master process. |
| " copy all this into a vim buffer, save it, then... | |
| " source the file by typing :so % | |
| " Now the vim buffer acts like a specialized application for mastering vim | |
| " There are two queues, Study and Known. Depending how confident you feel | |
| " about the item you are currently learning, you can move it down several | |
| " positions, all the way to the end of the Study queue, or to the Known | |
| " queue. | |
| " type ,, (that's comma comma) |
First create a Vagrantfile:
vagrant init precise64Then add the following to the new Vagrantfile:
config.vm.provision :shell, :inline => <<-EOT
| /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user && killall Finder |