在solr的日志中,查询只需1ms,但在客户端的日志中,curl_easy_perform()需要200ms。 solr及其客户端在同一台机器上。 如果我将solr移动到另一台机器,即使在不同的城市,也需要200ms。
Here is the code in client:
curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteData);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &body);
int64_t time_start = GetTimeInMiuSec();
res = curl_easy_perform(curl);
int64_t time_end = GetTimeInMiuSec();;
VLOG(0) << "time:\t" << time_end - time_start << " miu secs";
PING localhost(127.0.0.1)56(84)字节的数据。
来自localhost(127.0.0.1)的64个字节:icmp_seq = 1 ttl = 64 time = 0.014 ms
来自localhost(127.0.0.1)的64个字节:icmp_seq = 2 ttl = 64 time = 0.011 ms
来自localhost(127.0.0.1)的64个字节:icmp_seq = 3 ttl = 64 time = 0.008 ms来自localhost(127.0.0.1)的64个字节:icmp_seq = 4 ttl = 64 time = 0.008 ms