---
title: "php和go的web性通对比"
author: "ipython"
date: "2019-06-30T12:55:06Z"
tags: []
categories: ["编程语言"]
slug: "php-go-web"
draft: false
lastmod: "2019-06-30T12:55:06Z"
id: 2442267
url: "https://ipython.iteye.com/blog/2442267"
---

试用了一个php和go的helloworld的性能对比

 

纯php    index.php      &lt;?php  echo 'hello world';  ?&gt;

php -S 0.0.0.0:8801

ab -n 100 -c 10 http://127.0.0.1:8801/         # Requests per second:  4000

 

 

lumen

php -S 0.0.0.0:8802 -t public

ab -n 100 -c 10 http://127.0.0.1:8802/         # Requests per second:    683.92 

 

配置nginx

ab -n 100 -c 10 http://127.0.0.1:8803/         # Requests per second:    827.40 \[#/sec] (mea

 

 

安装 go和go的web框架 Beego

go get github.com/astaxie/beego

\`   // hello.go

package main

import "github.com/astaxie/beego"

func main(){

    beego.Run()

}

\`

go build hello.go

./hello

ab -n 100 -c 10 http://127.0.0.1:8080/         #Requests per second:    3887.12 \[#/sec]