问题
I'm trying to do some simple load-testing with a ZeroRPC python server and node.js client. What I notice is that if the request takes longer than 10 seconds, I get no data back. I tried to configure no heartbeat in the python code:
s = zerorpc.Server(Test(), heartbeat=None)
as well as trying to configure the node.js client:
new zerorpc.Client({ timeout: 60, heartbeatInterval: 60000 }),
but still see the same behavior.
How can I get requests taking longer than 10 seconds to return results?
回答1:
The last available release of zerorpc-node (0.9.3) use an harcoded HEARBEAT timeout.
As you can see in https://github.com/dotcloud/zerorpc-node/blob/0.9.3/lib/channel.js :
//Heartbeat rate in milliseconds
var HEARTBEAT = 5000;
...
//Resets the heartbeat expiration time
Channel.prototype._resetHeartbeat = function() {
this._heartbeatExpirationTime = util.curTime() + HEARTBEAT * 2;
};
However the latest master release implement the hearbeatInterval option as you try to specify in the client contructor.
Then your code works installing the lastest master with the command
npm install git+https://github.com/dotcloud/zerorpc-node.git
Or wait for a new release ....
来源:https://stackoverflow.com/questions/23203973/how-to-configure-zerorpc-and-timeouts