diff --git a/README.md b/README.md index be637340a..7ef2a72b8 100644 --- a/README.md +++ b/README.md @@ -301,58 +301,55 @@ POSIX support ## Benchmark -My Own Unscientific Single Machine Results on Mac Book with Solid State Disk, CPU: 1 Intel Core i7 2.2GHz. +My Own Unscientific Single Machine Results on Mac Book with Solid State Disk, CPU: 1 Intel Core i7 2.6GHz. Write 1 million 1KB file: ``` -Concurrency Level: 64 -Time taken for tests: 182.456 seconds +Concurrency Level: 16 +Time taken for tests: 88.796 seconds Complete requests: 1048576 Failed requests: 0 -Total transferred: 1073741824 bytes -Requests per second: 5747.01 [#/sec] -Transfer rate: 5747.01 [Kbytes/sec] +Total transferred: 1106764659 bytes +Requests per second: 11808.87 [#/sec] +Transfer rate: 12172.05 [Kbytes/sec] Connection Times (ms) min avg max std -Total: 0.3 10.9 430.9 5.7 +Total: 0.2 1.3 44.8 0.9 Percentage of the requests served within a certain time (ms) - 50% 10.2 ms - 66% 12.0 ms - 75% 12.6 ms - 80% 12.9 ms - 90% 14.0 ms - 95% 14.9 ms - 98% 16.2 ms - 99% 17.3 ms - 100% 430.9 ms + 50% 1.1 ms + 66% 1.3 ms + 75% 1.5 ms + 80% 1.7 ms + 90% 2.1 ms + 95% 2.6 ms + 98% 3.7 ms + 99% 4.6 ms + 100% 44.8 ms ``` Randomly read 1 million files: ``` -Concurrency Level: 64 -Time taken for tests: 80.732 seconds +Concurrency Level: 16 +Time taken for tests: 34.263 seconds Complete requests: 1048576 Failed requests: 0 -Total transferred: 1073741824 bytes -Requests per second: 12988.37 [#/sec] -Transfer rate: 12988.37 [Kbytes/sec] +Total transferred: 1106762945 bytes +Requests per second: 30603.34 [#/sec] +Transfer rate: 31544.49 [Kbytes/sec] Connection Times (ms) min avg max std -Total: 0.0 4.7 254.3 6.3 +Total: 0.0 0.5 20.7 0.7 Percentage of the requests served within a certain time (ms) - 50% 2.6 ms - 66% 2.9 ms - 75% 3.7 ms - 80% 4.7 ms - 90% 10.3 ms - 95% 16.6 ms - 98% 26.3 ms - 99% 34.8 ms - 100% 254.3 ms + 50% 0.4 ms + 75% 0.5 ms + 95% 0.6 ms + 98% 0.8 ms + 99% 1.2 ms + 100% 20.7 ms ``` diff --git a/go/storage/needle_read_write.go b/go/storage/needle_read_write.go index 9a9f63ddb..eb2d8d459 100644 --- a/go/storage/needle_read_write.go +++ b/go/storage/needle_read_write.go @@ -120,7 +120,7 @@ func (n *Needle) Append(w io.Writer, version Version) (size uint32, err error) { return } } - if n.HasTtl() { + if n.HasTtl() && n.Ttl != nil { n.Ttl.ToBytes(header[0:TtlBytesLength]) if _, err = w.Write(header[0:TtlBytesLength]); err != nil { return diff --git a/go/storage/volume.go b/go/storage/volume.go index 0e6cadecc..998b0dd64 100644 --- a/go/storage/volume.go +++ b/go/storage/volume.go @@ -152,6 +152,9 @@ func (v *Volume) NeedToReplicate() bool { // isFileUnchanged checks whether this needle to write is same as last one. // It requires serialized access in the same volume. func (v *Volume) isFileUnchanged(n *Needle) bool { + if v.Ttl == EMPTY_TTL || v.Ttl.String() == "" { + return true + } nv, ok := v.nm.Get(n.Id) if ok && nv.Offset > 0 { oldNeedle := new(Needle) diff --git a/go/weed/export.go b/go/weed/export.go index 963d2aaba..4417c65f4 100644 --- a/go/weed/export.go +++ b/go/weed/export.go @@ -6,6 +6,7 @@ import ( "fmt" "os" "path" + "path/filepath" "strconv" "strings" "text/template" @@ -49,7 +50,7 @@ func init() { var ( output = cmdExport.Flag.String("o", "", "output tar file name, must ends with .tar, or just a \"-\" for stdout") - format = cmdExport.Flag.String("fileNameFormat", defaultFnFormat, "filename format, default to {{.Mime}}/{{.Id}}:{{.Name}}") + format = cmdExport.Flag.String("fileNameFormat", defaultFnFormat, "filename formatted with {{.Mime}} {{.Id}} {{.Name}} {{.Ext}}") newer = cmdExport.Flag.String("newer", "", "export only files newer than this time, default is all files. Must be specified in RFC3339 without timezone") tarOutputFile *tar.Writer @@ -159,6 +160,7 @@ type nameParams struct { Id uint64 Mime string Key string + Ext string } func walker(vid storage.VolumeId, n *storage.Needle, version storage.Version) (err error) { @@ -166,10 +168,12 @@ func walker(vid storage.VolumeId, n *storage.Needle, version storage.Version) (e if tarOutputFile != nil { fileNameTemplateBuffer.Reset() if err = fileNameTemplate.Execute(fileNameTemplateBuffer, - nameParams{Name: string(n.Name), + nameParams{ + Name: string(n.Name), Id: n.Id, Mime: string(n.Mime), Key: key, + Ext: filepath.Ext(string(n.Name)), }, ); err != nil { return err