public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Is sendfile all that sexy?
@ 2001-01-14 18:29 jamal
  2001-01-14 18:50 ` Ingo Molnar
                   ` (2 more replies)
  0 siblings, 3 replies; 130+ messages in thread
From: jamal @ 2001-01-14 18:29 UTC (permalink / raw)
  To: linux-kernel, netdev



I thought i'd run some tests on the new zerocopy patches
(this is using a hacked ttcp which knows how to do sendfile
and does MSG_TRUNC for true zero-copy receive, if you know what i mean
;-> ).

2 back to back SMP 2*PII-450Mhz hooked up via 1M acenics (gigE).
MTU 9K.

Before getting excited i had the courage to give plain 2.4.0-pre3 a whirl
and somethings bothered me.

test1:
------

regular ttcp, no ZC and no sendfile. send as much as you can in 15secs;
actually 8192 byte chunks, 2048 of them at a time. Repeat until 15 secs is
complete.

Repeat the test 5 times to narrow experimental deviation.

Throughput: ~99MB/sec (for those obsessed with Mbps ~810Mbps)
CPU abuse: server side 87% client side 22% (the CPU measurement could do
with some work and proper measure for SMP).

test2:
------

sendfile server.
created a file which is 8192*2048 bytes. Again the same 15 second
exercise as test1 (and the 5-set thing):

- throughput: 86MB/sec
- CPU: server 100%, client 17%

So i figured, no problem i'll re-run it with a file 10 times larger.
**I was dissapointed to see no improvement.**

Looking at the system calls being made:

with the non-sendfile version, approximately 182K write-to-socket system
calls were made each writing 8192 bytes, Each call lasted on average
0.08ms.
With sendfile test2: 78 calls were made, each sending the file
size 8192*2048 bytes; each lasted about 199 msecs

TWO observations:
- Given Linux's non-pre-emptability of the kernel i get the feeling that
sendfile could starve other user space programs. Imagine trying to send a
1Gig file on 10Mbps pipe in one shot.
- It doesnt matter if you break down the file into chunks for
self-pre-emption; sendfile is still a pig.

I have a feeling i am missing some very serious shit. So enlighten me.
Has anyone done similar tests?

Anyways, the struggle continues next with zc patches.

