Closed zamnuts closed 10 years ago
@zamnuts thanks for this.
Could you please update to version 0.5.2 and verify if the issue still exists?
@Reggino 0.5.2 hasnt been published yet FYI
@Reggino the issue has been resolved.
I concur with @contra that 0.5.1 is still the published version on NPM.
I pulled down 0.5.3 (from git) and ran the test again against a ~300mb ISO. The read performance between gridfs-stream
and GridStore
within the driver are comparable:
C:\dev\tmp\gfsbench>node gfsbench.js
starting... grifs-stream version: 0.5.3
driverStream complete to "drv1.iso", total time was 3181498935ns.
gridfsStream complete to "gfs2.iso", total time was 3105269272ns.
driverStream complete to "drv3.iso", total time was 3153099400ns.
gridfsStream complete to "gfs4.iso", total time was 3124445812ns.
driverStream complete to "drv5.iso", total time was 3365673537ns.
gridfsStream complete to "gfs6.iso", total time was 3063945377ns.
done (19002900088ns), drv avg is 3233423957ns, gfs avg is 3097886820ns.
MD5 checksums for validity:
C:\dev\tmp>fciv gfsbench -md5
//
// File Checksum Integrity Verifier version 2.05.
//
65cf8a3b7342eb8493f5cd00eb444ae3 gfsbench\drv1.iso
65cf8a3b7342eb8493f5cd00eb444ae3 gfsbench\drv3.iso
65cf8a3b7342eb8493f5cd00eb444ae3 gfsbench\drv5.iso
65cf8a3b7342eb8493f5cd00eb444ae3 gfsbench\gfs2.iso
65cf8a3b7342eb8493f5cd00eb444ae3 gfsbench\gfs4.iso
65cf8a3b7342eb8493f5cd00eb444ae3 gfsbench\gfs6.iso
Note that I did not regression test, and only tested read performance.
Nice! Thanks
@aheckmann Could you please publish 0.5.3 to npm
0.5.3 is out!
This issue is only about gridfs-stream's
createReadStream
method; I haven't tested writing since there is no equivalent driver method available, and writing is faster in my experience than reading with this module (10mb/s sustained write vs <5mb/s diminishing read), althoughGrid.{put,get}
is still faster on all accounts, but doesn't offer near the flexibility of Node.js's stream API.My findings show that the driver's
GridStore.stream
method is some 40-80 times faster than gridfs-stream'screateReadStream
method. I'm testing this with a ~360mb ISO file that I have stored in a test database. I'm hoping someone could shed some light on this performance issue: gridfs-stream'screateReadStream
is slow.The script I'm using to benchmark performs 6 "downloads" from the database in series, alternating between the driver and gridfs-stream (3 each). I have ran this test repeatedly and found similar results each time. The node application and the mongodb servers are running on the same machine (my localhost); mongodb is actually a small cluster with 1 mongos, 1 config and 3 shards (no replset), although the fs collections for this test are not sharded. I haven't tested this on any serious clusters or environment yet, just locally. Forgive the slop in the following code, I just threw this together right quick.
The output of this script is something like:
And just to be sure, all the md5 checksums look ok:
System/Environment: