5 ms·
Author here. You're right that if you end up dealing with many requests per second, it will end up being resource intensive. In that case, the file or even a de
by calvinfo 14y ago
Author here. You're right that if you end up dealing with many requests per second, it will end up being resource intensive. In that case, the file or even a dedicated queue are better options.
We actually queue calls to our API and send only a single request to our servers. Even if you make multiple API calls over the course of a request, there will still be one fork per request.
I'd actually wanted to include UDP, PHP Extensions, and persistent sockets as part of the article, they just ended being a little out of scope. We might try and support them in the future, UDP is definitely an interesting idea for analytics applications.
We may also end up writing a custom in-memory queue which uses a persistent socket. For a vanilla PHP install, these seemed like the best available options.
- mratzloff 14y agoYes, UDP is a good solution for analytics. StatsD uses UDP.
- duggan 14y agoUDP is kinda the only game in town with in-app analytics (if you don't want to drop ZeroMQ all over the place); Metricfire's PHP (and other) client libraries have been on this for a while now - http://docs.metricfire.com/ http://docs.metricfire.com/