On Dec 14, 2009, at 5:02 PM, Mathias Stearn wrote:
> Databases are rather expensive to create and destroy since they
> correspond to actual files on the filesystem.
That makes sense.
> Would it be possible to refactor your tasks to use the same db but
> create and destroy collections rather than databases? You can use
> "dotted" collections to maintain logical separation:
We are using collections in our application, but to ensure that each
test gets a clean environment, we drop the entire database at the end
of each test.
Looking at the logs again, I see these entries:
Mon Dec 14 16:35:27 allocating new datafile data/truth.ns, filling
with zeroes...
Mon Dec 14 16:35:27 done allocating datafile data/truth.ns, size:
16MB, took 0.014 secs
Mon Dec 14 16:35:27 allocating new datafile data/truth.0, filling with
zeroes...
Mon Dec 14 16:35:27 done allocating datafile data/truth.0, size: 64MB,
took 0.061 secs
I'm assuming these are the datafiles, and if that's correct each test
is creating then deleting 80MB worth of data on disk. I'm running on
a laptop (1.5-yo MBP), and disk performance isn't the greatest, so
that could explain the bad performance.
I just found the --nssize and --smallfiles options. Using these
brings the time down into the 1-3 second range, which is tolerable.
It looks like the --smallfiles options brings the initial datafile
size down to 32MB. Is there any way I can make it even smaller?
Thanks,
Kris