optuna.storages.run_grpc_proxy_server
- optuna.storages.run_grpc_proxy_server(storage, *, host='localhost', port=13000, thread_pool=None)[source]
为给定的存储 URL、主机和端口运行 gRPC 服务器。
示例
以下列方式运行此服务器
from optuna.storages import run_grpc_proxy_server from optuna.storages import get_storage storage = get_storage("mysql+pymysql://<user>:<pass>@<host>/<dbname>[?<options>]") run_grpc_proxy_server(storage, host="localhost", port=13000)
请参考客户端类
GrpcStorageProxy
了解客户端用法。请使用get_storage()
而不是RDBStorage
,因为RDBStorage
本身在进程中不使用缓存,这可能导致显著的性能下降。- 参数:
- 返回类型:
None
注意
在 v4.2.0 中作为实验性功能添加。接口可能在更新版本中更改,恕不另行通知。参见 https://github.com/optuna/optuna/releases/tag/v4.2.0。