Can checkpoint creation be parallel?

Started by 高健over 12 years ago5 messagesgeneral
Jump to latest
#1高健
luckyjackgao@gmail.com

Hello:

Sorry for disturbing:

I have one question about checkponint . That is : can checkpoint be
parallel?

It is said that checkpoint will be activated according to either conditions:

1)After last checkpoint, checkpoint_timeout seconds passed.

2)When shared_buffers memory above checkpoint_segments size is filled with
data.

My experience is that :

There is only one checkpoint process there and works, and even when there
are many data created during transactions,

There will also be only one checkpoint process deal with it

(maybe background writer or some other server process will deal it)?

And also, I think when the above 1) or 2) activated checkpoint ,

after the checkpoint data creation, then the 1) and 2) value will be to
zero and calculated again.

So I think that checkpoint will not be created parallel.

Is my understanding right?

And if there are some official documentation from www.postgresql.org or
somewhere else, I'll be very appreciative.

Thanks!

Jian Gao

#2Laurenz Albe
laurenz.albe@cybertec.at
In reply to: 高健 (#1)
Re: Can checkpoint creation be parallel?

高健 wrote:

I have one question about checkponint . That is : can checkpoint be parallel?

It is said that checkpoint will be activated according to either conditions:

1)After last checkpoint, checkpoint_timeout seconds passed.

2)When shared_buffers memory above checkpoint_segments size is filled with data.

My experience is that :

There is only one checkpoint process there and works, and even when there are many data created during
transactions,

There will also be only one checkpoint process deal with it

(maybe background writer or some other server process will deal it)?

It would not make sense to have more than one checkpoint going on
at the same time; it is a point at which recovery can begin.

And also, I think when the above 1) or 2) activated checkpoint ,

after the checkpoint data creation, then the 1) and 2) value will be to zero and calculated again.

So I think that checkpoint will not be created parallel.

Is my understanding right?

Yes.

And if there are some official documentation from www.postgresql.org or somewhere else, I'll be very
appreciative.

http://www.postgresql.org/docs/9.3/static/wal-configuration.html

"A checkpoint is begun every checkpoint_segments log segments,
or every checkpoint_timeout seconds, whichever comes first."

Yours,
Laurenz Albe

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#3Jeff Janes
jeff.janes@gmail.com
In reply to: 高健 (#1)
Re: Can checkpoint creation be parallel?

On Tue, Oct 8, 2013 at 1:54 AM, 高健 <luckyjackgao@gmail.com> wrote:

Hello:

Sorry for disturbing:

I have one question about checkponint . That is : can checkpoint be
parallel?

PostgreSQL does not currently implement it that way. And it is hard to see
what the benefit would be of doing so. But it should be theoretically
possible.

It is said that checkpoint will be activated according to either
conditions:

1)After last checkpoint, checkpoint_timeout seconds passed.

After the *start* of the last checkpoint. Provided that the last
checkpoint has finished.

2)When shared_buffers memory above checkpoint_segments size is filled
with data.

It is not shared_buffers that is measured, but the WAL files themselves
(which effectively means wal_buffers usage) that is measured.

My experience is that :

There is only one checkpoint process there and works, and even when there
are many data created during transactions,

There will also be only one checkpoint process deal with it

(maybe background writer or some other server process will deal it)?

The background writer and ordinary backends might write data (for their own
reasons) that the checkpointer would have otherwise needed to write anyway.

Cheers,

Jeff

#4高健
luckyjackgao@gmail.com
In reply to: Jeff Janes (#3)
Re: Can checkpoint creation be parallel?

Thanks a lot for all your kindly replying!

The background writer and ordinary backends might write data (for their

own rea>sons) that the checkpointer would have otherwise needed to write
anyway.

And does the ordinary backends refer to
the ones created when a client make a connection to PG?

For exampel:
When staring PG:
[root@pg200 ~]# ps -ef | grep post
root 3039 3015 0 11:02 pts/1 00:00:00 su - postgres
postgres 3040 3039 0 11:02 pts/1 00:00:00 -bash
postgres 3093 1 0 11:03 pts/1 00:00:00
/usr/local/pgsql/bin/postgres -D ./data
postgres 3095 3093 0 11:03 ? 00:00:00 postgres: checkpointer
process
postgres 3096 3093 0 11:03 ? 00:00:00 postgres: writer process

postgres 3097 3093 0 11:03 ? 00:00:00 postgres: wal writer
process
postgres 3098 3093 0 11:03 ? 00:00:00 postgres: autovacuum
launcher process
postgres 3099 3093 0 11:03 ? 00:00:00 postgres: stats collector
process
root 3126 3103 0 11:03 pts/2 00:00:00 grep post

After using psql to connect:
[root@pg200 ~]# ps -ef | grep post
root 3039 3015 0 11:02 pts/1 00:00:00 su - postgres
postgres 3040 3039 0 11:02 pts/1 00:00:00 -bash
postgres 3093 1 0 11:03 pts/1 00:00:00
/usr/local/pgsql/bin/postgres -D ./data
postgres 3095 3093 0 11:03 ? 00:00:00 postgres: checkpointer
process
postgres 3096 3093 0 11:03 ? 00:00:00 postgres: writer process

postgres 3097 3093 0 11:03 ? 00:00:00 postgres: wal writer
process
postgres 3098 3093 0 11:03 ? 00:00:00 postgres: autovacuum
launcher process
postgres 3099 3093 0 11:03 ? 00:00:00 postgres: stats collector
process
root 3150 3130 0 11:03 pts/3 00:00:00 su - postgres
postgres 3151 3150 0 11:03 pts/3 00:00:00 -bash
postgres 3183 3151 0 11:04 pts/3 00:00:00 ./psql
postgres 3184 3093 0 11:04 ? 00:00:00 postgres: postgres postgres
[local] idle
root 3186 3103 0 11:04 pts/2 00:00:00 grep post
[root@pg200 ~]#

Does the above ordinary backends mean to the process 3184?

Best Regards

jian gao

2013/10/9 Jeff Janes <jeff.janes@gmail.com>

Show quoted text

On Tue, Oct 8, 2013 at 1:54 AM, 高健 <luckyjackgao@gmail.com> wrote:

Hello:

Sorry for disturbing:

I have one question about checkponint . That is : can checkpoint be
parallel?

PostgreSQL does not currently implement it that way. And it is hard to
see what the benefit would be of doing so. But it should be theoretically
possible.

It is said that checkpoint will be activated according to either
conditions:

1)After last checkpoint, checkpoint_timeout seconds passed.

After the *start* of the last checkpoint. Provided that the last
checkpoint has finished.

2)When shared_buffers memory above checkpoint_segments size is filled
with data.

It is not shared_buffers that is measured, but the WAL files themselves
(which effectively means wal_buffers usage) that is measured.

My experience is that :

There is only one checkpoint process there and works, and even when there
are many data created during transactions,

There will also be only one checkpoint process deal with it

(maybe background writer or some other server process will deal it)?

The background writer and ordinary backends might write data (for their
own reasons) that the checkpointer would have otherwise needed to write
anyway.

Cheers,

Jeff

#5Laurenz Albe
laurenz.albe@cybertec.at
In reply to: 高健 (#4)
Re: Can checkpoint creation be parallel?

高健 wrote:

The background writer and ordinary backends might write data
(for their own rea>sons) that the
checkpointer would have otherwise needed to write anyway.

And does the ordinary backends refer to
the ones created when a client make a connection to PG?

Yes.

Yours,
Laurenz Albe

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general