Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: BLOB slow writing, fast reading??

Re: BLOB slow writing, fast reading??

From: Roger Liu <rliu2_at_ford.com>
Date: Fri, 29 Oct 1999 13:46:03 -0400
Message-ID: <3819DD5B.2C6A210F@ford.com>


I use Perl DBI/DBD::Oracle:

Env:

Database: Sun 2.6, 8i, 2-300 CPUs and 1G Ram WebServer: Sun 2.6 Netscape 3.0, 2-300 CPUs, 512M Ram, Net8 (8.04) Client: Netscape Browser 4.7, NT4.0/sp5, P-II 350 and 320M Ram

Insert: 34.5M file (sp5i386.exe): 41 ~ 43 Seconds (from Web Server to Database)
Retrieve the file: 6 Seconds!

Roger Liu

Gordon Twaddell wrote:

> The code looks good. I like to use buffers on 1024 byte boundaries(e.g.
> 8192).
> I'd recheck your Oracle configuration. We've got a good DBA and BLOB
> performance
> is important to us. Here's the kind of numbers I'm seeing with 8i, NT, and
> the Oracle 8.1.6
> OCI8 JDBC drivers on 100 Mb LAN & code that looks alot like yours:
>
> Reading 90KB < 1 sec. (almost instantanous)
> Writing 90KB ~ 2.5 sec.
>
> Previous tests using 8.1.5 drivers:
>
> Reading 10MB, 11.5 sec. (sorry no writing benchmarks)
>
> My point is that I doubt its your code. Try optimizing your Oracle for
> better BLOB performance.
> Does your DB server have enough memory / swap ? My DB server is a PII 233
> w/256 MB.
>
> Frederik Hansen <roirex_at_post1.tele.dk> wrote in message
> news:38194464.391EDB3E_at_post1.tele.dk...
> > Hi
> >
> > Can anyone tell me why it takes about 20 minutes til write 0.5MB to a
> > BLOB field, where reading from a BLOB field with 0.5MB only takes 20
> > seconds???
> >
> > This is my writing code (using Java2, and classes12.zip)
> >
> > oracle.sql.BLOB blob =
> > ((oracle.jdbc.driver.OracleResultSet)resl).getBLOB(1);
> > OutputStream out = blob.getBinaryOutputStream();
> > ByteArrayInputStream in = new ByteArrayInputStream(designFile.file);
> > byte[] file = new byte[8000];
> >
> > int read = 0;
> > while ( (read = in.read(file, 0, file.length)) != -1 )
> > out.write(file, 0, read);
> > out.close();
> >
> >
> >
> > And this is my read code :
> >
> >
> > oracle.sql.BLOB blob =
> > ((oracle.jdbc.driver.OracleResultSet)resl).getBLOB(1);
> >
> > BufferedInputStream in = new
> > BufferedInputStream(blob.getBinaryStream());
> > ByteArrayOutputStream out = new ByteArrayOutputStream();
> >
> > byte[] file = new byte[8000];
> >
> > int read = 0;
> > while ((read = in.read(file, 0, file.length)) > 0)
> > out.write(file, 0, read);
> > in.close();
> >
> >
> > --
> > Venlig hilsen
> > Frederik
Received on Fri Oct 29 1999 - 12:46:03 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US