简体   繁体   English

物联网代理商LWM2M内存排放和生产环境

[英]IoT Agent LWM2M Memory exhaust and production environment

I'm working on a project which aims to connect +1k devices to a machine, which may probably autoscale. 我正在开展一个旨在将+ 1k设备连接到机器的项目,这可能可能是自动缩放的。 The problem is that with only 2 connected devices, the IDAS IoTAgent ends in a couple of days with a "Memory exhaust" message. 问题是只有2个连接的设备,IDAS IoTAgent会在几天内以“内存耗尽”消息结束。 It is running in a docker instance in a machine in AWS m3.medium with memory swap. 它在AWS m3.medium中具有内存交换的计算机中的docker实例中运行。

On the other hand, the git repository is not longer maintained as far as I can see, since there are not commits since Dec 16'. 另一方面,就我所见,git存储库不再维护,因为自12月16日以来没有提交。 Is this a recomendable Generic Enabler for production? 这是一个可以推荐的生产通用启动器吗? Has it been tested for a big amount of connected devices? 它是否已经过大量连接设备的测试? Is this actually out of maintenance? 这真的没有维护吗?

Here it is the url to the git repo: 这是git repo的网址:

https://github.com/telefonicaid/lightweightm2m-iotagent https://github.com/telefonicaid/lightweightm2m-iotagent

Thanks in advance 提前致谢

Sorry for the delay and thank you a lot for your interest in Fiware and for having put this issue to our attention. 很抱歉延迟并非常感谢您对Fiware的关注以及我们对此问题的关注。 Let me answer to your questions one by one: 让我逐一回答你的问题:

Indeed the issue is related to a bug in a config.js IotAgent LWM2M. 实际上,该问题与config.js IotAgent LWM2M中的错误有关。

https://github.com/Fiware/iot.IoTagent-LWM2M/blob/master/docs/deviceProvisioning.md https://github.com/Fiware/iot.IoTagent-LWM2M/blob/master/docs/deviceProvisioning.md

The payload is malformed and it return the following error: 有效负载格式错误,并返回以下错误:

**op=IoTAgentNGSI.DbConn | msg=No host found for MongoDB driver.**

To solve it, you must create an attribute called: 'devicedRegistry' in the payload config.js as follows: 要解决此问题,您必须在有效负载config.js中创建一个名为:'devicedRegistry'的属性,如下所示:

var config = {};
config.lwm2m = {
logLevel: 'DEBUG',
port: 5684,
defaultType: 'Device',
ipProtocol: 'udp4',
serverProtocol: 'udp4
delayedObservationTimeout: 50,
formats: [
    {
        name: 'application-vnd-oma-lwm2m/text',
        value: 1541
    },
    {
        name: 'application-vnd-oma-lwm2m/tlv',
        value: 1542
    },
    {
        name: 'application-vnd-oma-lwm2m/json',
        value: 1543
    },
    {
        name: 'application-vnd-oma-lwm2m/opaque',
        value: 1544
    }
  ],
writeFormat: 'application-vnd-oma-lwm2m/text',
types: [ ]
};
config.ngsi = {
   logLevel: 'DEBUG',
   contextBroker: {
      host: 'localhost',
      port: '1026'
},
server: {
    port: 4041,
    host: 'localhost'
},
deviceRegistry: {
    type: 'mongodb'
},
mongodb: {
    host:'172.17.0.2',
    db: 'iotagentLW2M2M'
},
types: { },
service: 'smartGondor',
subservice: '/gardens',
providerUrl: 'http://localhost:4041',
deviceRegistrationDuration: 'P1M'
};
module.exports = config;

Remember that when a LWM2M client has active attributes, the agent sends an observe instruction for each one, just after the client registers. 请记住,当LWM2M客户端具有活动属性时,代理会在客户端注册之后为每个客户端发送一条观察指令。 This may cause an error when the client takes too long to start listening, as the observe requests may not reach its destiny. 当客户端花费太长时间开始收听时,这可能会导致错误,因为观察请求可能无法达到其命运。

So make sure you are using a timeout properly to give the client the opportunity to create the listener before the server sends the requests 因此,请确保正确使用超时,以便客户端有机会在服务器发送请求之前创建侦听器

Secondly, is this a recommendable Generic Enabler for producction ? 其次, 这是一个值得推荐的Generic Enabler for producction吗? Absolutely yes. 绝对没错。 It has been tested for a big amount of connected devices. 它已经过大量连接设备的测试。 We were a bit surprised by your situtation indeed what we have through our quality assurance team is that In that they assessed that the IoT Agent was able to manage up to 140 updates per second, ie, 140 requests from devices. 我们对您的情况确实感到有些惊讶我们通过我们的质量保证团队得到的结果是,他们评估了物联网代理能够每秒管理多达140个更新,即来自设备的140个请求。 We don't have the number of devices as these updates may come from one or several devices. 我们没有设备数量,因为这些更新可能来自一个或多个设备。 For 100 concurrent threads, it was able to manage in average 114 updates/sec. 对于100个并发线程,它能够平均管理114次更新/秒。 If we increment the number of concurrent threads, 140 updates/sec will be the cap. 如果我们增加并发线程数,则140次更新/秒将成为上限。 I hope this will give you a reference figure. 我希望这会给你一个参考数字。 just ket us know which are your requirements and we will come back to you with additional info. 只是告诉我们您的要求,我们会回复您的其他信息。

Finally, is this actually out of maintenance? 最后, 这实际上没有维护吗? No it isn't. 不,不是。 Currently, the plan 目前,该计划
is is to have a new version of the IoT Agent to be fully compliant with FIWARE NGSI v2 . 要使新版本的物联网代理完全符合FIWARE NGSI v2 Indeed, I guess you already spotted it the current version refers only to FIWARE NGSI v1 . 实际上,我猜您已经发现它当前版本仅指FIWARE NGSI v1

In addition new enhancements will appear soon. 此外,新的增强功能即将推出。 As you might know all the developments of Fiware technologies are done by the Fiware Open Source Community and as any open source community we are committed to fix bugs, if any, and to provide enhancements, but this according to the priorities of the community members. 您可能知道Fiware技术的所有发展都是由Fiware开源社区完成的,并且作为任何开源社区,我们都致力于修复错误(如果有的话),并提供增强功能,但这可以根据社区成员的优先级进行。 As fiware foundation we have very limited resources but flexible enough to put them at disposal of things that we found critical (as this bug you found), but the large bunch of the work is done by the community. 作为软件基础,​​我们拥有非常有限的资源,但足够灵活,可以将它们置于我们认为至关重要的事物(正如您发现的这个错误),但大量的工作是由社区完成的。

Just let us know if this fixes your problem and we hope all of the above helps you in solving your issues and understand the matter. 如果这可以解决您的问题,请告诉我们,我们希望上述所有内容可以帮助您解决问题并了解相关问题。 Serving people like you is our mission ! 为您服务的人是我们的使命!

Kind Regards ! 亲切的问候 !

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM