On Tue, May 13, 2008 at 11:15:51PM -0600, Peter K. Stys wrote:
> Hi Folks:
> I'm new to this list and just came across a major issue so I thought I'd
> post here: I'm using SQLite (from REALbasic which uses the SQLite DB engine
> for SQL support) to store image files, and while R/W to local files is
> excellent, the same operations on files residing on a remote volume mounted
> via afp or smb (all Mac OS X) suffer a 20-fold performance hit.
> 
> Why is this, and is there a workaround?
> 
> To be clear, while the remote files are on a server, this is still single
> user access to a single file at a time, just remotely.
> 
> Any input greatly appreciated!


A local disk is on a >1Gb/s connection, probably at the end of a wire <0.5m
long. The remote volume will have that, but also a <1Gb/s connection, on top
of a >10m length of cabling to implement the network.

Laws of physics, such as the speed of light, limit the turn-around of
synchronous writes across a network. Your hard disk has probably an order
of magnitude quicker synchronous write than your network share.

Try playing with synchronous writes turned off. The reduced synchronous
requirements may allow you to make more optimum use of the network file
protocols, which operate best asynchronously.

Try, in order:
PRAGMA synchronous = NORMAL;
PRAGMA synchronous = OFF;

And measure performance of each. But SQLite is simply not designed to work
efficiently across a network based file system, so manage your expectations.

> 
> Peter.
> 

Christian
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to