cheers,
jamal

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 130+ messages in thread
* Re: Is sendfile all that sexy?
@ 2001-01-16 13:50 Andries.Brouwer
  2001-01-17  6:56 ` Ton Hospel
  0 siblings, 1 reply; 130+ messages in thread
From: Andries.Brouwer @ 2001-01-16 13:50 UTC (permalink / raw)
  To: mingo; +Cc: linux-kernel

    From: Ingo Molnar <mingo@elte.hu>

    On Tue, 16 Jan 2001, Felix von Leitner wrote:

    > I don't know how Linux does it, but returning the first free file
    > descriptor can be implemented as O(1) operation.

    to put it more accurately: the requirement is to be able to open(), use
    and close() an unlimited number of file descriptors with O(1) overhead,
    under any allocation pattern, with only RAM limiting the number of files.
    Both of my proposals attempt to provide this. It's possible to open() O(1)
    but do a O(log(N)) close(), but that is of no practical value IMO.

        Ingo

> Both of my proposals

I am afraid I have missed most earlier messages in this thread.
However, let me remark that the problem of assigning a
file descriptor is the one that is usually described by
"priority queue". The version of Peter van Emde Boas takes
time O(loglog N) for both open() and close().
Of course this is not meant to suggest that we use it.

Andries
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 130+ messages in thread
* Re: Is sendfile all that sexy?
@ 2001-01-17 15:02 Ben Mansell
  2000-01-01  2:10 ` Pavel Machek
  2001-01-17 19:32 ` Linus Torvalds
  0 siblings, 2 replies; 130+ messages in thread
From: Ben Mansell @ 2001-01-17 15:02 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel

On 14 Jan 2001, Linus Torvalds wrote:

> And no, I don't actually hink that sendfile() is all that hot. It was
> _very_ easy to implement, and can be considered a 5-minute hack to give
> a feature that fit very well in the MM architecture, and that the Apache
> folks had already been using on other architectures.

The current sendfile() has the limitation that it can't read data from
a socket. Would it be another 5-minute hack to remove this limitation, so
you could sendfile between sockets? Now _that_ would be sexy :)


Ben

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 130+ messages in thread
[parent not found: <Pine.LNX.4.10.10101190911130.10218-100000@penguin.transmeta.com>]
* Re: Is sendfile all that sexy?
@ 2001-01-24 15:12 Sasi Peter
  2001-01-24 15:29 ` James Sutherland
  2001-01-25  1:11 ` Alan Cox
  0 siblings, 2 replies; 130+ messages in thread
From: Sasi Peter @ 2001-01-24 15:12 UTC (permalink / raw)
  To: James Sutherland, linux-kernel

> AIUI, Jeff Merkey was working on loading "userspace" apps into the 
kernel
> to tackle this sort of problem generically. I don't know if he's 
tried it
> with Samba - the forking would probably be a problem...

I think, that is not what we need. Once Ingo wrote, that since HTTP 
serving can also be viewed as a kind of fileserving, it should be 
possible to create a TUX like module for the same framwork, that serves 
using the SMB protocol instead of HTTP...

-- SaPE / Sasi Péter / mailto: sape@sch.hu / http://sape.iq.rulez.org/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

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

end of thread, other threads:[~2001-01-26 14:16 UTC | newest]

Thread overview: 130+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-01-14 18:29 Is sendfile all that sexy? jamal
2001-01-14 18:50 ` Ingo Molnar
2001-01-14 19:02   ` jamal
2001-01-14 19:09     ` Ingo Molnar
2001-01-14 19:18       ` jamal
2001-01-14 20:22 ` Linus Torvalds
2001-01-14 20:38   ` Ingo Molnar
2001-01-14 21:44     ` Linus Torvalds
2001-01-14 21:49       ` Ingo Molnar
2001-01-14 21:54     ` Gerhard Mack
2001-01-14 22:40       ` Linus Torvalds
2001-01-14 22:45         ` J Sloan
2001-01-15 20:15           ` H. Peter Anvin
2001-01-15  3:43         ` Michael Peddemors
2001-01-15 13:02       ` Florian Weimer
2001-01-15 13:45         ` Tristan Greaves
2001-01-15  1:14   ` Dan Hollis
2001-01-15 15:24   ` Jonathan Thackray
2001-01-15 15:36     ` Matti Aarnio
2001-01-15 20:17       ` H. Peter Anvin
2001-01-15 16:05     ` dean gaudet
2001-01-15 18:34       ` Jonathan Thackray
2001-01-15 18:46         ` Linus Torvalds
2001-01-15 20:47           ` [patch] sendpath() support, 2.4.0-test3/-ac9 Ingo Molnar
2001-01-16  4:51             ` dean gaudet
2001-01-16  4:59               ` Linus Torvalds
2001-01-16  9:48                 ` 'native files', 'object fingerprints' [was: sendpath()] Ingo Molnar
2000-01-01  2:02                   ` Pavel Machek
2001-01-16 11:13                   ` Andi Kleen
2001-01-16 11:26                     ` Ingo Molnar
2001-01-16 11:37                       ` Andi Kleen
2001-01-16 12:04                         ` O_ANY [was: Re: 'native files', 'object fingerprints' [was: sendpath()]] Ingo Molnar
2001-01-16 12:09                           ` Ingo Molnar
2001-01-16 12:13                           ` Peter Samuelson
2001-01-16 12:33                             ` Ingo Molnar
2001-01-16 14:40                               ` Felix von Leitner
2001-01-16 12:34                           ` Andi Kleen
2001-01-16 13:00                           ` Mitchell Blank Jr
2001-01-16 13:57                   ` 'native files', 'object fingerprints' [was: sendpath()] Jamie Lokier
2001-01-16 14:27                   ` Felix von Leitner
2001-01-16 17:47                   ` Linus Torvalds
2001-01-17  4:39                   ` dean gaudet
2001-01-16  9:19               ` [patch] sendpath() support, 2.4.0-test3/-ac9 Ingo Molnar
2001-01-17  0:03                 ` dean gaudet
2001-01-15 18:58         ` Is sendfile all that sexy? dean gaudet
2001-01-15 19:41     ` Ingo Molnar
2001-01-15 20:33       ` Albert D. Cahalan
2001-01-15 21:00         ` Linus Torvalds
2001-01-16 10:40         ` Felix von Leitner
2001-01-16 11:56           ` Peter Samuelson
2001-01-16 12:37           ` Ingo Molnar
2001-01-16 12:42           ` Ingo Molnar
2001-01-16 12:47             ` Felix von Leitner
2001-01-16 13:48               ` Jamie Lokier
2001-01-16 14:20                 ` Felix von Leitner
2001-01-16 15:05                   ` David L. Parsley
2001-01-16 15:05                     ` Jakub Jelinek
2001-01-16 15:46                       ` David L. Parsley
2001-01-18 14:00                         ` Laramie Leavitt
2001-01-17 19:27                     ` dean gaudet
2001-01-24  0:58   ` Sasi Peter
2001-01-24  8:44     ` James Sutherland
2001-01-25 10:20     ` Anton Blanchard
2001-01-25 10:58       ` Sasi Peter
2001-01-26  6:10         ` Anton Blanchard
2001-01-26 11:46           ` David S. Miller
2001-01-26 14:12             ` Anton Blanchard
2001-01-15 23:16 ` Pavel Machek
2001-01-16 13:47   ` jamal
2001-01-16 14:41     ` Pavel Machek
  -- strict thread matches above, loose matches on Subject: below --
2001-01-16 13:50 Andries.Brouwer
2001-01-17  6:56 ` Ton Hospel
2001-01-17  7:31   ` Steve VanDevender
2001-01-17  8:09     ` Ton Hospel
2001-01-17 15:02 Ben Mansell
2000-01-01  2:10 ` Pavel Machek
2001-01-17 19:32 ` Linus Torvalds
2001-01-18  2:34   ` Olivier Galibert
2001-01-21 21:22     ` LA Walsh
2001-01-18  8:23   ` Rogier Wolff
2001-01-18 10:01     ` Andreas Dilger
2001-01-18 11:04       ` Russell Leighton
2001-01-18 16:36         ` Larry McVoy
2001-01-19  1:53         ` Linus Torvalds
2001-01-18 16:24       ` Linus Torvalds
2001-01-18 18:46         ` Kai Henningsen
2001-01-18 18:58         ` Roman Zippel
2001-01-18 19:42           ` Linus Torvalds
2001-01-19  0:18             ` Roman Zippel
2001-01-19  1:14               ` Linus Torvalds
2001-01-19  6:57                 ` Alan Cox
2001-01-19 10:13                 ` Roman Zippel
2001-01-19 10:55                   ` Andre Hedrick
2001-01-19 20:18                   ` kuznet
2001-01-19 21:45                     ` Linus Torvalds
2001-01-20 18:53                       ` kuznet
2001-01-20 19:26                         ` Linus Torvalds
2001-01-20 21:20                           ` Roman Zippel
2001-01-21  0:25                             ` Linus Torvalds
2001-01-21  2:03                               ` Roman Zippel
2001-01-21 18:00                               ` kuznet
2001-01-21 23:21                           ` David Woodhouse
2001-01-20 15:36             ` Kai Henningsen
2001-01-20 21:01               ` Linus Torvalds
2001-01-20 21:10                 ` Mo McKinlay
2001-01-20 22:24                 ` Roman Zippel
2001-01-21  0:33                   ` Linus Torvalds
2001-01-21  1:29                     ` David Schwartz
2001-01-21  2:42                     ` Roman Zippel
2001-01-21  9:52                     ` James Sutherland
2001-01-21 10:02                       ` Ingo Molnar
2001-01-22  9:52                       ` Helge Hafting
2001-01-22 13:00                         ` James Sutherland
2001-01-23  9:01                           ` Helge Hafting
2001-01-23  9:37                             ` James Sutherland
2001-01-18 19:51           ` Rick Jones
2001-01-18 12:17     ` Peter Samuelson
2001-01-22 18:13   ` Val Henson
2001-01-22 18:27     ` David Lang
2001-01-22 19:37       ` Val Henson
2001-01-22 20:01         ` David Lang
2001-01-22 22:04           ` Ion Badulescu
2001-01-22 18:54     ` Linus Torvalds
     [not found] <Pine.LNX.4.10.10101190911130.10218-100000@penguin.transmeta.com>
2001-01-19 17:23 ` Rogier Wolff
2001-01-24 15:12 Sasi Peter
2001-01-24 15:29 ` James Sutherland
2001-01-25  1:11 ` Alan Cox
2001-01-25  9:06   ` James Sutherland
2001-01-25 10:42     ` bert hubert
2001-01-25 12:14       ` James Sutherland

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