18. PHP ベンチ結果
Nginx + php-fpm Nginx + Nginx Unit Nginx Unit
Requests per second 4889.25 [#/sec] 3700.67 [#/sec] 5051.71 [#/sec]
Time per request 0.205 [ms] 0.270 [ms] 0.198 [ms]
20. Python ベンチ結果
Nginx + uWSGI Nginx + Nginx Unit Nginx Unit
Requests per second 4435.80 [#/sec] 4109.40 [#/sec] 5293.54 [#/sec]
Time per request 0.225 [ms] 0.243 [ms] 0.189 [ms]
21. Ruby
従来方式:Nginx + unicorn + rails
Rubyコード
require 'rubygems'
require 'sinatra/base'
class HelloApp < Sinatra::Base
get '/hello' do
'Ruby Hello World!'
end
end
run HelloApp
22. Ruby ベンチ結果
Nginx + unicorn+rails Nginx + Nginx Unit Nginx Unit
Requests per second 2497.55 [#/sec] 2538.71 [#/sec] 3604.32 [#/sec]
Time per request 0.400 [ms] 0.394 [ms] 0.277 [ms]
23. Go
従来
package main
import (
"fmt"
"net"
"net/http"
"net/http/fcgi"
)
func handler(w http.ResponseWriter, r
*http.Request) {
fmt.Fprintf(w, "Go Hello, World!")
}
func main() {
l, err := net.Listen("tcp", "127.0.0.1:9000")
if err != nil {
return
}
http.HandleFunc("/go", handler)
fcgi.Serve(l, nil)
}
package main
import (
"fmt"
"net/http"
"nginx/unit"
)
func main() {
http.HandleFunc("/", func(w http.ResponseWriter, r
*http.Request) {
fmt.Fprintf(w, "Go Hello World")
})
unit.ListenAndServe(":9000", nil)
}
Nginx Unit
24. Go ベンチ結果
Nginx + go Nginx + Nginx Unit Nginx Unit
Requests per second 2565.68 [#/sec] 3133.33 [#/sec] 5255.99 [#/sec]
Time per request 0.390 [ms] 0.319 [ms] 0.190 [ms]