How to count the number of references to the picture using nginx?

0 like 0 dislike
92 views
Gentlemen, I was poking around this morning and clear found nothing. You want to display statistics for calls to symbols, symbols of the EU-but static and I would not want to give them by means of scripts. How smart people think the number of requests to static content? Have you looked at the parser logs the type of wiki.nginx.org/NginxHttpLogRequestSpeedbut something tells me that's not a good way to solve the problem.


Here there is such a module wiki.nginx.org/HttpEchoModule#echo_exec but I don't know about the speed of work. In General, who had a similar problem, share the solution. Thank you in advance for the answer!
by | 92 views

7 Answers

0 like 0 dislike
By the way, congratulations, your question th.
*fanfare, confetti flying, half-naked girls handing you flowers.
by
0 like 0 dislike
Yes the normal way of parsing the log. Keep a separate log for the pictures and consider it.
by
0 like 0 dislike
Solution x_accel_redirect will generate a bunch of constant launches cgi processes, and this is a big load on the system.
Better to have a daemon process that monitors the output of the command `tail-f /var/log/access.log` and real-time writes to the database.
by
0 like 0 dislike
Note Scribe
\r
Scribe is a server for aggregating log data streamed in real time from a large number of servers. It is designed to be scalable, extensible without client-side modification, and robust to failure of the network or any specific machine.
by
0 like 0 dislike
We had a slightly different problem, but I agree with the opinion above. It is best to parse logs. With syslog-ng we did need a redirect logs to a Central server, where a small demon to parse the logs and inputs data in the database. Very comfortable.
hint — nginx is not able to push data to syslog. But syslog-ng is able to monitor an arbitrary log file
by
0 like 0 dislike
cat /var/log/nginx-log-from-pictures-with-partitions | grep something | wc-l
by
0 like 0 dislike
Especially for all counters was the "post_action" Directive which lets you specify what to run after the request completes. There you can connect the built-in pearl, Menkes, FastCGI anything for smart calculation. But if zaprashivat often hang special log on pictures in an easy to parse format and partite times in X minutes. It is from the point of load ideal. There is also a version with built-in variables, but he's too dreary
by

Related questions

0 like 0 dislike
2 answers
0 like 0 dislike
3 answers
0 like 0 dislike
1 answer
0 like 0 dislike
2 answers
0 like 0 dislike
2 answers
110,608 questions
257,186 answers
0 comments
28,881 users