Hi
I noticed today (Fri 15th Aug) that the response times I am getting from the Betfair API-NG Server are very varied and abysmally slow.
I am using a slightly hacked version of the Betfair C# example code. I haven't long got this working so not sure if it is just something that is bad today or has been like this all along ? I suspect it wasn't this bad yesterday though.
I have spent most of today tinkering with this but no joy in fixing it. I am simply requesting listMarketBook once per second and seeing response times on average 800 mS for 2500 bytes. The variation is all over the place though, as low as 100 mS to 3 or 4 seconds sometimes.
I cant see a problem with my code that would cause this. I have been reading some older similar posts here that mention 2 relevant factors.
1) Getting the Server to return Gzip responses to speed things up. After much struggle I managed to add this to my code. Result was no measurable improvement
2) Tell the Server to keep the connection alive. I haven't been able to figure out how to do this as I am using the JSON-RPC link which uses WebRequest not HttpWebRequest, the later has a keepalive property but the former doesn't.
Does anyone know how to persuade the JSON-RPC code to keep the connection alive ?
I have just discovered a neat tool call Fiddler which gives me some visibility of the connection between me and Betfair.
For a request that was very slow 2 seconds or so, here are the stats
The culprit here seems pretty obvious unless I am missing something subtle, the time between ServerGotRequest and ServerBeginResponse is over 2 seconds !!!!
Can any networking Gurus throw some light on my struggles here please ? Hello Betfair Developer Support some thoughts from you guys would be appreciated too !
Regards Geoff
I noticed today (Fri 15th Aug) that the response times I am getting from the Betfair API-NG Server are very varied and abysmally slow.
I am using a slightly hacked version of the Betfair C# example code. I haven't long got this working so not sure if it is just something that is bad today or has been like this all along ? I suspect it wasn't this bad yesterday though.
I have spent most of today tinkering with this but no joy in fixing it. I am simply requesting listMarketBook once per second and seeing response times on average 800 mS for 2500 bytes. The variation is all over the place though, as low as 100 mS to 3 or 4 seconds sometimes.
I cant see a problem with my code that would cause this. I have been reading some older similar posts here that mention 2 relevant factors.
1) Getting the Server to return Gzip responses to speed things up. After much struggle I managed to add this to my code. Result was no measurable improvement

2) Tell the Server to keep the connection alive. I haven't been able to figure out how to do this as I am using the JSON-RPC link which uses WebRequest not HttpWebRequest, the later has a keepalive property but the former doesn't.
Does anyone know how to persuade the JSON-RPC code to keep the connection alive ?
I have just discovered a neat tool call Fiddler which gives me some visibility of the connection between me and Betfair.
For a request that was very slow 2 seconds or so, here are the stats
Code:
ACTUAL PERFORMANCE -------------- ClientConnected: 21:33:04.701 ClientBeginRequest: 21:38:36.987 GotRequestHeaders: 21:38:36.987 ClientDoneRequest: 21:38:36.987 Determine Gateway: 0ms DNS Lookup: 0ms TCP/IP Connect: 0ms HTTPS Handshake: 0ms ServerConnected: 21:33:07.876 FiddlerBeginRequest: 21:38:36.987 ServerGotRequest: 21:38:36.987 ServerBeginResponse: 21:38:39.212 GotResponseHeaders: 21:38:39.212 ServerDoneResponse: 21:38:39.212 ClientBeginResponse: 21:38:39.213 ClientDoneResponse: 21:38:39.213 Overall Elapsed: 0:00:02.226
Can any networking Gurus throw some light on my struggles here please ? Hello Betfair Developer Support some thoughts from you guys would be appreciated too !
Regards Geoff


Comment