On Wed, Aug 10, 2011 at 12:40 PM, Sreekumar TP <sreekumar...@gmail.com>wrote:

> The 179148 failures on 'access' system call is due to access check of  two
> files - the journal file and the wal-file.
> The journal mode was OFF as also WAL mode.
> Why is sqlite checking access permissions for this file 179140 times?
> Removing or optimising this will make it faster by 20% atleast!
>


SQLite must check for the existence of hot journals that were left behind by
other processes that were writing to the database but crashed before they
finished.  If SQLite did not check for these, and if other processes did
crash in the middle of a transaction, the database file would go corrupt.

If your process is the only one accessing the database file, you can disable
the journal-checks by doing:

     PRAGMA locking_mode=EXCLUSIVE;




>
>
> access("/dev/shm/test.db-journal", F_OK) = -1 ENOENT (No such file or
> directory)
>
> access("/dev/shm/test.db-wal", F_OK)   = -1 ENOENT (No such file or
> directory)
>
> -Sreekumar
> On Wed, Aug 10, 2011 at 5:28 PM, Sreekumar TP <sreekumar...@gmail.com
> >wrote:
>
> > Hi,
> >
> > I have the results from the tests (below).  Alot of the time is spent in
> > checking file permissions and locking the file (40 %).
> >
> >
> > Inmem
> >
> > % time     seconds  usecs/call     calls    errors syscall
> >
> > ------ ----------- ----------- --------- --------- ----------------
> >
> >  28.53    0.124727           1    118524           write
> >
> >  23.42    0.102382           0    414624           gettimeofday
> >
> >  20.78    0.090840           1     76513           read
> >
> >  13.72    0.059977           0    191255           _llseek
> >
> >
> >
> > Db in tmpfs
> >
> > % time     seconds  usecs/call     calls    errors syscall
> >
> > ------ ----------- ----------- --------- --------- ----------------
> >
> >  21.83    0.257073           1    263306           write
> >
> >  21.18    0.249488           1    179148    179148 access
> >
> >  20.61    0.242725           0    509292           fcntl64
> >
> >  13.04    0.153551           0    448720           _llseek
> >
> >   9.44    0.111194           1    189370           read
> >
> >   8.16    0.096124           0    414624           gettimeofday
> >   2.55    0.030000        3750         8           fdatasync
> >
> >   On Tue, Aug 9, 2011 at 7:34 PM, Pavel Ivanov <paiva...@gmail.com>
> wrote:
> >
> >> > Journal mode is WAL
> >>
> >> I believe in-memory database can't have journal mode WAL. So you
> >> compare completely different settings.
> >>
> >>
> >> Pavel
> >>
> >>
> >> On Tue, Aug 9, 2011 at 5:15 AM,  <sreekumar...@gmail.com> wrote:
> >> >
> >> > Journal mode is WAL
> >> >
> >> >
> >> > ------Original Message------
> >> > From: Roger Binns
> >> > Sender: sqlite-users-boun...@sqlite.org
> >> > To: General Discussion of SQLite Database
> >> > ReplyTo: General Discussion of SQLite Database
> >> > Subject: Re: [sqlite] In memory v/s tmpfs
> >> > Sent: Aug 9, 2011 2:42 PM
> >> >
> >> > -----BEGIN PGP SIGNED MESSAGE-----
> >> > Hash: SHA1
> >> >
> >> > On 08/08/2011 06:34 PM, sreekumar...@gmail.com wrote:
> >> >> From the point of view of performance, I expected similar performance
> ,
> >> tmpfs being a little slower due to filesystem overhead. However, the
> >> operations on tmpfs was much slower than expected.
> >> >
> >> > Using tmpfs requires many kernel calls which is considerably more
> effort
> >> > than the occasional malloc call.  Additionally files have to be
> locked,
> >> > journals made etc (you didn't mention your journal setting).
> >> >
> >> > Roger
> >> > -----BEGIN PGP SIGNATURE-----
> >> > Version: GnuPG v1.4.11 (GNU/Linux)
> >> > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
> >> >
> >> > iEYEARECAAYFAk5A+g0ACgkQmOOfHg372QTR8ACgqNeeuOxHRy7+hMH5RY/OAyV2
> >> > Wq0AoMaSRtoFN4obCgmgHlpHthd9z5Zp
> >> > =pkJt
> >> > -----END PGP SIGNATURE-----
> >> > _______________________________________________
> >> > sqlite-users mailing list
> >> > sqlite-users@sqlite.org
> >> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> >> >
> >> >
> >> > Sent from BlackBerry® on Airtel
> >> > _______________________________________________
> >> > sqlite-users mailing list
> >> > sqlite-users@sqlite.org
> >> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> >> >
> >>
> >
> >
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
D. Richard Hipp
d...@sqlite.org
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to