minetest-mapserver / mapserver_mod

Complementary mod for the minetest mapserver
17 stars 14 forks source link

`http.fetch` issue #24

Closed BuckarooBanzay closed 2 years ago

BuckarooBanzay commented 2 years ago
root@akheron:/data/pandorabox.io/data/minetest# tail -f debug.txt | grep -i mapserver
2022-07-12 18:55:17: WARNING[Server]: [mapserver-bridge] post took 1818357 us
2022-07-12 18:55:21: WARNING[Server]: [mapserver-bridge] post took 1880952 us
2022-07-12 18:55:28: WARNING[Server]: [mapserver-bridge] post took 1806007 us
2022-07-12 18:55:35: WARNING[Server]: [mapserver-bridge] post took 2084787 us
2022-07-12 18:55:37: WARNING[Server]: [mapserver-bridge] post took 1786854 us
2022-07-12 18:55:46: WARNING[Server]: [mapserver-bridge] post took 1983264 us
2022-07-12 18:55:53: WARNING[Server]: [mapserver-bridge] post took 2209469 us
/lua local x = minetest.get_us_time(); local a = {}; mapserver.bridge.add_players(a); print("xxx:" .. #minetest.write_json(a) .. " us:" .. minetest.get_us_time() - x);
/lua local x = minetest.get_us_time(); local a = {}; mapserver.bridge.add_advtrains(a); print("xxx:" .. #minetest.write_json(a) .. " us:" .. minetest.get_us_time() - x);
minetest_1             | xxx:72071 us:30518
minetest_1             | xxx:72045 us:28952
minetest_1             | xxx:2218 us:936

Relevant code:

https://github.com/minetest-mapserver/mapserver_mod/blob/594e5dad565c75c5c46292378ce17fb5d473d2c1/bridge/init.lua#L35-L89

S-S-X commented 2 years ago

Remember with priority 2 QoS can also delay request processing if there's many other requests with same or higher priority in queue. If request ends up in queue then it will be delayed at least until next globalstep, immediate processing happens only if there's enough space in current monitored queue. For priority 2 default limit is 80% of max parallel requests (or curl_parallel_limit * 0.8).

BuckarooBanzay commented 2 years ago

ugh, this was a http-fetch issue but in another mod :facepalm: https://github.com/minetest-go/mtui_mod/commit/7ed88c74cdf100742793cd4f9a87b9cec51f5d20