apache PHP gRPC忽略keepalive参数

ehxuflar  于 2023-11-21  发布在  Apache
关注(0)|答案(1)|浏览(105)

我把这三个参数:

grpc.keepalive_time_ms=7200000
grpc.keepalive_timeout_ms=200000
grpc.keepalive_permit_without_calls=1

字符串
/etc/php/8.1/apache2/conf.d/20-grpc.ini/etc/php/8.1/apache2/conf.d/custom-php.ini/etc/php/8.1/cli/conf.d/20-grpc.ini/etc/php/8.1/cli/conf.d/custom-php.ini中。然后我重新启动webserver(整个Docker容器),并列出grpc config与php -i | grep grpc,它们在输出中丢失:

/etc/php/8.1/cli/conf.d/20-grpc.ini,
grpc
grpc support => enabled
grpc module version => 1.59.1
grpc.enable_fork_support => 0 => 0
grpc.grpc_trace => all,-timer_check => all,-timer_check
grpc.grpc_verbosity => debug => debug
grpc.log_filename => /var/log/grpc.log => /var/log/grpc.log
grpc.poll_strategy => no value => no value


我用PHP 8.1,gRPC扩展1.45.0和1.59.1测试了它。我做错了什么?

3hvapo4f

3hvapo4f1#

这些参数不属于PHP.ini配置文件,它们需要在PHP代码中,作为选项数组传递到gRPC客户端类构造函数中。

$options['grpc.keepalive_time_ms'] = 7200000;
$options['grpc.keepalive_timeout_ms'] = 200000;    
$options['grpc.keepalive_permit_without_calls'] = 1;

$client = new Client('host:port', $options);

字符串

相关问题