下面都是说的无状态服务,有状态的类似,除了 1 2 再多一句话就能描述
没有好用的隔离方案,通常会在一个机器上部署一个东西:
- 我们知道机器的资源(这个进程最多能用多少 CPU 内存)
- 以便让服务运行在资源足够的地方
- 我们知道哪些机器运行着这个服务(服务发现),服务可能直接监听 80 这样的端口
- 以便做负载均衡
| import sys | |
| import json | |
| def filter(har_file, contains): | |
| with open(har_file) as f: | |
| har = json.load(f) | |
| entries = har['log']['entries'] | |
| filtered = [e for e in entries if contains in e['request']['url']] |
| { | |
| "configurations":{ | |
| "Debug GRPC":{ | |
| "adapter":"vscode-go", | |
| "configuration":{ | |
| "type":"go", | |
| "request":"launch", | |
| "mode":"debug", | |
| "remotePath":"", | |
| "port":2345, |
| #!/bin/bash | |
| install_ipset() { | |
| yum install -y ipset ipvsadm | |
| } | |
| load_mod() { | |
| echo "#!/bin/bash | |
| modprobe -- ip_vs | |
| modprobe -- ip_vs_rr |
| 🏆 205 Contributions in year 2020 | |
| 📦 Used 24 MB in GitHub's Storage | |
| 📜 7 Public Gists | |
| 🔑 5 Public Keys | |
| 💼 Opted to Hire |
| Markdown 3 hrs 30 mins ████████████▎░░░░░░░░ 58.7% | |
| TypeScript 1 hr 13 mins ████▎░░░░░░░░░░░░░░░░ 20.4% | |
| Bash 31 mins █▊░░░░░░░░░░░░░░░░░░░ 8.8% | |
| YAML 28 mins █▋░░░░░░░░░░░░░░░░░░░ 8.0% | |
| JSON 12 mins ▋░░░░░░░░░░░░░░░░░░░░ 3.4% |
| clash |
| from PIL import Image | |
| img = Image.open("QQwhite.jpg") | |
| width, height = img.size | |
| result = Image.new('RGB', (width, height)) | |
| data = list(img.getdata()) | |
| for i, t in enumerate(data): | |
| if set(t) == {255}: |