我正在尝试获取一些长时间执行的查询的结果。每个查询都有相同的结构:
@CODE (ZZZZZZ|YYYYY...) @FIELD2 YES每个成功的查询都会在70-100秒内完成(我正在使用searchd --console进行检查)。但是PHP代码停止等待第60秒的响应,并丢弃一个错误
received zero-sized searchd response 看起来连接中断了还是这样?我使用的是普通的SphinxClient。调用sphinx search的PHP代码如下所示:
$this->client->SetServer($this->host, $this->port);
$this->client->SetArrayResult(true);
$this->client->SetWeights(array(100, 1));
$this->client->SetMatchMode($this->mode);
$this->client->SetMaxQueryTime(5000000);
$this->client->SetLimits($this->offset, $this->limit, ($this->limit > 1000) ? $this->limit : 1000);
$this->result = $this->client->Query($this->query, $this->index);PHP配置为
max_execution_time = 120
max_input_time = 120是否可以设置一些系统设置-这样脚本就可以等待更长时间的响应?我使用的是Debian GNU/Linux 5.0.3 Lenny
发布于 2013-03-28 21:07:31
你试过设置setConnectionTimeout吗?
http://sphinxsearch.com/docs/current.html#api-func-setconnecttimeout
尽管设置stream_set_timeout可能会更好,但http://www.php.net/manual/en/function.stream-set-timeout.php必须连接sphinxapi.php才能向其添加调用。
https://stackoverflow.com/questions/15671295
复制相似问题