一次 shadowsocks-rust 部署实录:从 58 KB/s 调到 5 MB/s(~80 倍)。适用于跨境/高 RTT/有丢包的链路,其他代理(xray 等)同理。
核心结论:加密算法几乎无关紧要,拥塞控制和 socket 缓冲才是大头;而 Docker 的网络栈会偷偷吃掉你 80 倍性能。
| 优先级 | 手段 | 实测收益 | 层面 |
|---|
| // addTypeInformationToObject adds TypeMeta information to a runtime.Object based upon the loaded scheme.Scheme | |
| // inspired by: https://github.com/kubernetes/cli-runtime/blob/v0.19.2/pkg/printers/typesetter.go#L41 | |
| func addTypeInformationToObject(obj runtime.Object) error { | |
| gvks, _, err := scheme.Scheme.ObjectKinds(obj) | |
| if err != nil { | |
| return fmt.Errorf("missing apiVersion or kind and cannot assign it; %w", err) | |
| } | |
| for _, gvk := range gvks { | |
| if len(gvk.Kind) == 0 { |
| #![allow(unused)] | |
| use { | |
| futures::{ | |
| future::{BoxFuture, FutureExt}, | |
| task::{ArcWake, waker_ref}, | |
| }, | |
| std::{ | |
| future::Future, | |
| pin::Pin, |
| // ==UserScript== | |
| // @name add tomator timer for toggle | |
| // @namespace http://tampermonkey.net/ | |
| // @version 0.1 | |
| // @description try to take over the world! | |
| // @author yanick | |
| // @match toggl.com/* | |
| // @match app.clickup.com/* | |
| // @grant GM_addStyle | |
| // @require http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js |
| import java.util.LinkedList; | |
| import java.util.Queue; | |
| import java.util.Stack; | |
| public class TreeSearch { | |
| public static void depthFirstSearchWithStack(int[][] adjMatrix) { | |
| boolean[] visitors = new boolean[adjMatrix.length]; | |
| Stack<Integer> stack = new Stack<>(); |
| web: | |
| image: 'gitlab/gitlab-ce:latest' | |
| restart: always | |
| hostname: 'gitlab.example.com' | |
| environment: | |
| GITLAB_OMNIBUS_CONFIG: | | |
| external_url 'http://git.mschina.io' | |
| gitlab_rails['smtp_enable'] = true | |
| gitlab_rails['smtp_address'] = 'smtp.mailgun.org' | |
| gitlab_rails['smtp_port'] = 587 |
| public abstract class BaseLoaneeRepayment implements Repayment { | |
| @Autowired | |
| protected LoanRepository loanRepository; | |
| @Transactional(propagation = Propagation.REQUIRES_NEW) | |
| public final void repay(RepaymentInfo repaymentInfo) { | |
| Loan loan = loanRepository.lockAndLoad(repaymentInfo.getLoan().id()); | |
| } | |
| protected abstract void preCheck(final RepaymentInfo repaymentInfo); |