Welcome! Log In Create A New Profile

Advanced

Re: piped logging from Nginx to MySQL

Igor Sysoev
December 16, 2009 05:10AM
On Wed, Dec 16, 2009 at 12:38:49PM +0300, Ihalainen Nickolay wrote:

> или пайпы работают медленней чем файлы?

Разумеется. При записи в пайп первая программа копирует данные в ядро.
После этого просыпается вторая программа, которая копирует эти данные
из ядра к себе и что-то с ними делает (пишет на диск, анализирует или
вставляет в базу, что вообще нетривиальная операция). Потом это программа
опять пытается прочитать из пайпа и блокируется. Первая программа
продолжает работу. Во время всех этих операций ради 100-200 байт лога
происходит несколько переключений контекстов исполнения с вымыванием
кэшей (случай с базой я даже не рассматриваю). Поэтому-то в качестве
альтернативы предлагается вариант

tail -F access.log | program

имеющий примерно столько же накладных расходов, как и обычная запись в пайп.
Он, на первый взгляд, выглядит сложнее, но по сути одно и то же.


--
Игорь Сысоев
http://sysoev.ru

_______________________________________________
nginx-ru mailing list
nginx-ru@nginx.org
http://nginx.org/mailman/listinfo/nginx-ru
Subject Author Posted

piped logging from Nginx to MySQL

Roman Yankovsky December 15, 2009 08:18PM

Re: piped logging from Nginx to MySQL

Peter Leonov December 15, 2009 10:26PM

Re: piped logging from Nginx to MySQL

akalend December 16, 2009 02:20AM

Re: piped logging from Nginx to MySQL

Ihalainen Nickolay December 16, 2009 03:32AM

Re: piped logging from Nginx to MySQL

Anton Yuzhaninov December 16, 2009 04:22AM

Re: piped logging from Nginx to MySQL

Ihalainen Nickolay December 16, 2009 04:40AM

Re: piped logging from Nginx to MySQL

Alex Vorona December 16, 2009 04:44AM

Re: piped logging from Nginx to MySQL

Gerasimenko Konstantin December 16, 2009 04:48AM

Re: piped logging from Nginx to MySQL

Alex Vorona December 16, 2009 04:50AM

Re: piped logging from Nginx to MySQL

Igor Sysoev December 16, 2009 05:10AM

Re: piped logging from Nginx to MySQL

Gerasimenko Konstantin December 16, 2009 05:22AM

Re: piped logging from Nginx to MySQL

Igor Sysoev December 16, 2009 05:30AM

Re: piped logging from Nginx to MySQL

Gerasimenko Konstantin December 16, 2009 06:00AM

Re: piped logging from Nginx to MySQL

Руслан Шарипов December 16, 2009 06:04AM

Re: piped logging from Nginx to MySQL

Vasiliy G Tolstov December 16, 2009 06:06AM

Re: piped logging from Nginx to MySQL

Vasiliy G Tolstov December 16, 2009 06:22AM

Re: piped logging from Nginx to MySQL

Igor Sysoev December 16, 2009 06:46AM

Re: piped logging from Nginx to MySQL

Vasiliy G Tolstov December 16, 2009 08:12AM

Re: piped logging from Nginx to MySQL

Eugene Mychlo December 17, 2009 03:22AM

Re: piped logging from Nginx to MySQL

Olexander Shtepa December 17, 2009 03:56AM

Re: piped logging from Nginx to MySQL

Vasiliy G Tolstov December 17, 2009 04:00AM

Re: piped logging from Nginx to MySQL

Eugene Mychlo December 17, 2009 04:20AM

Re: piped logging from Nginx to MySQL

Igor Sysoev December 17, 2009 04:56AM

Re: piped logging from Nginx to MySQL

Igor Sysoev December 17, 2009 05:28AM

Re: piped logging from Nginx to MySQL

Eugene Mychlo December 17, 2009 05:40AM

Re: piped logging from Nginx to MySQL

Anton Yuzhaninov December 16, 2009 06:50AM

Re: piped logging from Nginx to MySQL

Igor Sysoev December 16, 2009 06:54AM

Re[2]: piped logging from Nginx to MySQL

akalend December 16, 2009 06:14AM

Re: piped logging from Nginx to MySQL

vromanov December 18, 2009 01:29AM

Re: piped logging from Nginx to MySQL

Sergey Averyanov December 18, 2009 03:04AM

Re: piped logging from Nginx to MySQL

Peter Vereshagin December 18, 2009 06:28AM

Re: piped logging from Nginx to MySQL

Andrew Sitnikov December 18, 2009 07:00AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 170
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready