OstDB DEV Foosic: Difference between revisions

Jump to navigation Jump to search
add a way to query current server utilization, make client info mandatory
(comment on epoximators approach)
(add a way to query current server utilization, make client info mandatory)
Line 67: Line 67:


=== Broken Clients ===
=== Broken Clients ===
* we might want to require a client string and client version in every query (similar to udp api) to be able to ban badly broken clients, should the need arrise someday
* we probably want to require a client string and client version in every query (similar to udp api) to be able to ban badly broken clients, should the need arrise someday.


=== Protocol Draft ===
=== Protocol Draft ===
Every query should contain as additional paramets:
* client={str client name}&clientver={int client version}


==== Submitting a foosic fingerprint (add to db if unknown) ====
==== Submitting a foosic fingerprint (add to db if unknown) ====
(maybe client=bla&clientver=NNN with each query)


Client:
Client:
Line 105: Line 108:
Server Reply:
Server Reply:
* 210 STORED\n{int id}\n
* 210 STORED\n{int id}\n
==== Query the current server load/utilization ====
Client:
* LOADSTAT
Server Reply:
* 299 LOAD STAT\n{int2 load factor}\n{int4 number of fingerprints in db}\n
** load factor: a simply multiplicative constant which is used to distinguish between fast and slow server hardware. This can i.e. be used to store twice as many fingerprints on one server compared to others. The fingerprint count is converted according to the following formula prior to comparison/selection of least used server.
*** relative fingerprint number/load = number of fingerprints in db * (load factor / 100)
(might be extended with additional data someday, i.e. real average foosic load)

Navigation menu

MediaWiki spam blocked by CleanTalk.
MediaWiki spam blocked by CleanTalk.