public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* /proc/sys/vm/(max|min)-readahead effect????
@ 2001-12-05 16:21 Roy Sigurd Karlsbakk
  2001-12-05 16:51 ` Marcelo Tosatti
  2001-12-05 20:13 ` Andrew Morton
  0 siblings, 2 replies; 18+ messages in thread
From: Roy Sigurd Karlsbakk @ 2001-12-05 16:21 UTC (permalink / raw)
  To: linux-kernel

hi all

I've just upgraded to 2.4.16 to get /proc/sys/vm/(max|min)-readahead
available. I've got this idea...

If lots of files (some hundered) are read simultaously, I waste all the
i/o time in seeks. However, if I increase the readahead, it'll read more
data at a time, and end up with seeking a lot less.

The harddrive I'm testing this with, is a cheap 20G IDE drive. It can give
me a peak thoughput of about 28 MB/s (reading).
When running 10 simultanous dd jobs ('dd if=filenr of=/dev/null bs=4m'), I
peaks at some 8,5 MB/s no matter what I set the min/max readahead to!!

Is this correct?

Is there perhaps another way to set the real readahead? In source???

Thanks a lot for all help

roy

--
Roy Sigurd Karlsbakk, MCSE, MCNE, CLS, LCA

Computers are like air conditioners.
They stop working when you open Windows.


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

* Re: /proc/sys/vm/(max|min)-readahead effect????
  2001-12-05 16:21 /proc/sys/vm/(max|min)-readahead effect???? Roy Sigurd Karlsbakk
@ 2001-12-05 16:51 ` Marcelo Tosatti
  2001-12-05 18:09   ` Roy Sigurd Karlsbakk
  2001-12-05 18:22   ` Rik van Riel
  2001-12-05 20:13 ` Andrew Morton
  1 sibling, 2 replies; 18+ messages in thread
From: Marcelo Tosatti @ 2001-12-05 16:51 UTC (permalink / raw)
  To: Roy Sigurd Karlsbakk; +Cc: linux-kernel



On Wed, 5 Dec 2001, Roy Sigurd Karlsbakk wrote:

> hi all
> 
> I've just upgraded to 2.4.16 to get /proc/sys/vm/(max|min)-readahead
> available. I've got this idea...
> 
> If lots of files (some hundered) are read simultaously, I waste all the
> i/o time in seeks. However, if I increase the readahead, it'll read more
> data at a time, and end up with seeking a lot less.
> 
> The harddrive I'm testing this with, is a cheap 20G IDE drive. It can give
> me a peak thoughput of about 28 MB/s (reading).
> When running 10 simultanous dd jobs ('dd if=filenr of=/dev/null bs=4m'), I
> peaks at some 8,5 MB/s no matter what I set the min/max readahead to!!
> 
> Is this correct?

Do you also have VM pressure going on or do you have lots of free memory ? 


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

* Re: /proc/sys/vm/(max|min)-readahead effect????
  2001-12-05 18:09   ` Roy Sigurd Karlsbakk
@ 2001-12-05 16:58     ` Marcelo Tosatti
  2001-12-05 18:20       ` Roy Sigurd Karlsbakk
  0 siblings, 1 reply; 18+ messages in thread
From: Marcelo Tosatti @ 2001-12-05 16:58 UTC (permalink / raw)
  To: Roy Sigurd Karlsbakk; +Cc: linux-kernel



On Wed, 5 Dec 2001, Roy Sigurd Karlsbakk wrote:

> > Do you also have VM pressure going on or do you have lots of free memory ?
> 
> I've got a lot of memory (some 380 megs), but what is VM pressure?

VM pressure means that there is not enough free memory on the system...
Allocators have to reclaim memory.

Basically you cannot simply expect an increase in readahead size to
increase performance:

1) The files you created may not be sequential
2) The lack of memory on the system may be interfering in weird ways, and
maybe _INCREASING_ the readahead may decrease performance.
...

Also, remember: The real applications running on the system may not want
to read files sequentially, so increasing readahead is just useless. 


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

* Re: /proc/sys/vm/(max|min)-readahead effect????
  2001-12-05 16:51 ` Marcelo Tosatti
