ECONNRESET when opening a large number of connection in small time period

时间秒杀一切 提交于 2019-12-02 05:27:10
Jose Manuel Cantera

instead of opening a new connection per entity why don't you use

POST /v2/op/update 

and create all entities in just one batch? or a couple of batches

See some code at

https://github.com/Fiware/dataModels/blob/master/Weather/WeatherObserved/harvest/spain_weather_observed_harvest.py#L235

With regards to CLI argument passing to CB running inside docker, use the command line in docker compose file, eg:

command: -dbhost mongo -maxConnections 123456

However, I'm not sure that would help to solve the problem, as Orion should deal with your use case without any special customization. Looking to the error message (which seems to be about some problema at TCP layer) I wonder if docker networking layer is acting as bottleneck in some way...

In addition, the suggestion done by Jose Manuel Cantera about using POST /v2/op/update would be a good idea. It would reduce connection stress at network layer and may help to alleviate the problem.

If you cannot change your update strategy, maybe using an inter-request delay (100-200ms) could also help.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!