在PHP的Sphinx扩展中,可以通过以下方式设置缓存:
$client = new SphinxClient();
$client->SetArrayResult(true);
$client->SetMatchMode(SPH_MATCH_EXTENDED2);
searchd_connection_timeout = 10
searchd_connection_cache = 10
searchd_client_timeout = 300
searchd_client_buffer = 256K
通过以上设置,可以有效地控制缓存的大小和生存时间,以提高Sphinx搜索的性能和效率。
亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>
推荐阅读:php sphinx搜索速度如何优化