@ 2001-12-05 18:09   ` Roy Sigurd Karlsbakk
  2001-12-05 16:58     ` Marcelo Tosatti
  2001-12-05 18:22   ` Rik van Riel
  1 sibling, 1 reply; 18+ messages in thread
From: Roy Sigurd Karlsbakk @ 2001-12-05 18:09 UTC (permalink / raw)
  To: Marcelo Tosatti; +Cc: linux-kernel

> Do you also have VM pressure going on or do you have lots of free memory ?

I've got a lot of memory (some 380 megs), but what is VM pressure?
--
Roy Sigurd Karlsbakk, MCSE, MCNE, CLS, LCA

Computers are like air conditioners.
They stop working when you open Windows.


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

* Re: /proc/sys/vm/(max|min)-readahead effect????
  2001-12-05 16:58     ` Marcelo Tosatti
@ 2001-12-05 18:20       ` Roy Sigurd Karlsbakk
  2001-12-05 19:43         ` James Stevenson
  0 siblings, 1 reply; 18+ messages in thread
From: Roy Sigurd Karlsbakk @ 2001-12-05 18:20 UTC (permalink / raw)
  To: Marcelo Tosatti; +Cc: linux-kernel

> > I've got a lot of memory (some 380 megs), but what is VM pressure?
>
> VM pressure means that there is not enough free memory on the system...
> Allocators have to reclaim memory.

There's more than enough memory on the system, as far as I can see

[root@linuxserver ext2]# free
             total       used       free     shared    buffers     cached
Mem:        381500     378136       3364          0       3552     333348
-/+ buffers/cache:      41236     340264
Swap:       522104      11440     510664

> Basically you cannot simply expect an increase in readahead size to
> increase performance:
>
> 1) The files you created may not be sequential

Beleive me - they are! Created with 'dd' secuentially

> 2) The lack of memory on the system may be interfering in weird ways, and
> maybe _INCREASING_ the readahead may decrease performance.

Anyway - I beleive I should have seen some change by trying virtually any
value from 31 to 4095.

If the readahead is what I beleive it is, It'll read further out in the
file when a request comes. It looks like either this never happens, or the
next request doesn't 'know' how much is cached.

roy

--
Roy Sigurd Karlsbakk, MCSE, MCNE, CLS, LCA

Computers are like air conditioners.
They stop working when you open Windows.


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

* Re: /proc/sys/vm/(max|min)-readahead effect????
  2001-12-05 16:51 ` Marcelo Tosatti
  2001-12-05 18:09   ` Roy Sigurd Karlsbakk
@ 2001-12-05 18:22   ` Rik van Riel
  2001-12-05 18:27     ` Roy Sigurd Karlsbakk
  1 sibling, 1 reply; 18+ messages in thread
From: Rik van Riel @ 2001-12-05 18:22 UTC (permalink / raw)
  To: Marcelo Tosatti; +Cc: Roy Sigurd Karlsbakk, linux-kernel

On Wed, 5 Dec 2001, Marcelo Tosatti wrote:
> On Wed, 5 Dec 2001, Roy Sigurd Karlsbakk wrote:
>
> > I've just upgraded to 2.4.16 to get /proc/sys/vm/(max|min)-readahead
> > available. I've got this idea...
> >
> > If lots of files (some hundered) are read simultaously, I waste all the
> > i/o time in seeks. However, if I increase the readahead, it'll read more
> > data at a time, and end up with seeking a lot less.
>
> Do you also have VM pressure going on or do you have lots of free memory ?

I suspect the per-device readahead for IDE is limiting the
effect of vm_max_readahead ...

Rik
-- 
Shortwave goes a long way:  irc.starchat.net  #swl

http://www.surriel.com/		http://distro.conectiva.com/


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

* Re: /proc/sys/vm/(max|min)-readahead effect????
  2001-12-05 18:22   ` Rik van Riel
@ 2001-12-05 18:27     ` Roy Sigurd Karlsbakk
  2001-12-06 10:09       ` Martin Dalecki
  0 siblings, 1 reply; 18+ messages in thread
From: Roy Sigurd Karlsbakk @ 2001-12-05 18:27 UTC (permalink / raw)
  To: Rik van Riel; +Cc: Marcelo Tosatti, linux-kernel

> I suspect the per-device readahead for IDE is limiting the
> effect of vm_max_readahead ...

hm...

any way to avoid this? I mean... The readahead in vm is layered above the
actual device, and should therefore not be limited... Am I right? You
could do several device calls, and fake readahead, and probably get pretty
much out of it.


--
Roy Sigurd Karlsbakk, MCSE, MCNE, CLS, LCA

Computers are like air conditioners.
They stop working when you open Windows.


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

* Re: /proc/sys/vm/(max|min)-readahead effect????
  2001-12-05 18:20       ` Roy Sigurd Karlsbakk
@ 2001-12-05 19:43         ` James Stevenson
  2001-12-05 20:06           ` Roy Sigurd Karlsbakk
  0 siblings, 1 reply; 18+ messages in thread
