内存优化综述
任何一个复杂的系统内存分配释放的最佳策略一定是: 按照其特性进行内存分类管理。 一般来说可将其特性分为以下几类:
- 对象池(Object Pools)
- 延迟销毁(Lazy Deletion)
- 动态生成(Dynamic Generation)
为什么说这种策略是最优的呢, 举例来说:
如果希望自己二次开发(有API可以调用)或者有多个租户(每个客户端一个单独的key),建议使用nps。 如果希望简单上手,没有多个租户的要求,建议使用frp。
通过在具有公网 IP 的节点上部署 frp 服务端,可以轻松地将内网服务穿透到公网,同时提供诸多专业的功能特性,这包括:
这里提供两种方法:
Get Current User’s UID and GID: You need to retrieve your current user’s UID (User ID) and GID (Group ID). You can do this with the following commands:
export UID=$(id -u)
export GID=$(id -g)Run Docker Container: Use the –user flag to specify the UID and GID when running your Docker container. Here’s an example command: