influxdata / influxdb-php

influxdb-php: A PHP Client for InfluxDB, a time series database
http://influxdb.com
MIT License
432 stars 125 forks source link

Write using Telegraf Service #134

Open akalongman opened 5 years ago

akalongman commented 5 years ago

Is it possible to send data from PHP via Telegraf service, instead of writing directly in InfluxDB? It could increase performance by multiple times

akalongman commented 5 years ago

Any ideas?

andig commented 4 years ago

You can write to Telegraf, but why should this increase performance?

akalongman commented 4 years ago

@andig Telegraf service is running on the same machine, but InfluxDB is running on another machine, right? So, I want to avoid network overhead

andig commented 4 years ago

Telegraf service is running on the same machine, but InfluxDB is running on another machine, right?

yes

So, I want to avoid network overhead

You mean by using Telegraf for batching writes if your client is not capable to do that?

akalongman commented 4 years ago

You mean by using Telegraf for batching writes if your client is not capable to do that?

I do not want to use blocking network requests from my PHP app. Even batch requests, because I think it is better to write in locally running Telegraf service via socket or some other protocol.

andig commented 4 years ago

See https://www.influxdata.com/blog/influxdb-2-migration-path-instrumentation/ for how to use input listener/ influxdb output. I have not tested if this really improves performance.