From: James Stevenson @ 2001-12-05 19:43 UTC (permalink / raw)
  To: Roy Sigurd Karlsbakk, Marcelo Tosatti; +Cc: linux-kernel



> > Basically you cannot simply expect an increase in readahead size to
> > increase performance:
> >
> > 1) The files you created may not be sequential
>
> Beleive me - they are! Created with 'dd' secuentially

thats still does not mean they are sequential creating
large files almost always causes them to fragment.

Actually does anyone know of an easy way to find out
if certin files are fragmented and by how much ?





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

* Re: /proc/sys/vm/(max|min)-readahead effect????
  2001-12-05 19:43         ` James Stevenson
@ 2001-12-05 20:06           ` Roy Sigurd Karlsbakk
  2001-12-05 20:53             ` James Stevenson
  0 siblings, 1 reply; 18+ messages in thread
From: Roy Sigurd Karlsbakk @ 2001-12-05 20:06 UTC (permalink / raw)
  To: James Stevenson; +Cc: Marcelo Tosatti, linux-kernel

> thats still does not mean they are sequential creating
> large files almost always causes them to fragment.

ok...
mkfs /dev/hdb1
dd if=/dev/zero of=some-file bs=x count=x

		What can fragment this file????


after that - wget http://localhost/some-file - watch vmstat, and find it's
pushing data at around 28 MB/s

then - start ten wget's retrieving different files, and watch vmstat,
finding the maximum thoughput I can get is ~ 10 MB/s - almost one third.

If I could tell the kernel, the app (tux) or whatever, to do readahead -
say some 4 megs per file, it'd work like hell! Seeks are reduced to a
minimum and everyone's happy again

> Actually does anyone know of an easy way to find out
> if certin files are fragmented and by how much ?

I beleive there used to be a utility called 'frag' or something, to check
the fragmentation of files

roy
--
Roy Sigurd Karlsbakk, MCSE, MCNE, CLS, LCA

Computers are like air conditioners.
They stop working when you open Windows.


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

* Re: /proc/sys/vm/(max|min)-readahead effect????
  2001-12-05 16:21 /proc/sys/vm/(max|min)-readahead effect???? Roy Sigurd Karlsbakk
  2001-12-05 16:51 ` Marcelo Tosatti
@ 2001-12-05 20:13 ` Andrew Morton
  2001-12-05 20:53   ` Roger Larsson
  2001-12-06 11:31   ` Roy Sigurd Karlsbakk
  1 sibling, 2 replies; 18+ messages in thread
From: Andrew Morton @ 2001-12-05 20:13 UTC (permalink / raw)
  To: Roy Sigurd Karlsbakk; +Cc: linux-kernel

Roy Sigurd Karlsbakk wrote:
> 
> hi all
> 
> I've just upgraded to 2.4.16 to get /proc/sys/vm/(max|min)-readahead
> available. I've got this idea...
> 
> If lots of files (some hundered) are read simultaously, I waste all the
> i/o time in seeks. However, if I increase the readahead, it'll read more
> data at a time, and end up with seeking a lot less.
> 
> The harddrive I'm testing this with, is a cheap 20G IDE drive.

/proc/sys/vm/*-readhead is a no-op for IDE.  It doesn't do
anything.   You must use

	echo file_readahead:100 > /proc/ide/ide0/hda/settings

to set the readhead to 100 pages (409600 bytes).

-

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

* Re: /proc/sys/vm/(max|min)-readahead effect????
  2001-12-05 20:13 ` Andrew Morton
@ 2001-12-05 20:53   ` Roger Larsson
  2001-12-06 11:31   ` Roy Sigurd Karlsbakk
  1 sibling, 0 replies; 18+ messages in thread
From: Roger Larsson @ 2001-12-05 20:53 UTC (permalink / raw)
  To: Andrew Morton, Roy Sigurd Karlsbakk; +Cc: linux-kernel

