Page 1 of 1

UDP API responds very slow

Posted: Mon Jul 03, 2006 8:58 am
by Sakrag
I want to know why sometimes the udp api is very slow to respond to my requests. I am developing a java client, currently called hexidb (we may change the name) and I know there is not an error in the networking i/o portion of the client that is currently working. The problem is just the udp api seems very slow to respond to certain packets. I constantly see in my clients debug logs:
[NET] Parsed incomming packet with id 1 and reply code 200. Latency: 188ms
[NET] Parsed incomming packet with id 2 and reply code 206. Latency: 1342ms (SLOW)
[NET] Parsed incomming packet with id 4 and reply code 300. Latency: 78ms
[NET] ERROR: Timeout: Expected packet with id 5 not recieved. Assuming packet was lost or discarded. Attempting to resend request in 20 seconds.
[NET] ERROR: Timeout: Expected packet with id 5 not recieved. Assuming packet was lost or discarded. Attempting to resend request in 1 minutes.
[NET] Parsed late incomming packet with id 5 and reply code 207. Latency: 53347ms (VERY SLOW)
[NET] Parsed late incomming packet with id 5 and reply code 207. Latency: 6271ms (VERY SLOW) (REDUNDANT)
[NET] Parsed late incomming packet with id 5 and reply code 207. Latency: 207ms (REDUNDANT)
I usually send these packets upon login, I send them at least 2 seconds apart. The login/logout/ping I have no problem with normally, but the top list and stats always seem to be slow or very slow or even sometimes lost.

Posted: Mon Jul 03, 2006 10:52 am
by epoximator
well, the db is slow at times..
about those two commands; i would just disable/remove them altogether. they are expensive and useless. so unless anyone objects, which i doubt, i'll do just that.

Posted: Tue Jul 04, 2006 1:24 am
by exp
epoximator wrote:well, the db is slow at times..
about those two commands; i would just disable/remove them altogether. they are expensive and useless. so unless anyone objects, which i doubt, i'll do just that.
probably a wise move, they're slow on chii too and the stats web pages for mods are a nightmare @ load times.
it's not really important info for a client anyway.

if ppl really want that info, we'd have to look into some kind of heavy caching (i.e. regenerate those stats only once every 48h, and then maybe asynchronous via a background thread).

BYe!
EXP

Posted: Wed Jul 05, 2006 12:27 am
by Sakrag
I like those stats myself. I have them on the front page of my client, thats why i request them at login. I can set my client to cache them though and only grab them like once a day/week. Would be nice to leave them in but perform the calculatiosn in the background and or force the clients to use a cache (if user requests stats more than x number of times in x number of days, ban the client).