Giter Club home page Giter Club logo

Comments (6)

boynet avatar boynet commented on July 18, 2024

p.s pretty sure you need to put some warning on the examples withexec('date +%s%N') it has bad performance.
at least for me in ubuntu 16 this code is taking 1.5158290863037 sec to complete

for($x=0;$x<1000;$x++) {
            exec('date +%s%N');
}

from influxdb-php.

gianarb avatar gianarb commented on July 18, 2024

Well UDP vs TPC is a very good topic.

UDP is really fast but you have not guarantee about your point, because the protocol have not this kind of check if you are sending CPU point you can not be sure that all your point will be in influxdb.
TPC has this check but it's slow.

I have two different strategy.

  1. Are you using a agent on your server to collect local data like telegraf?
    In this case you can send udp data to the agent because between your local network the probability to lose package is low and you will send bulk of point via TPC with the collector, in this way your application will be fast.

  2. You are not using an agent.
    In this case depends, if you can not accept to miss points use TCP.

In this article I spoke about another library but there is a bench UDP vs TPC
http://gianarb.it/blog/InfluxDB-and-PHP

from influxdb-php.

akalongman avatar akalongman commented on July 18, 2024

@gianarb How to send data to a locally started Telegraf agent?

from influxdb-php.

gianarb avatar gianarb commented on July 18, 2024

Hello @akalongman , telegraf has an input plugin called http_listener

https://github.com/influxdata/telegraf/tree/master/plugins/inputs/http_listener_v2

This plugin exposes a compatible API layer with InfluxDB. You can change the client URL to hit the one exposed by the telegraf plugin and everything should just work as before but passing via Telegraf!

from influxdb-php.

akalongman avatar akalongman commented on July 18, 2024

@gianarb thank you. Is it possible to use UDP? I do not want to add network overheads on my application

from influxdb-php.

gianarb avatar gianarb commented on July 18, 2024

from influxdb-php.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.