Subject | Re: [Firebird-Java] Blobs and Streams |
---|---|
Author | Roman Rokytskyy |
Post date | 2005-04-08T15:57:42Z |
> What is different in auto-commit mode?Complete result set including blob content is cached in the memory.
> Memory is a problem here, since not all images are for the web siteIf you want to load them into memory - use either byte[] or auto-commit
> itself; some contain landscape images which have several megabyte...
mode. If you want to pipe them directly - use InputStream.
> This should not be a problem either using a connection pool with a highYou have to check how your system behaves.
> maximum number of connections?
> I am not planing on synchronizing, because every thread has it's ownFirebird has no record locking anyway, but multiple connections will compete
> Connection and since none of them writes to the database, no locking
> should occur. (Here my question about autocommit, which I think the pooled
> connections are by default...)
for database anyway.
>> So you have to create tests anyway (my tests show meThat's what one of the JUnit tests in JayBird tell me - 6 MByte/s = 48
>> something ~48 Mbit/s for reas and ~32 Mbit/s for writes on
>> Pentium M 1,6 MHz laptop, Windows XP, locally running FB 1.5 SS).
>
> Are you sure about MBit or did you mean MByte? 48 MBit read spead seems
> less than I expected, exspecially since the harddrives here on my dev
> system do about 60 mbyte / sec and the productive system is striped... I
> assume the FileImputStream will have way better troughput...
Mbit/s. Write your own test and check it.
> Anyway, my concerns are not about throughput. My concers are aboutTrue.
> latency. I assume settings up a FileInputStream is way faster than
> getting an InputStream from a database query.
> This is my biggest concern. I think the throuput (of several threads)Your web server limits the number of threads in the system, not the nic
> will be limited by the nic card, but latency is always problem.
card. Feeding data from the database is always slower than file system
(remember, database itself is stored in the file system). When we developed
a site designed for really heavy load we have generated static image of it
on each change in the CMS and replicated it to multiple web servers that
were behind the load balancer, only the database-related stuff was
dynamically generated. Images were stored on the FS in all cases (we had no
dynamic image generation).
What you can think of is the temp cache on the file system. You application
would check first if image is on the file system, if not pump it from DB,
and save to the FS in parallel.
Roman