Best practices - performance with exec plugin?

Hi

I am polling data from multiple sources. The data is dirty which is cleaned up by a multi-threaded Python script. At the end, the script ‘prints’ the data in InfluxDB line protocol. I am using telegraf exec plugin to invoke the script.

I believe ‘print’ calls are costly and wondering if this approach a best practice in a scale environment? Are there any better approaches?

Thanks
<First post here. Thank you for the great work, asking great questions and those of you who answer them>

Hi @paregupt welcome to the community,

I don’t know , do you experience performance problems using print ?

Thanks MarcV for the response.

It is too early for me to say if print can have performance problems. That is the reason I am trying to know from experts here for best practices. My implementation will be deployed shortly and may hit large scale in 6-8 months. I am trying to avoid any surprises at that time and a potential re-write. Trying to understand if there are any pitfalls I should avoid or any better alternatives based on the prior experience of experts here.

Usually I find the biggest performance issue is starting the process every interval. Since you are using python you will want to make sure to import only the essential modules you need, as it can take some time for a python process to get up and going.

1 Like

Valid and deep thought. Thank you.