Slow write sync performance on Intel S3700

Notice: Page may contain affiliate links for which we may earn a small commission through services like Amazon Affiliates or Skimlinks.

lni

Member
Aug 20, 2017
42
11
8
43
I grabbed an Intel S3700 to use for SLOG kind of workload. I understand that write sync performance (fsync() latency) is the most important factor here. Did a quick pg_test_fsync run and found that fsync() latency is almost 8ms each write sync.

5 seconds per test
O_DIRECT supported on this platform for open_datasync and open_sync.

Compare file sync methods using one 8kB write:
(in wal_sync_method preference order, except fdatasync is Linux's default)
open_datasync 5738.493 ops/sec 174 usecs/op
fdatasync 5719.920 ops/sec 175 usecs/op
fsync 125.104 ops/sec 7993 usecs/op
fsync_writethrough n/a
open_sync 120.013 ops/sec 8332 usecs/op

Compare file sync methods using two 8kB writes:
(in wal_sync_method preference order, except fdatasync is Linux's default)
open_datasync 2864.313 ops/sec 349 usecs/op
fdatasync 4365.294 ops/sec 229 usecs/op
fsync 128.987 ops/sec 7753 usecs/op
fsync_writethrough n/a
open_sync 60.073 ops/sec 16646 usecs/op

This is very different from what I heard previously on this forum, e.g. in the thread below, BackupProphet had 50x better latency on his S3710.

https://forums.servethehome.com/index.php?threads/inexpensive-ssd-for-slog-device.13889/

Any idea what might went wrong? Thanks

I am running on Ubuntu 16.04 with 4.15 kernel, my mount options are

rw,relatime,errors=panic,max_batch_time=0,data=ordered
smartctl -a output attached below

=== START OF INFORMATION SECTION ===
Model Family: Intel 730 and DC S35x0/3610/3700 Series SSDs
Device Model: INTEL SSDSC2BA400G3
Serial Number: BTTV248200S3400HGN
LU WWN Device Id: 5 001517 8f3593b61
Firmware Version: 5DV12270
User Capacity: 400,088,457,216 bytes [400 GB]
Sector Sizes: 512 bytes logical, 4096 bytes physical
Rotation Rate: Solid State Device
Form Factor: 2.5 inches
Device is: In smartctl database [for details use: -P show]
ATA Version is: ACS-2 T13/2015-D revision 3
SATA Version is: SATA 2.6, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is: Fri Jan 25 19:29:12 2019 CST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

General SMART Values:
Offline data collection status: (0x02) Offline data collection activity
was completed without error.
Auto Offline Data Collection: Disabled.
Self-test execution status: ( 0) The previous self-test routine completed
without error or no self-test has ever
been run.
Total time to complete Offline
data collection: ( 2) seconds.
Offline data collection
capabilities: (0x79) SMART execute Offline immediate.
No Auto Offline data collection support.
Suspend Offline collection upon new
command.
Offline surface scan supported.
Self-test supported.
Conveyance Self-test supported.
Selective Self-test supported.
SMART capabilities: (0x0003) Saves SMART data before entering
power-saving mode.
Supports SMART auto save timer.
Error logging capability: (0x01) Error logging supported.
General Purpose Logging supported.
Short self-test routine
recommended polling time: ( 1) minutes.
Extended self-test routine
recommended polling time: ( 2) minutes.
Conveyance self-test routine
recommended polling time: ( 2) minutes.
SCT capabilities: (0x003d) SCT Status supported.
SCT Error Recovery Control supported.
SCT Feature Control supported.
SCT Data Table supported.

SMART Attributes Data Structure revision number: 1
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
5 Reallocated_Sector_Ct 0x0032 100 100 000 Old_age Always - 0
9 Power_On_Hours 0x0032 100 100 000 Old_age Always - 15
12 Power_Cycle_Count 0x0032 100 100 000 Old_age Always - 13
170 Available_Reservd_Space 0x0033 100 100 010 Pre-fail Always - 0
171 Program_Fail_Count 0x0032 100 100 000 Old_age Always - 0
172 Erase_Fail_Count 0x0032 100 100 000 Old_age Always - 0
174 Unsafe_Shutdown_Count 0x0032 100 100 000 Old_age Always - 9
175 Power_Loss_Cap_Test 0x0033 100 100 010 Pre-fail Always - 619 (1 21)
183 SATA_Downshift_Count 0x0032 100 100 000 Old_age Always - 0
184 End-to-End_Error 0x0033 100 100 090 Pre-fail Always - 0
187 Reported_Uncorrect 0x0032 100 100 000 Old_age Always - 0
190 Temperature_Case 0x0022 087 087 000 Old_age Always - 13 (Min/Max 13/15)
192 Unsafe_Shutdown_Count 0x0032 100 100 000 Old_age Always - 9
194 Temperature_Internal 0x0022 100 100 000 Old_age Always - 24
197 Current_Pending_Sector 0x0032 100 100 000 Old_age Always - 0
199 CRC_Error_Count 0x003e 100 100 000 Old_age Always - 0
225 Host_Writes_32MiB 0x0032 100 100 000 Old_age Always - 24348
226 Workld_Media_Wear_Indic 0x0032 100 100 000 Old_age Always - 65535
227 Workld_Host_Reads_Perc 0x0032 100 100 000 Old_age Always - 65535
228 Workload_Minutes 0x0032 100 100 000 Old_age Always - 65535
232 Available_Reservd_Space 0x0033 100 100 010 Pre-fail Always - 0
233 Media_Wearout_Indicator 0x0032 100 100 000 Old_age Always - 0
234 Thermal_Throttle 0x0032 100 100 000 Old_age Always - 0/0
241 Host_Writes_32MiB 0x0032 100 100 000 Old_age Always - 24348
242 Host_Reads_32MiB 0x0032 100 100 000 Old_age Always - 24312

SMART Error Log Version: 1
No Errors Logged

SMART Self-test log structure revision number 1
Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error
# 1 Short offline Completed without error 00% 14 -

SMART Selective self-test log data structure revision number 1
SPAN MIN_LBA MAX_LBA CURRENT_TEST_STATUS
1 0 0 Not_testing
2 0 0 Not_testing
3 0 0 Not_testing
4 0 0 Not_testing
5 0 0 Not_testing
Selective self-test flags (0x0):
After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.
 
Last edited:

BackupProphet

Well-Known Member
Jul 2, 2014
1,083
640
113
Stavanger, Norway
olavgg.com
Could you try without the max_batch_time=0,data=ordered options

The S3700 has similar sync performance to the S3710, though I fast single-threaded cpu also helps.

But in your case, the sync performance is ridiculously low. I could also be a firmware issue.
 

lni

Member
Aug 20, 2017
42
11
8
43
@BackupProphet

Thanks a lot for your reply! I think I've found the issue - it was a bug in Linux Kernel 4.15.

On Ubuntu 16.04 with its 4.4 kernel, everything seems to be fine:

5 seconds per test
O_DIRECT supported on this platform for open_datasync and open_sync.

Compare file sync methods using one 8kB write:
(in wal_sync_method preference order, except fdatasync is Linux's default)
open_datasync 5341.056 ops/sec 187 usecs/op
fdatasync 5296.934 ops/sec 189 usecs/op
fsync 4905.322 ops/sec 204 usecs/op
fsync_writethrough n/a
open_sync 4908.178 ops/sec 204 usecs/op
uname -a output:

Linux xxx 4.4.0-141-generic #167-Ubuntu SMP Wed Dec 5 10:40:15 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
Once on Ubuntu 16.04 with its hwe kernel 4.15, fsync becomes stupidly slow:

5 seconds per test
O_DIRECT supported on this platform for open_datasync and open_sync.

Compare file sync methods using one 8kB write:
(in wal_sync_method preference order, except fdatasync is Linux's default)
open_datasync 5777.430 ops/sec 173 usecs/op
fdatasync 5782.904 ops/sec 173 usecs/op
fsync 128.015 ops/sec 7812 usecs/op
fsync_writethrough n/a
open_sync 121.456 ops/sec 8233 usecs/op

uname -a here:

Linux xxx 4.15.0-43-generic #46~16.04.1-Ubuntu SMP Fri Dec 7 13:31:08 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
This kernel issue has actually been reported, discussed and addressed:
Bug #1785020 “fsync is slow on later kernels with ext4 filesystm...” : Bugs : linux package : Ubuntu

4.15 is not something new to me, I've been running it for ages, but all with NVME disks (Optane and P3700), they seem to be unaffected. Optane 900P results look normal on the 4.15 Kernel -

O_DIRECT supported on this platform for open_datasync and open_sync.

Compare file sync methods using one 8kB write:
(in wal_sync_method preference order, except fdatasync is Linux's default)
open_datasync 34070.118 ops/sec 29 usecs/op
fdatasync 33878.180 ops/sec 30 usecs/op
fsync 32100.555 ops/sec 31 usecs/op
fsync_writethrough n/a
open_sync 32250.768 ops/sec 31 usecs/op
Anyway, this is the whole drama I got tonight, hope it will be useful for other people who might get the same issue.