Golang P2P 网络编程
2024/12/27大约 9 分钟

吃的多、睡得香、寄的快、摆滴溜~
Softmax 起源于 统计力学 和 概率论,传统的概率分布是由 Softmax 公式 计算得到的:
$$
softmax(x_i) = exp(x_i) / Σexp(x_j)
$$
其中:
x_i: 第 i 个元素的原始分数exp(x_i): e 的 x_i 次方Σexp(x_j): 所有元素的 exp 值之和轻松部署: outline-docker-compose
services:
outline:
image: docker.getoutline.com/outlinewiki/outline:0.82.0
env_file: ./docker.env
expose:
- "3000"
volumes:
- storage-data:/var/lib/outline/data
depends_on:
- postgres
- redis
redis:
image: redis
env_file: ./docker.env
expose:
- "6379"
volumes:
- ./redis.conf:/redis.conf
command: ["redis-server", "/redis.conf"]
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 30s
retries: 3
postgres:
image: postgres:16
env_file: ./docker.env
expose:
- "5432"
volumes:
- database-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD", "pg_isready", "-d", "outline", "-U", "user"]
interval: 30s
timeout: 20s
retries: 3
environment:
POSTGRES_USER: 'user'
POSTGRES_PASSWORD: 'pass'
POSTGRES_DB: 'outline'
https-portal:
image: steveltn/https-portal
env_file: ./docker.env
ports:
- '80:80'
- '443:443'
links:
- outline
restart: always
volumes:
- https-portal-data:/var/lib/https-portal
healthcheck:
test: ["CMD", "service", "nginx", "status"]
interval: 30s
timeout: 20s
retries: 3
environment:
DOMAINS: 'docs.mycompany.com -> http://outline:3000'
STAGE: 'production'
WEBSOCKET: 'true'
CLIENT_MAX_BODY_SIZE: '0'
volumes:
https-portal-data:
storage-data:
database-data:
Redis本质上是一个Key-Value类型的内存数据库,很像Memcached,整个数据库加载在内存当中操作,定期通过异步操作把数据库中的数据flush到硬盘上进行保存。 因为是纯内存操作,Redis的性能非常出色,每秒可以处理超过 10万次读写操作,是已知性能最快的Key-Value 数据库。 优点:
sync.Mutex 发展史
go-zero 的并发利器 mr 在业务中的应用