开发者

Why Tokyo Tyrant so slow

开发者 https://www.devze.com 2022-12-23 03:05 出处:网络
I have follow situation tyrant server lunched on freebsd host, like this: ttserver -uas -log /data/tyrant/1.log -sid 1 -thnum 8开发者_高级运维 -tout 5 /data/tyrant/data/1.tct

I have follow situation tyrant server lunched on freebsd host, like this:

ttserver -uas -log /data/tyrant/1.log -sid 1 -thnum 8开发者_高级运维 -tout 5 /data/tyrant/data/1.tct

And i try to communicate this server on windows from python and pyrant-0.3.5: like this:


import pyrant;
import time;

t = pyrant.Tyrant(host="192.168.0.220", port=1978);
tbegin = time.time();

for i in xrange(4000000):
  if i and ((i % 10000) == 0):
    print time.time() - tbegin;
    tbegin = time.time();

  t[i] = {"text": "ruslan text", "value": i};

and have i think very slow performance about 5-6 per 10,000 records. But if i start this code on the same machine like server(ttserver). Performance are good - about 0.5 sec per 10,000 records

What i must do to workaround this problem?


I know this may be too obvious, but did you measure the latency to the server? This could be the bottleneck


you can tracert www.ttserver.com and look at the latency from your native host to the remote server. maybe it's the cause.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号