UDP API responds very slow

Want to help out? Need help accessing the AniDB API? This is the place to ask questions.

Moderator: AniDB

Locked
Sakrag
Posts: 3
Joined: Tue Nov 29, 2005 12:32 am

UDP API responds very slow

Post 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.
epoximator
AniDB Staff
Posts: 379
Joined: Sun Nov 07, 2004 11:05 am

Post 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.
exp
Site Admin
Posts: 2438
Joined: Tue Oct 01, 2002 9:42 pm
Location: Nowhere

Post 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
Sakrag
Posts: 3
Joined: Tue Nov 29, 2005 12:32 am

Post 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).
Locked