Go Entry Task

Installation

This app requires Golang and or Docker

Simple

$ docker-compose up

OR

Copy all data to

$GOPATH/src/github.com/jonathanhaposan/

Run SQL user.sql

Run go get ./... inside $GOPATH/src/github.com/jonathanhaposan/

Run these 2 binaries

$ cd $GOPATH/src/github.com/jonathanhaposan/gotask/cmd/web && go build && ./web

$ cd $GOPATH/src/github.com/jonathanhaposan/gotask/cmd/tcp   && go build && ./tcp

Documentation

List of endpoint

Endpoints Method Description
/login GET Show login page
/login POST Handle login user Accept form-data : username & password
/profile GET Show profile page, require cookie
/profile POST Handle to update nickname and picture, accept multipart : nickname & picture, require cookie

Performance

GET /login

    $ bombardier -c 200 -n 100000 -m GET http://localhost:9334/login
    Bombarding http://localhost:9334/login with 100000 request(s) using 200 connection(s)
    100000 / 100000 [==================================================================================================] 100.00% 8s
    Done!
    Statistics        Avg      Stdev        Max
    Reqs/sec     11621.38    1902.35   17737.71
    Latency       17.22ms    77.38ms      3.16s
    HTTP codes:
        1xx - 0, 2xx - 100000, 3xx - 0, 4xx - 0, 5xx - 0
        others - 0
    Throughput:    21.59MB/s

GET /profile

    $ bombardier -c 200 -n 100000 -m GET --header="Cookie: session_cookie=245648b1-ebcd-47ab-b70c-268daba09ae8" http://localhost:9334/profile
    Bombarding http://localhost:9334/profile with 100000 request(s) using 200 connection(s)
    100000 / 100000 [=================================================================================================] 100.00% 32s
    Done!
    Statistics        Avg      Stdev        Max
    Reqs/sec      3072.84     648.25    7384.05
    Latency       65.10ms    64.93ms      1.79s
    HTTP codes:
        1xx - 0, 2xx - 100000, 3xx - 0, 4xx - 0, 5xx - 0
        others - 0
    Throughput:     7.34MB/s

POST /login

    $ bombardier -c 200 -n 100000 -m POST --header="Content-Type: application/x-www-form-urlencoded" -f cred_1_login.txt http://localhost:9334/login
    Bombarding http://localhost:9334/login with 100000 request(s) using 200 connection(s)
    100000 / 100000 [=================================================================================================] 100.00% 31s
    Done!
    Statistics        Avg      Stdev        Max  Reqs/sec      3153.73    1560.82    9591.72
    Latency       62.57ms   106.50ms      1.66s
    HTTP codes:
        1xx - 0, 2xx - 100000, 3xx - 0, 4xx - 0, 5xx - 0
        others - 0
    Throughput:     1.31MB/s

POST /profile

   $ bombardier -c 200 -n 100000 -m POST --header="Cookie: session_cookie=245648b1-ebcd-47ab-b70c-268daba09ae8" 
    --header="Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW" -f data_1_profile.txt http://localhost:9334/profile
    Bombarding http://localhost:9334/profile with 100000 request(s) using 200 connection(s)
    100000 / 100000 [================================================================================================] 100.00% 1m5s
    Done!
    Statistics        Avg      Stdev        Max
    Reqs/sec      1535.11     885.60    6795.46
    Latency      130.03ms   129.61ms      2.50s
    HTTP codes:
        1xx - 0, 2xx - 100000, 3xx - 0, 4xx - 0, 5xx - 0
        others - 0
    Throughput:     0.94MB/s