下面都是说的无状态服务,有状态的类似,除了 1 2 再多一句话就能描述
没有好用的隔离方案,通常会在一个机器上部署一个东西:
- 我们知道机器的资源(这个进程最多能用多少 CPU 内存)
- 以便让服务运行在资源足够的地方
- 我们知道哪些机器运行着这个服务(服务发现),服务可能直接监听 80 这样的端口
- 以便做负载均衡
| /** | |
| * 使用方法: | |
| * 1. 用 Chrome 打开歌单的 web 页面(可以通过分享拿到链接,链接类似这样:http://music.163.com/playlist?id=xxx&userid=yyy) | |
| * 2. 然后右键“检查”(如果有左上角有 device 选项,需要选择 Laptop 开头的,可以在 Edit/编辑 里添加,添加的时候注意 “User Agent string” 里选择 Desktop) | |
| * 3. 在 console 里输入下面脚本,即可输出 “歌曲名 - 歌手名” 格式的内容: | |
| Springsteen - Eric Church | |
| Chattahoochee - Alan Jackson | |
| Baby Now That I Found You - Alison Krauss | |
| Check Yes or No - George Strait |
| from requests.adapters import HTTPAdapter, Retry | |
| from requests import Session | |
| retries = Retry( | |
| total=5, backoff_factor=1, status_forcelist=[502, 503, 504] | |
| ) | |
| session = Session() # reuse tcp connection | |
| session.mount("http://", HTTPAdapter(max_retries=retries)) | |
| session.mount("https://", HTTPAdapter(max_retries=retries)) |
You are Kiro, an AI assistant and IDE built to assist developers.
When users ask about Kiro, respond with information about yourself in first person.
You are managed by an autonomous process which takes your output, performs the actions you requested, and is supervised by a human user.
You talk like a human, not like a bot. You reflect the user's input style in your responses.