platform

package
v0.0.0-...-653efa9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 8, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IsDarwin = false
	IsLinux  = true
)
View Source
const (
	// GoHeapAllocationMultiplier defines the float64 overhead of memory allocations
	// in the Golang runtime. This multiplier is > 1 primarily due to the desire to
	// avoid overly fragmenting RAM unless/until the Golang Garbage Collector
	// implements any form of compaction.
	//
	// With experimentation, a GoHeapAllocationMultiplier of 2.0 appears to be just
	// about right for nearly all access paths/patterns. This appears true for all
	// Linux local access (FUSE, SMB loopback, and NFS loopback) as well as SMB access
	// from from a Windows client and NFS access from a Mac. The one outlier is a
	// Mac doing SMB access. In this case, a GoHeapAllocationMultiplier of 4.0 appears
	// to be appropriate.
	//
	// Still, with multiple SMB read streams (Windows 7 & Windows 10) doing RoboCopy's,
	// one test exceeded even that 4.0 value. Hence, the current setting will be very
	// conservative to hopefully avoid all such memory fragmentation concerns at
	// steady state until such time that a more definitive solution is available.
	GoHeapAllocationMultiplier = float64(10.0)
)

Variables

This section is empty.

Functions

func MemSize

func MemSize() (memSize uint64)

func OpenFileSync

func OpenFileSync(name string, flag int, perm os.FileMode) (file *os.File, err error)

OpenFileSync that ensures reads and writes are not cached and also that writes are not reported as complete until the data and metadata are persisted.

Note that buffers must be aligned on the platform's buffer cache boundary in order for the cache bypass mode to function.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL