pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
random_page_cost vs ssd?
8+ messages / 6 participants
[nested] [flat]

* random_page_cost vs ssd?
@ 2009-03-11 13:46 Jeff <threshar@torgo.978.org>
  2009-03-11 15:37 ` Re: random_page_cost vs ssd? Grzegorz Jaśkiewicz <gryzman@gmail.com>
  0 siblings, 1 reply; 8+ messages in thread

From: Jeff @ 2009-03-11 13:46 UTC (permalink / raw)
  To: pgsql-performance

I've got a couple x25-e's in production now and they are working like  
a champ.  (In fact, I've got another box being built with all x25s in  
it. its going to smoke!)

Anyway, I was just reading another thread on here and that made me  
wonder about random_page_cost in the world of an ssd where a seek is  
basically free.  I haven't tested this yet (I can do that next week),  
but logically, in this scenario wouldn't lowering random_page_cost be  
ideal or would it not really matter in the grand scheme of things?

--
Jeff Trout <jeff@jefftrout.com>
http://www.stuarthamm.net/
http://www.dellsmartexitin.com/






^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: random_page_cost vs ssd?
  2009-03-11 13:46 random_page_cost vs ssd? Jeff <threshar@torgo.978.org>
@ 2009-03-11 15:37 ` Grzegorz Jaśkiewicz <gryzman@gmail.com>
  2009-03-11 17:06   ` Re: random_page_cost vs ssd? Scott Carey <scott@richrelevance.com>
  0 siblings, 1 reply; 8+ messages in thread

From: Grzegorz Jaśkiewicz @ 2009-03-11 15:37 UTC (permalink / raw)
  To: Jeff <threshar@torgo.978.org>; +Cc: pgsql-performance

On Wed, Mar 11, 2009 at 1:46 PM, Jeff <threshar@torgo.978.org> wrote:
> I've got a couple x25-e's in production now and they are working like a
> champ.  (In fact, I've got another box being built with all x25s in it. its
> going to smoke!)
>
> Anyway, I was just reading another thread on here and that made me wonder
> about random_page_cost in the world of an ssd where a seek is basically
> free.  I haven't tested this yet (I can do that next week), but logically,
> in this scenario wouldn't lowering random_page_cost be ideal or would it not
> really matter in the grand scheme of things?

Just on a side note, random access on SSD is still more expensive than
sequential, because it is designed in banks.
If you don believe me, turn off any software/OS cache , and try random
access timing against seq reads.
This gap is just much much narrower.


-- 
GJ



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: random_page_cost vs ssd?
  2009-03-11 13:46 random_page_cost vs ssd? Jeff <threshar@torgo.978.org>
  2009-03-11 15:37 ` Re: random_page_cost vs ssd? Grzegorz Jaśkiewicz <gryzman@gmail.com>
@ 2009-03-11 17:06   ` Scott Carey <scott@richrelevance.com>
  2009-03-11 19:04     ` Re: random_page_cost vs ssd? Andrej <andrej.groups@gmail.com>
  0 siblings, 1 reply; 8+ messages in thread

From: Scott Carey @ 2009-03-11 17:06 UTC (permalink / raw)
  To: Grzegorz Jaśkiewicz <gryzman@gmail.com>; Jeff <threshar@torgo.978.org>; +Cc: pgsql-performance

At 8k block size, you can do more iops sequential than random.
A X25-M I was just playing with will do about 16K iops reads at 8k block size with 32 concurrent threads.
That is about 128MB/sec.  Sequential reads will do 250MB/sec.  At 16k block size it does about 220MB/sec and at 32k block size there is no penalty for random access.    All tests start with 'cat 3 > /proc/sys/vm/drop_caches', and work on a 32GB data set (40% of the disk).

Also, over time the actual location of the physical blocks will not map to the LBAs requested.  This means that internally a sequential read is actually a random read, and that a random write is actually a sequential write.  That is how the SSD's with good write performance are doing it, with advanced LBA to physical dynamic mapping.

As for the random_page_cost I'd make sure to set it virtually the same as the sequential cost.  Perhaps 1 for sequential and 1.1 for random.  One may also want to lower both of those values equally to be somewhat closer to the cpu costs.  You want the planner to generally conserve total block access count and not favor streaming reads too much over random reads.  


________________________________________
From: pgsql-performance-owner@postgresql.org [pgsql-performance-owner@postgresql.org] On Behalf Of Grzegorz Jaśkiewicz [gryzman@gmail.com]
Sent: Wednesday, March 11, 2009 8:37 AM

On Wed, Mar 11, 2009 at 1:46 PM, Jeff <threshar@torgo.978.org> wrote:
> I've got a couple x25-e's in production now and they are working like a
> champ.  (In fact, I've got another box being built with all x25s in it. its
> going to smoke!)
>
> Anyway, I was just reading another thread on here and that made me wonder
> about random_page_cost in the world of an ssd where a seek is basically
> free.  I haven't tested this yet (I can do that next week), but logically,
> in this scenario wouldn't lowering random_page_cost be ideal or would it not
> really matter in the grand scheme of things?

Just on a side note, random access on SSD is still more expensive than
sequential, because it is designed in banks.
If you don believe me, turn off any software/OS cache , and try random
access timing against seq reads.
This gap is just much much narrower.


--
GJ

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


^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: random_page_cost vs ssd?
  2009-03-11 13:46 random_page_cost vs ssd? Jeff <threshar@torgo.978.org>
  2009-03-11 15:37 ` Re: random_page_cost vs ssd? Grzegorz Jaśkiewicz <gryzman@gmail.com>
  2009-03-11 17:06   ` Re: random_page_cost vs ssd? Scott Carey <scott@richrelevance.com>
@ 2009-03-11 19:04     ` Andrej <andrej.groups@gmail.com>
  2009-03-11 19:28       ` Re: random_page_cost vs ssd? Scott Carey <scott@richrelevance.com>
  0 siblings, 1 reply; 8+ messages in thread

From: Andrej @ 2009-03-11 19:04 UTC (permalink / raw)
  To: Scott Carey <scott@richrelevance.com>; +Cc: Grzegorz Jaśkiewicz <gryzman@gmail.com>; Jeff <threshar@torgo.978.org>; pgsql-performance

2009/3/12 Scott Carey <scott@richrelevance.com>:
> [...snip...].    All tests start with 'cat 3 > /proc/sys/vm/drop_caches', and work on
>  a 32GB data set (40% of the disk).
What's the content of '3' above?

-- 
Please don't top post, and don't use HTML e-Mail :}  Make your quotes concise.

http://www.american.edu/econ/notes/htmlmail.htm



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: random_page_cost vs ssd?
  2009-03-11 13:46 random_page_cost vs ssd? Jeff <threshar@torgo.978.org>
  2009-03-11 15:37 ` Re: random_page_cost vs ssd? Grzegorz Jaśkiewicz <gryzman@gmail.com>
  2009-03-11 17:06   ` Re: random_page_cost vs ssd? Scott Carey <scott@richrelevance.com>
  2009-03-11 19:04     ` Re: random_page_cost vs ssd? Andrej <andrej.groups@gmail.com>
@ 2009-03-11 19:28       ` Scott Carey <scott@richrelevance.com>
  2009-03-11 19:32         ` Re: random_page_cost vs ssd? hubert depesz lubaczewski <depesz@depesz.com>
  2009-03-11 19:40         ` Re: random_page_cost vs ssd? Kevin Grittner <Kevin.Grittner@wicourts.gov>
  0 siblings, 2 replies; 8+ messages in thread

From: Scott Carey @ 2009-03-11 19:28 UTC (permalink / raw)
  To: Andrej <andrej.groups@gmail.com>; +Cc: Grzegorz Jaśkiewicz <gryzman@gmail.com>; Jeff <threshar@torgo.978.org>; pgsql-performance

Google > “linux drop_caches” first result:
http://www.linuxinsight.com/proc_sys_vm_drop_caches.html