On Wednesday 05 December 2001 21:13, Andrew Morton wrote:
> Roy Sigurd Karlsbakk wrote:
> > hi all
> >
> > I've just upgraded to 2.4.16 to get /proc/sys/vm/(max|min)-readahead
> > available. I've got this idea...
> >
> > If lots of files (some hundered) are read simultaously, I waste all the
> > i/o time in seeks. However, if I increase the readahead, it'll read more
> > data at a time, and end up with seeking a lot less.
> >
> > The harddrive I'm testing this with, is a cheap 20G IDE drive.
>
> /proc/sys/vm/*-readhead is a no-op for IDE.  It doesn't do
> anything.   You must use
>
> 	echo file_readahead:100 > /proc/ide/ide0/hda/settings
>
> to set the readhead to 100 pages (409600 bytes).

Make that kB!
(page sizes is an implementation detail that depends on architecture, 
compilation options...)

(for Andrew:
 it multiplies with 1024 then divides by PAGE_SIZE, result is in pages.
 If you wanted to set no of pages then the scaling should be *1/1...
 earlier it only multiplied with 1024...)

/RogerL

-- 
Roger Larsson
Skellefteå
Sweden

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

* Re: /proc/sys/vm/(max|min)-readahead effect????
  2001-12-05 20:06           ` Roy Sigurd Karlsbakk
@ 2001-12-05 20:53             ` James Stevenson
  2001-12-06 11:45               ` Roy Sigurd Karlsbakk
  2001-12-06 18:44               ` Bernd Eckenfels
  0 siblings, 2 replies; 18+ messages in thread
From: James Stevenson @ 2001-12-05 20:53 UTC (permalink / raw)
  To: Roy Sigurd Karlsbakk; +Cc: Marcelo Tosatti, linux-kernel

> > thats still does not mean they are sequential creating
> > large files almost always causes them to fragment.
>
> ok...
> mkfs /dev/hdb1
> dd if=/dev/zero of=some-file bs=x count=x
>
> What can fragment this file????
 say you wanna write a 500MB file
on a disk with plenty of space.

but when you create the file it happens to
create it in a place that only a 50MB file can
fit because there is another file on the disk in that
position. after 50MB is created then you have to put the rest file
elsewhere thus you now have a fragmented file.

    James







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

* Re: /proc/sys/vm/(max|min)-readahead effect????
  2001-12-05 18:27     ` Roy Sigurd Karlsbakk
@ 2001-12-06 10:09       ` Martin Dalecki
  0 siblings, 0 replies; 18+ messages in thread
From: Martin Dalecki @ 2001-12-06 10:09 UTC (permalink / raw)
  To: Roy Sigurd Karlsbakk; +Cc: Rik van Riel, Marcelo Tosatti, linux-kernel

Roy Sigurd Karlsbakk wrote:
> 
> > I suspect the per-device readahead for IDE is limiting the
> > effect of vm_max_readahead ...
> 
> hm...
> 
> any way to avoid this? I mean... The readahead in vm is layered above the
> actual device, and should therefore not be limited... Am I right? You
> could do several device calls, and fake readahead, and probably get pretty
> much out of it.

He means the hardware device read ahead, which can be changed by using
hdparm -a 32 -A1 /dev/hda
for example.
The value of the read ahead one layer on top of it
(read_ahead array) can't have *any* impact on performance.

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

* Re: /proc/sys/vm/(max|min)-readahead effect????
  2001-12-05 20:13 ` Andrew Morton
  2001-12-05 20:53   ` Roger Larsson
@ 2001-12-06 11:31   ` Roy Sigurd Karlsbakk
  2001-12-06 18:46     ` Bernd Eckenfels
  1 sibling, 1 reply; 18+ messages in thread
From: Roy Sigurd Karlsbakk @ 2001-12-06 11:31 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

Thanks!

It works

On Wed, 5 Dec 2001, Andrew Morton wrote:

> Roy Sigurd Karlsbakk wrote:
> >
> > hi all
> >
> > I've just upgraded to 2.4.16 to get /proc/sys/vm/(max|min)-readahead
> > available. I've got this idea...
> >
> > If lots of files (some hundered) are read simultaously, I waste all the
> > i/o time in seeks. However, if I increase the readahead, it'll read more
> > data at a time, and end up with seeking a lot less.
> >
> > The harddrive I'm testing this with, is a cheap 20G IDE drive.
>
> /proc/sys/vm/*-readhead is a no-op for IDE.  It doesn't do
> anything.   You must use
>
> 	echo file_readahead:100 > /proc/ide/ide0/hda/settings
>
> to set the readhead to 100 pages (409600 bytes).
>
> -
>

--
Roy Sigurd Karlsbakk, MCSE, MCNE, CLS, LCA

Computers are like air conditioners.
They stop working when you open Windows.


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

* Re: /proc/sys/vm/(max|min)-readahead effect????
  2001-12-05 20:53             ` James Stevenson
@ 2001-12-06 11:45               ` Roy Sigurd Karlsbakk
  2001-12-06 18:44               ` Bernd Eckenfels
  1 sibling, 0 replies; 18+ messages in thread
From: Roy Sigurd Karlsbakk @ 2001-12-06 11:45 UTC (permalink / raw)
  To: James Stevenson; +Cc: Marcelo Tosatti, linux-kernel

> > mkfs /dev/hdb1
> > dd if=/dev/zero of=some-file bs=x count=x
> >
> > What can fragment this file????
>  say you wanna write a 500MB file
> on a disk with plenty of space.
>
> but when you create the file it happens to
> create it in a place that only a 50MB file can
> fit because there is another file on the disk in that
> position. after 50MB is created then you have to put the rest file
> elsewhere thus you now have a fragmented file.

er...

take a look above

mkfs /dev/hdb1
(mount /dev/hdb1 /some/dir)
dd if=/dev/zero of=/some/dir/file ...

--
Roy Sigurd Karlsbakk, MCSE, MCNE, CLS, LCA

Computers are like air conditioners.
They stop working when you open Windows.



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

* Re: /proc/sys/vm/(max|min)-readahead effect????
  2001-12-05 20:53             ` James Stevenson
  2001-12-06 11:45               ` Roy Sigurd Karlsbakk
@ 2001-12-06 18:44               ` Bernd Eckenfels
  1 sibling, 0 replies; 18+ messages in thread
From: Bernd Eckenfels @ 2001-12-06 18:44 UTC (permalink / raw)
  To: linux-kernel

In article <008b01c17dce$d96b08d0$0801a8c0@Stev.org> you wrote:
>> mkfs /dev/hdb1
>> dd if=/dev/zero of=some-file bs=x count=x
>> What can fragment this file????

> say you wanna write a 500MB file
...
> fit because there is another file on the disk

it is not, he just reformated the disk


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

* Re: /proc/sys/vm/(max|min)-readahead effect????
  2001-12-06 11:31   ` Roy Sigurd Karlsbakk
@ 2001-12-06 18:46     ` Bernd Eckenfels
  2001-12-07 11:25       ` Roy Sigurd Karlsbakk
  0 siblings, 1 reply; 18+ messages in thread
From: Bernd Eckenfels @ 2001-12-06 18:46 UTC (permalink / raw)
  To: linux-kernel

In article <Pine.LNX.4.30.0112061230480.15030-100000@mustard.heime.net> you wrote:
> It works

what results do you get?

>>       echo file_readahead:100 > /proc/ide/ide0/hda/settings

Greetings
Bernd

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

* Re: /proc/sys/vm/(max|min)-readahead effect????
  2001-12-06 18:46     ` Bernd Eckenfels
@ 2001-12-07 11:25       ` Roy Sigurd Karlsbakk
  0 siblings, 0 replies; 18+ messages in thread
From: Roy Sigurd Karlsbakk @ 2001-12-07 11:25 UTC (permalink / raw)
  To: Bernd Eckenfels; +Cc: linux-kernel

> > It works
>
> what results do you get?
>
> >>       echo file_readahead:100 > /proc/ide/ide0/hda/settings

echo file_readahead:1024 > /proc/ide/ide0/hda/settings

...gave me full throughput to the disk (this disk can do ~25MB/s) while
reading 50 files concurrently :-)

--
Roy Sigurd Karlsbakk, MCSE, MCNE, CLS, LCA

Computers are like air conditioners.
They stop working when you open Windows.


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

end of thread, other threads:[~2001-12-07 11:26 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-12-05 16:21 /proc/sys/vm/(max|min)-readahead effect???? Roy Sigurd Karlsbakk
2001-12-05 16:51 ` Marcelo Tosatti
2001-12-05 18:09   ` Roy Sigurd Karlsbakk
2001-12-05 16:58     ` Marcelo Tosatti
2001-12-05 18:20       ` Roy Sigurd Karlsbakk
2001-12-05 19:43         ` James Stevenson
2001-12-05 20:06           ` Roy Sigurd Karlsbakk
2001-12-05 20:53             ` James Stevenson
2001-12-06 11:45               ` Roy Sigurd Karlsbakk
2001-12-06 18:44               ` Bernd Eckenfels
2001-12-05 18:22   ` Rik van Riel
2001-12-05 18:27     ` Roy Sigurd Karlsbakk
2001-12-06 10:09       ` Martin Dalecki
2001-12-05 20:13 ` Andrew Morton
2001-12-05 20:53   ` Roger Larsson
2001-12-06 11:31   ` Roy Sigurd Karlsbakk
2001-12-06 18:46     ` Bernd Eckenfels
2001-12-07 11:25       ` Roy Sigurd Karlsbakk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox