I have a brand new laptop (Asus N551VW, i7-6700HQ, 16 Gb ram) on which i installed Ubuntu 14.04 64bit and a new Samsung SSD 850 PRO 512Gb (latest firmware). I installed the default MySql 5.6.27 on the machine but I noticed a very VERY slow performance of the database (just creating a db and executing some migrations without any data takes around 33 seconds while on lower-hardware co-workers notebooks it takes like 3 seconds). Every sql statement seems to spend most time in "system lock" state, as i could see with a SHOW PROCESSLIST.

I thought it to be an hard drive issue, but executing the hard drive benchmark in Ubuntu gives 500 Mb/s read and 350 Mb/s write speed, which looks mostly normal.

I also tried updating to the new 4.2 kernel, but the issue still there. To make an experiment, i cloned the ssd on a normal hard drive, switched it in and connected the SSD externally with an usb box. I moved mysql data directory to the external disk, and retried the db creation: it took only 2.5 seconds!

Just out of curiosity i tried the same operation on an internal non-ssd disk: when the hd is plugged inside the laptop with sata, the database creation takes more than 2 minutes, while with the data dir on external usb (with the same physical disk) it took less than 10 seconds!

I'm really clueless on this. The tests were done all in the same conditions (machine at 0 load, ext4 filesystem etc). Seems like there's some problem on the I/O chain (SATA controller?) but i have no idea on how to test this.

This is the lshw info about disk and controller:

         description: SATA controller
         product: Intel Corporation
         vendor: Intel Corporation
         physical id: 17
         bus info: pci@0000:00:17.0
         version: 31
         width: 32 bits
         clock: 66MHz
         capabilities: storage msi pm ahci_1.0 bus_master cap_list
         configuration: driver=ahci latency=0
         resources: irq:127 memory:df330000-df331fff memory:df334000-df3340ff ioport:f090(size=8) ioport:f080(size=4) ioport:f060(size=32) memory:df333000-df3337ff
      physical id: 1
      logical name: scsi0
      capabilities: emulated
         description: ATA Disk
         product: Samsung SSD 850
         physical id: 0.0.0
         bus info: scsi@0:0.0.0
         logical name: /dev/sda
         version: 2B6Q
         serial: S250NXAGB34907Y
         size: 476GiB (512GB)
         capabilities: gpt-1.00 partitioned partitioned:gpt
         configuration: ansiversion=5 guid=02c7beb5-f100-4252-8534-a8f6f692692d sectorsize=512
            description: EXT4 volume
            vendor: Linux
            physical id: 5
            bus info: scsi@0:0.0.0,5
            logical name: /dev/sda5
            logical name: /
            logical name: /var/lib/docker/aufs
            version: 1.0
            serial: 5231fd09-180d-4fd2-bad5-e989207b11e7
            size: 88GiB
            capabilities: journaled extended_attributes large_files huge_files dir_nlink recover extents ext4 ext2 initialized
            configuration: created=2016-01-06 12:55:27 filesystem=ext4 lastmountpoint=/ modified=2016-01-24 23:37:05 mount.fstype=ext4 mount.options=rw,noatime,errors=remount-ro,data=ordered mounted=2016-01-24 23:37:05 state=mounted


00:00.0 Host bridge: Intel Corporation Device 1910 (rev 07)
00:01.0 PCI bridge: Intel Corporation Device 1901 (rev 07)
00:02.0 VGA compatible controller: Intel Corporation Device 191b (rev 06)
00:04.0 Signal processing controller: Intel Corporation Device 1903 (rev 07)
00:14.0 USB controller: Intel Corporation Device a12f (rev 31)
00:14.2 Signal processing controller: Intel Corporation Device a131 (rev 31)
00:15.0 Signal processing controller: Intel Corporation Device a160 (rev 31)
00:15.1 Signal processing controller: Intel Corporation Device a161 (rev 31)
00:16.0 Communication controller: Intel Corporation Device a13a (rev 31)
00:17.0 SATA controller: Intel Corporation Device a103 (rev 31)
00:1c.0 PCI bridge: Intel Corporation Device a112 (rev f1)
00:1c.3 PCI bridge: Intel Corporation Device a113 (rev f1)
00:1f.0 ISA bridge: Intel Corporation Device a14e (rev 31)
00:1f.2 Memory controller: Intel Corporation Device a121 (rev 31)
00:1f.3 Audio device: Intel Corporation Device a170 (rev 31)
00:1f.4 SMBus: Intel Corporation Device a123 (rev 31)
01:00.0 3D controller: NVIDIA Corporation Device 139b (rev a2)
02:00.0 Network controller: Intel Corporation Wireless 7265 (rev 59)
03:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. Device 5287 (rev 01)
03:00.1 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 12)

I also tried different schedulers (deadline, noop) with no results :(
I'd be very grateful if someone could help!
Thanks in advance!

  • I'm voting to close this question as off-topic because it smells like a bug in the device firmware or the file system driver. Please file a bug report against the Linux kernel package on Launchpad (after confirming the bug on the latest kernel provided for your Ubuntu release by Canonical). – David Foerster Jan 25 '16 at 23:47

After searching like a thousand forums and stuff, i tried the barrier=0 option to the root ext4 filesystem.
Result: from 33 seconds to 1.5 for the usual scripts.

I have no idea how such an option can change things so dramaticaly. I don't know if this is the proper solution to the issue I had, but at least now the laptop is not a very expensive paperweight. If anyone has another solution in mind which doesn't involve using a someway risky option like barrier=0 i'd be really glad!

  • barrier=0 has potentially dangerous consequences, if your computer loses power. It may corrupt the file system irrecoverably. This is another hint, that this is a bug between the device firmware and the file system driver. – David Foerster Jan 25 '16 at 23:46
  • I know about the consequences, still this is the only solution i could apply to have a usable laptop. I'll open a bug as you suggest, thanks. – Valerio Jan 26 '16 at 8:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.