To be sure a test is going to disk and not file system cache for everything in linux, run:
‘sync; cat 3 > /proc/sys/vm/drop_caches’

On 3/11/09 11:04 AM, "Andrej" <andrej.groups@gmail.com> wrote:

2009/3/12 Scott Carey <scott@richrelevance.com>:
> [...snip...].    All tests start with 'cat 3 > /proc/sys/vm/drop_caches', and work on
>  a 32GB data set (40% of the disk).
What's the content of '3' above?

--
Please don't top post, and don't use HTML e-Mail :}  Make your quotes concise.

http://www.american.edu/econ/notes/htmlmail.htm



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: random_page_cost vs ssd?
  2009-03-11 13:46 random_page_cost vs ssd? Jeff <threshar@torgo.978.org>
  2009-03-11 15:37 ` Re: random_page_cost vs ssd? Grzegorz Jaśkiewicz <gryzman@gmail.com>
  2009-03-11 17:06   ` Re: random_page_cost vs ssd? Scott Carey <scott@richrelevance.com>
  2009-03-11 19:04     ` Re: random_page_cost vs ssd? Andrej <andrej.groups@gmail.com>
  2009-03-11 19:28       ` Re: random_page_cost vs ssd? Scott Carey <scott@richrelevance.com>
@ 2009-03-11 19:32         ` hubert depesz lubaczewski <depesz@depesz.com>
  1 sibling, 0 replies; 8+ messages in thread

From: hubert depesz lubaczewski @ 2009-03-11 19:32 UTC (permalink / raw)
  To: Scott Carey <scott@richrelevance.com>; +Cc: Andrej <andrej.groups@gmail.com>; Grzegorz Jaśkiewicz <gryzman@gmail.com>; Jeff <threshar@real.jefftrout.com>; pgsql-performance

On Wed, Mar 11, 2009 at 12:28:56PM -0700, Scott Carey wrote:
> Google > “linux drop_caches” first result:
> http://www.linuxinsight.com/proc_sys_vm_drop_caches.html
> To be sure a test is going to disk and not file system cache for everything in linux, run:
> ‘sync; cat 3 > /proc/sys/vm/drop_caches’

well. the url you showed tells to do: echo 3 > ...
cat 3 is "slightly" different.

Best regards,

depesz

-- 
Linkedin: http://www.linkedin.com/in/depesz  /  blog: http://www.depesz.com/
jid/gtalk: depesz@depesz.com / aim:depeszhdl / skype:depesz_hdl / gg:6749007



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: random_page_cost vs ssd?
  2009-03-11 13:46 random_page_cost vs ssd? Jeff <threshar@torgo.978.org>
  2009-03-11 15:37 ` Re: random_page_cost vs ssd? Grzegorz Jaśkiewicz <gryzman@gmail.com>
  2009-03-11 17:06   ` Re: random_page_cost vs ssd? Scott Carey <scott@richrelevance.com>
  2009-03-11 19:04     ` Re: random_page_cost vs ssd? Andrej <andrej.groups@gmail.com>
  2009-03-11 19:28       ` Re: random_page_cost vs ssd? Scott Carey <scott@richrelevance.com>
@ 2009-03-11 19:40         ` Kevin Grittner <Kevin.Grittner@wicourts.gov>
  2009-03-11 20:31           ` Re: random_page_cost vs ssd? Scott Carey <scott@richrelevance.com>
  1 sibling, 1 reply; 8+ messages in thread

From: Kevin Grittner @ 2009-03-11 19:40 UTC (permalink / raw)
  To: Scott Carey <scott@richrelevance.com>; +Cc: gryzman@gmail.com; Andrej <andrej.groups@gmail.com; pgsql-performance; Jeff <threshar@torgo.978.org>

Scott Carey <scott@richrelevance.com> wrote:
> On 3/11/09 11:04 AM, "Andrej" <andrej.groups@gmail.com> wrote:
>> 2009/3/12 Scott Carey <scott@richrelevance.com>:
 
>>> All tests start with 'cat 3 > /proc/sys/vm/drop_caches'
 
>> What's the content of '3' above?
 
> Google > *linux drop_caches* first result:
> http://www.linuxinsight.com/proc_sys_vm_drop_caches.html
> 
> To be sure a test is going to disk and not file system cache for
> everything in linux, run:
> *sync; cat 3 > /proc/sys/vm/drop_caches*
 
The cited page recommends "echo 3" -- is that what you used in your
tests, or the "cat 3" you repeated specify?  If the latter, what is in
the "3" file?
 
>> Please don't top post, and don't use HTML e-Mail :}  Make your
>> quotes concise.
>> 
>> http://www.american.edu/econ/notes/htmlmail.htm
 
Did you miss this part?
 
-Kevin



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: random_page_cost vs ssd?
  2009-03-11 13:46 random_page_cost vs ssd? Jeff <threshar@torgo.978.org>
  2009-03-11 15:37 ` Re: random_page_cost vs ssd? Grzegorz Jaśkiewicz <gryzman@gmail.com>
  2009-03-11 17:06   ` Re: random_page_cost vs ssd? Scott Carey <scott@richrelevance.com>
  2009-03-11 19:04     ` Re: random_page_cost vs ssd? Andrej <andrej.groups@gmail.com>
  2009-03-11 19:28       ` Re: random_page_cost vs ssd? Scott Carey <scott@richrelevance.com>
  2009-03-11 19:40         ` Re: random_page_cost vs ssd? Kevin Grittner <Kevin.Grittner@wicourts.gov>
@ 2009-03-11 20:31           ` Scott Carey <scott@richrelevance.com>
  0 siblings, 0 replies; 8+ messages in thread

From: Scott Carey @ 2009-03-11 20:31 UTC (permalink / raw)
  To: Kevin Grittner <Kevin.Grittner@wicourts.gov>; +Cc: gryzman@gmail.com <gryzman@gmail.com>; \ <Andrej <andrej.groups@gmail.com>; \"" <"<Andrej <andrej.groups@gmail.com>; pgsql-performance

Echo.  It was a typo.


On 3/11/09 11:40 AM, "Kevin Grittner" <Kevin.Grittner@wicourts.gov> wrote:

Scott Carey <scott@richrelevance.com> wrote:
> On 3/11/09 11:04 AM, "Andrej" <andrej.groups@gmail.com> wrote:
>> 2009/3/12 Scott Carey <scott@richrelevance.com>:

>>> All tests start with 'cat 3 > /proc/sys/vm/drop_caches'

>> What's the content of '3' above?

> Google > *linux drop_caches* first result:
> http://www.linuxinsight.com/proc_sys_vm_drop_caches.html
>
> To be sure a test is going to disk and not file system cache for
> everything in linux, run:
> *sync; cat 3 > /proc/sys/vm/drop_caches*

The cited page recommends "echo 3" -- is that what you used in your
tests, or the "cat 3" you repeated specify?  If the latter, what is in
the "3" file?

>> Please don't top post, and don't use HTML e-Mail :}  Make your
>> quotes concise.
>>
>> http://www.american.edu/econ/notes/htmlmail.htm

Did you miss this part?

-Kevin

^ permalink  raw  reply  [nested|flat] 8+ messages in thread


end of thread, other threads:[~2009-03-11 20:31 UTC | newest]

Thread overview: 8+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2009-03-11 13:46 random_page_cost vs ssd? Jeff <threshar@torgo.978.org>
2009-03-11 15:37 ` Grzegorz Jaśkiewicz <gryzman@gmail.com>
2009-03-11 17:06   ` Scott Carey <scott@richrelevance.com>
2009-03-11 19:04     ` Andrej <andrej.groups@gmail.com>
2009-03-11 19:28       ` Scott Carey <scott@richrelevance.com>
2009-03-11 19:32         ` hubert depesz lubaczewski <depesz@depesz.com>
2009-03-11 19:40         ` Kevin Grittner <Kevin.Grittner@wicourts.gov>
2009-03-11 20:31           ` Scott Carey <scott@richrelevance.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox