in reply to Re: Advice needed on an interesting read-ahead over network file IO problem
in thread Advice needed on an interesting read-ahead over network file IO problem

Mmh. Don't know what I make of this. Actually my script does not use a read(), it does more like a sysread, as the function to read() is abstracted more like this pseudo code $data = $lwp->get->content( offset=> xyz, length => abc);

The server side does a sysread().
  • Comment on Re^2: Advice needed on an interesting read-ahead over network file IO problem

Replies are listed 'Best First'.
Re^3: Advice needed on an interesting read-ahead over network file IO problem
by ikegami (Patriarch) on Mar 16, 2010 at 20:07 UTC
    I can't comment on an abstraction I haven't seen, but LWP uses sysread for http urls.
Re^3: Advice needed on an interesting read-ahead over network file IO problem
by salva (Canon) on Mar 17, 2010 at 09:31 UTC
    If your communication runs on top of HTTP, ensure that you are not creating a new TCP connection for every request but using a persistent one.

    Regarding read ahead, the usual practice is to set a minimum chunk size, say 64k. Any read below this size reads 64k, returns the required length and caches the remainder data for future requests.

    The optimal minimum chunk size to use depends on the network characteristics (bandwidth and latency). Just experiment to find it out!