Re: Difference between log-buffer "flushing" and "log-buffer" syncing?

2014-04-17 Thread Ajay Garg
On Thu, Apr 17, 2014 at 3:03 PM, Manuel Arostegui  wrote:

>
>
>
> 2014-04-17 11:11 GMT+02:00 Ajay Garg :
>
> On Thu, Apr 17, 2014 at 2:28 PM, Reindl Harald > >wrote:
>>
>> >
>> >
>> > Am 17.04.2014 10:55, schrieb Ajay Garg:
>> > > I do understand the meaning of Unix "sync" function.
>> > >
>> > > So, you mean to say that "flushing" and "syncing" are same, in the
>> > context of MySQL?
>> >
>> > please get rid of top-posting and reply-all
>> >
>> > a flush without a sync is "dear operating system, may i ask you to write
>> > that to disk if you find the time to do so" while a sync is "write that
>> > to disk" without a nice asking
>> >
>>
>> Thanks Reindl, that clears it up !!
>
>
> Keep in mind that if you are using HW RAID controller (and a BBU) the
> concept of write-back and write-through are important to have in mind too
> whilst thinking about how and when your data is written to disk.
> If you enable sync_binlog and trx_commit to 1, it might not necessarily be
> committing on every transaction to disk, as it might depend on how you've
> configured your controller.
>
> If you have write-through configured, the data will be written to disk and
> cache at the same time (this has a performance drawback).
> If you have write-back configured, the data will be written to cache (and
> then to disk, but _not_ at the same time) so you might lose data if there's
> a power failure. When you have write-back, at an OS level your data has
> been sync'ed to disk even though this is not totally true.
> write-back is better for performance, but you have to keep in mind that
> you can lose data (which is not common, but you're not 100% safe).
>
> Hope this helps
>


Thanks Manuel for the note !!
It certainly is something to keep in mind !!



> Manuel.
>
>



-- 
Regards,
Ajay


Re: Difference between log-buffer "flushing" and "log-buffer" syncing?

2014-04-17 Thread Manuel Arostegui
2014-04-17 11:11 GMT+02:00 Ajay Garg :

> On Thu, Apr 17, 2014 at 2:28 PM, Reindl Harald  >wrote:
>
> >
> >
> > Am 17.04.2014 10:55, schrieb Ajay Garg:
> > > I do understand the meaning of Unix "sync" function.
> > >
> > > So, you mean to say that "flushing" and "syncing" are same, in the
> > context of MySQL?
> >
> > please get rid of top-posting and reply-all
> >
> > a flush without a sync is "dear operating system, may i ask you to write
> > that to disk if you find the time to do so" while a sync is "write that
> > to disk" without a nice asking
> >
>
> Thanks Reindl, that clears it up !!


Keep in mind that if you are using HW RAID controller (and a BBU) the
concept of write-back and write-through are important to have in mind too
whilst thinking about how and when your data is written to disk.
If you enable sync_binlog and trx_commit to 1, it might not necessarily be
committing on every transaction to disk, as it might depend on how you've
configured your controller.

If you have write-through configured, the data will be written to disk and
cache at the same time (this has a performance drawback).
If you have write-back configured, the data will be written to cache (and
then to disk, but _not_ at the same time) so you might lose data if there's
a power failure. When you have write-back, at an OS level your data has
been sync'ed to disk even though this is not totally true.
write-back is better for performance, but you have to keep in mind that you
can lose data (which is not common, but you're not 100% safe).

Hope this helps
Manuel.


Re: Difference between log-buffer "flushing" and "log-buffer" syncing?

2014-04-17 Thread Ajay Garg
On Thu, Apr 17, 2014 at 2:28 PM, Reindl Harald wrote:

>
>
> Am 17.04.2014 10:55, schrieb Ajay Garg:
> > I do understand the meaning of Unix "sync" function.
> >
> > So, you mean to say that "flushing" and "syncing" are same, in the
> context of MySQL?
>
> please get rid of top-posting and reply-all
>
> a flush without a sync is "dear operating system, may i ask you to write
> that to disk if you find the time to do so" while a sync is "write that
> to disk" without a nice asking
>

Thanks Reindl, that clears it up !!




>
> > On Thu, Apr 17, 2014 at 2:15 PM, Reindl Harald 
> >  h.rei...@thelounge.net>> wrote:
> >
> >
> > Am 17.04.2014 10:37, schrieb Ajay Garg:
> > > I am a newbie to MySQL, and have been going through several online
> > > resources.
> > >
> > > I usually come across the terms - "flushing" and "syncing" the
> log-buffer.
> > > In particular, these two terms hold great significance while
> selecting the
> > > value of
> > "innodb_flush_log_at_trx_commit<
> http://dev.mysql.com/doc/refman/4.1/en/innodb-parameters.html#sysvar_innodb_flush_log_at_trx_commit
> >
> > > ".
> > >
> > > So, I will be grateful if I could gain some light on the
> differences
> > > between the two terms
> >
> >
> > SYNC(1)User Commands
> >  SYNC(1)
> >
> > NAME
> >sync - flush file system buffers
> >
> > SYNOPSIS
> >sync [OPTION]
> >
> > DESCRIPTION
> >Force changed blocks to disk, update the super block
>
>


-- 
Regards,
Ajay


Re: Difference between log-buffer "flushing" and "log-buffer" syncing?

2014-04-17 Thread Reindl Harald


Am 17.04.2014 10:55, schrieb Ajay Garg:
> I do understand the meaning of Unix "sync" function.
> 
> So, you mean to say that "flushing" and "syncing" are same, in the context of 
> MySQL?

please get rid of top-posting and reply-all

a flush without a sync is "dear operating system, may i ask you to write
that to disk if you find the time to do so" while a sync is "write that
to disk" without a nice asking

> On Thu, Apr 17, 2014 at 2:15 PM, Reindl Harald  > wrote:
> 
> 
> Am 17.04.2014 10:37, schrieb Ajay Garg:
> > I am a newbie to MySQL, and have been going through several online
> > resources.
> >
> > I usually come across the terms - "flushing" and "syncing" the 
> log-buffer.
> > In particular, these two terms hold great significance while selecting 
> the
> > value of
> 
> "innodb_flush_log_at_trx_commit
> > ".
> >
> > So, I will be grateful if I could gain some light on the differences
> > between the two terms
> 
> 
> SYNC(1)User Commands
>  SYNC(1)
> 
> NAME
>sync - flush file system buffers
> 
> SYNOPSIS
>sync [OPTION]
> 
> DESCRIPTION
>Force changed blocks to disk, update the super block



signature.asc
Description: OpenPGP digital signature


Re: Difference between log-buffer "flushing" and "log-buffer" syncing?

2014-04-17 Thread Ajay Garg
Reindl,

I do understand the meaning of Unix "sync" function.

So, you mean to say that "flushing" and "syncing" are same, in the context
of MySQL?


On Thu, Apr 17, 2014 at 2:15 PM, Reindl Harald wrote:

>
> Am 17.04.2014 10:37, schrieb Ajay Garg:
> > I am a newbie to MySQL, and have been going through several online
> > resources.
> >
> > I usually come across the terms - "flushing" and "syncing" the
> log-buffer.
> > In particular, these two terms hold great significance while selecting
> the
> > value of "innodb_flush_log_at_trx_commit<
> http://dev.mysql.com/doc/refman/4.1/en/innodb-parameters.html#sysvar_innodb_flush_log_at_trx_commit
> >
> > ".
> >
> > So, I will be grateful if I could gain some light on the differences
> > between the two terms
>
>
> SYNC(1)User Commands
>  SYNC(1)
>
> NAME
>sync - flush file system buffers
>
> SYNOPSIS
>sync [OPTION]
>
> DESCRIPTION
>Force changed blocks to disk, update the super block.
>
>
>


-- 
Regards,
Ajay


Re: Difference between log-buffer "flushing" and "log-buffer" syncing?

2014-04-17 Thread Reindl Harald

Am 17.04.2014 10:37, schrieb Ajay Garg:
> I am a newbie to MySQL, and have been going through several online
> resources.
> 
> I usually come across the terms - "flushing" and "syncing" the log-buffer.
> In particular, these two terms hold great significance while selecting the
> value of 
> "innodb_flush_log_at_trx_commit
> ".
> 
> So, I will be grateful if I could gain some light on the differences
> between the two terms


SYNC(1)User Commands
 SYNC(1)

NAME
   sync - flush file system buffers

SYNOPSIS
   sync [OPTION]

DESCRIPTION
   Force changed blocks to disk, update the super block.




signature.asc
Description: OpenPGP digital signature