I'm running MongoDB on my personal computer. I noticed that performance is much slower when the data are on my 2-recent-spinning-hard-drive-software-RAID1 than when they are on an older spinning hard drive without RAID.Old drive, no RAIDSingle operations:> var d = new Date(); db.test.createIndex({ test: 1 } ); print(new Date - d + 'ms');251ms> var d = new Date(); db.test.createIndex({ test: 2dsphere } ); print(new Date - d + 'ms');83ms> var d = new Date(); db.dropDatabase(); print(new Date - d + 'ms');71msWhole test suite: 250sRecent drives, RAID1Single operations:> var d = new Date(); db.test.createIndex({ test: 1 } ); print(new Date - d + 'ms');1220ms> var d = new Date(); db.test.createIndex({ test: 2dsphere } ); print(new Date - d + 'ms');597ms> var d = new Date(); db.dropDatabase(); print(new Date - d + 'ms');671ms> var d = new Date(); db.dropDatabase(); print(new Date - d + 'ms');1msWhole test suite: 700sConfiguration filesIn case it would be useful (I doubt it):/etc/fstabUUID=d719f337-d835-4688-baf2-3e29f147ff15 /               ext4    errors=remount-ro 0       1# /home was on /dev/md0p3 during installationUUID=def01643-c71e-47df-9dc8-67096243aee6 /home           ext4    defaults        0       2# swap was on /dev/md0p1 during installationUUID=d43319a8-92fb-437d-b576-ef964276cde none            swap    sw              0       0/dev/sr0        /media/cdrom0   udf,iso9660 user,noauto     0       0 UUID=dd8b1f05-c65b-42e1-a45e-0ef421faf1df /mnt/bak ext4 defaults,errors=remount-ro 0 1/etc/mdadm/mdadm.conf# auto-create devices with Debian standard permissionsCREATE owner=root group=disk mode=0660 auto=yes# automatically tag new arrays as belonging to the local systemHOMEHOST <system># instruct the monitoring daemon where to send mail alertsMAILADDR root# definitions of existing MD arraysARRAY /dev/md/0  metadata=1.2 UUID=3a0f91ae:51c48198:3d1e26ed:118a1938 name=bouzin:0# This configuration was auto-generated on Sun, 24 Jan 2016 18:00:55 +0100 by mkconfQuestionFrom what I've read, write access on the RAID1 should be roughly equal to the write access on a single equivalent drive.Could this 5400/7200 factor explain the order of magnitude of difference in the tests above?Could it be better without the RAID?Any interesting test/benchmark I could run? For now, I only have Mongo shell tests, but they seem to point to the RAID, or the drives, rather than to Mongo itself. Is there some application-agnostic test I could run to identify anything?Could anything be wrong or suboptimal with the RAID configuration?EDIT:Important is, that I mixed 7200 rpm and 5400 rpm drives.
Write access time slow on RAID1
performance;software raid;raid1