Linked by Thom Holwerda on Wed 28th Mar 2012 19:22 UTC
Permalink for comment 512513
To read all comments associated with this story, please click here.
To read all comments associated with this story, please click here.
Features
Linked by Thom Holwerda on 05/18/13 21:33 UTC
Linked by David Adams on 05/16/13 4:23 UTC
Linked by Thom Holwerda on 05/11/13 21:41 UTC
Linked by Thom Holwerda on 05/08/13 14:22 UTC
Linked by Thom Holwerda on 05/02/13 15:28 UTC
Linked by Thom Holwerda on 04/29/13 21:06 UTC
Linked by Thom Holwerda on 04/24/13 22:24 UTC
Linked by Thom Holwerda on 04/18/13 11:21 UTC
Linked by Thom Holwerda on 04/16/13 9:29 UTC
Linked by Thom Holwerda on 04/15/13 22:44 UTC
More Features »
Sponsored Links



Member since:
2011-04-23
Nothing special, just:
GOMAXPROCS=4
hello.go ----------------------------------------------
package main
import (
"net/http"
"fmt"
"strconv"
)
var hellostr string="HelloWorld"
var hellolen string=strconv.Itoa(len(hellostr))
func handler(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "text/plain; charset=UTF-8")
w.Header().Set("Content-Length", hellolen) // this icreases server performance 2x ,from 11kRPS to 22k RPS (requests per second)
fmt.Fprintf(w, hellostr);
}
func main() {
http.HandleFunc("/", handler)
http.ListenAndServe(":8080", nil)
}
---------------------------------------------------