GithubHelp home page GithubHelp logo

gouch's People

Contributors

abhi-bit avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

vmx

gouch's Issues

Control the memory utilisation

runtime.Memstats dump reports too much memory allocated for a index file with 10M KV pairs(350M size on disk)

2015/10/12 23:10:12 bytes allocated and not yet freed: 280744
2015/10/12 23:10:12 bytes allocated (even if freed): 336824
2015/10/12 23:10:12 bytes allocated and not yet freed: 280744
2015/10/12 23:10:12 bytes obtained from system: 884736
2015/10/12 23:10:12 number of mallocs: 722
2015/10/12 23:10:12 number of frees: 179
2015/10/12 23:10:12 Number of GC runs: 5
2015/10/12 23:10:12 GC pause(in ns): 419113
2015/10/12 23:11:36 bytes allocated and not yet freed: 699120
2015/10/12 23:11:36 bytes allocated (even if freed): 16715914808
2015/10/12 23:11:36 bytes allocated and not yet freed: 699120
2015/10/12 23:11:36 bytes obtained from system: 1949696
2015/10/12 23:11:36 number of mallocs: 272587154
2015/10/12 23:11:36 number of frees: 272581662
2015/10/12 23:11:36 Number of GC runs: 46154
2015/10/12 23:11:36 GC pause(in ns): 9995754085

TCP related issues on cluster manager under load

2015/11/17 14:25:51 Sub-query call failed against http://apple:9094/query?limit=10: Get http://apple:9094/query?limit=10: dial tcp 172.16.12.33:9094: cannot assign requested address
2015/11/17 14:25:51 Sub-query call failed against http://apple:9093/query?limit=10: Get http://apple:9093/query?limit=10: dial tcp 172.16.12.33:9093: cannot assign requested address

Seeing above error, when firing queries using

wrk -c 1000 -t 1000 -d 10 --timeout 10 http://apple:9091/query?limit=10  

9091 is where cluster manager is running

Spending too much CPU cycles in JSON marshal

(pprof) top20   
60110ms of 86060ms total (69.85%)
Dropped 132 nodes (cum <= 430.30ms)
Showing top 20 nodes out of 80 (cum >= 5800ms)
      flat  flat%   sum%        cum   cum%
    9430ms 10.96% 10.96%    19910ms 23.14%  bytes.(*Buffer).WriteByte
    9350ms 10.86% 21.82%     9350ms 10.86%  scanblock
    9000ms 10.46% 32.28%    15270ms 17.74%  bytes.(*Buffer).grow
    5350ms  6.22% 38.50%    33680ms 39.14%  encoding/json.Indent
    4960ms  5.76% 44.26%     6320ms  7.34%  runtime.mallocgc
    2910ms  3.38% 47.64%     2910ms  3.38%  runtime.MSpan_Sweep
    2390ms  2.78% 50.42%     2450ms  2.85%  encoding/json.stateInString
    2240ms  2.60% 53.02%     2240ms  2.60%  runtime.memmove
    1930ms  2.24% 55.26%     1930ms  2.24%  runtime.writebarrierptr
    1910ms  2.22% 57.48%     5540ms  6.44%  encoding/json.(*encodeState).string
    1700ms  1.98% 59.46%     1810ms  2.10%  encoding/json.stateEndValue
    1630ms  1.89% 61.35%     4230ms  4.92%  bytes.(*Buffer).WriteString
    1170ms  1.36% 62.71%     1790ms  2.08%  encoding/json.stateBeginValue
    1110ms  1.29% 64.00%    14210ms 16.51%  encoding/json.(*structEncoder).encode
     910ms  1.06% 65.06%     2280ms  2.65%  runtime.deferreturn
     900ms  1.05% 66.11%     1290ms  1.50%  encoding/json.state1
     880ms  1.02% 67.13%      970ms  1.13%  github.com/golang/snappy.Decode
     830ms  0.96% 68.09%     1100ms  1.28%  strconv.formatBits
     760ms  0.88% 68.98%     2320ms  2.70%  runtime.makeslice
     750ms  0.87% 69.85%     5800ms  6.74%  runtime.newobject
(pprof) 

Possible options:

  • Try switching to json.NewEncoder and see if it helps in lowering the CPU footprint(by passing smaller buffers).
  • Leverage a faster 3rd party JSON encoding beside the one in Go standard library.
  • Implement new JSON encoding module to get better CPU profiles and then maybe push it Pratap's gson for Value2JSON conversion.

Add Tests for verifying integrity of library

Add test cases that verifies the sanity of exported functions from gouch library and makes sure code checkins aren't breaking existing APIs

Options:

  • Create B-Trees created using different defined steps:
    • Insert 1M entries in Couchbase
    • Delete 100K entries
    • Traverse the B-Tree and verify the sanity of each KV & KP node
    • Compact the file manually
    • Traverse the B-Tree and verify the sanity of each KV & KP node

Improve throughput of requests handled by view-query endpoint

As it stands right now, "gouch" throughput looks kind of stuck at 1.2K requests per sec whereas standalone Erlang version using couchdb master is doing close to 4K requests per sec.

limit   Erlang (Req/sec)        Erlang (MB/Sec)   Golang (Req/sec)      Golang (MB/Sec)
10          3710                2.51                 1191                0.868
50          2413                7.14                 1146                3.42
100         1245                7.24                 1087                6.32
200         649                 7.5                  995                 11.71
500         276                 7.93                 800                 23.71
1000        129                 7.48                 592                 35.24
2000        60                  7.22                 393                 46.93
3000        40                  7.05                 293                 52.75
5000        20                  7.14                 191                 58.1
10000       10                  8.08                 100                 62.17
50000       0                   0                    17                  66.54
100000      0                   0                    7                   66.82

Need to understand the bottleneck. Is inefficient implementation of limit in "gouch" or something else is slowing things down with smaller limit values.

Support for more frequent chunking

When we talk about cluster of nodes, there is need to merge responses from multiple nodes in utf-8 sort order and send it back to the client who made query request.

Right now, curl --raw shows that chunking isn't at row level instead it seems to be flushed after every 800 chars or something.

Existing erlang version already does this

TCP workloadgen

Given some promising numbers by exposing view-engine over binary protocol over a TCP server, need to have standard utility to benchmark the TCP interface(would probably expose it alongside existing HTTP interface).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.