kafka-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jay Kreps <jay.kr...@gmail.com>
Subject Re: Messages from producer are immediately going to /tmp/logs in kafka
Date Mon, 14 Oct 2013 17:28:50 GMT
I believe this is the first complaint we have got on a lack of data loss.
:-)

The behavior of kafka is to immediately write all messages to the
filesystem. The operating system will sync the file to disk at its own pace
(we give some docs on how linux does it in our operations section in the
kafka docs and this is pretty well documented on the internet). As the docs
say, the configuration you are describing just controls the frequency with
which kafka forces an fsync and has nothing to do with writing to the fs
(which is always immediate). Fysnc makes the os write the data in its cache
to physical disk.

This makes forcing message loss a little hard.  Killing the process won't
work because the data is not stored in the application memory it is in the
filesystem cache. Shutting down the machine will not cause this as the OS
flushes the data to disk before shutting down. If you want to force data
loss I think you need to yank the plug on the machine immediately after a
write but prior to both an application level fsync and the OS's own flush
policy.

-Jay

-Jay


On Mon, Oct 14, 2013 at 10:00 AM, Monika Garg <gargmoni03@gmail.com> wrote:

> Thanks for replying Jun.
>
> I also thought the same.
> But I got the same messages in my /kafka/logs dir  even after rebooting my
> machine in less than the time given by  log.flush.interval.ms=900000.
> So can you please suggest me any way to check that messages are actually
> loosing after machine shutdown?
>
>
> On Fri, Oct 11, 2013 at 8:56 PM, Jun Rao <junrao@gmail.com> wrote:
>
> > Those messages could still be in file system pagecache and may not be
> > flushed to disks.
> >
> > Thanks,
> >
> > Jun
> >
> >
> > On Thu, Oct 10, 2013 at 11:20 PM, Monika Garg <gargmoni03@gmail.com>
> > wrote:
> >
> > > Hi,
> > >
> > > In kafka-0.8 there are three important properties given for
> > >
> > > log.flush.interval.messages=10000
> > >
> > > log.flush.interval.ms=900000
> > >
> > > log.flush.scheduler.interval.ms=900000
> > >
> > > I have set the above properties as I have mentioned above.Then I
> started
> > > Kafka Console Producer given with kafka bundle-0.8 and gave some
> > > messages.The message are going to log partitions of given topic
> > > immediately.
> > >
> > > I am confused why the messages are flushing to /tmp/logs
> immediately,They
> > > should wait as per log.flush.interval.messages=
> > > 10000 or  log.flush.interval.ms=900000.
> > >
> > > Please check.
> > >
> > > --
> > > *Moniii*
> > >
> > >
> > >
> > > --
> > > *Moniii*
> > >
> >
>
>
>
> --
> *Moniii*
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message