这是我本机开的一个单核1G内存的Hyper-V虚拟机,首先我们使用的语言和框架版本给大家看一下:
root@kerisy:/home/zoujiaqing# go version
go version go1.5.1 linux/amd64
root@kerisy:/home/zoujiaqing# ldc2 --version
LDC - the LLVM D compiler (0.15.0):
based on DMD v2.066.1 and LLVM 3.5.0
Default target: x86_64-pc-linux-gnu
Host CPU: core-avx2
http://dlang.org - http://wiki.dlang.org/LDC
Registered Targets:
aarch64 - AArch64 (little endian)
aarch64_be - AArch64 (big endian)
arm - ARM
arm64 - AArch64 (little endian)
arm64_be - AArch64 (big endian)
armeb - ARM (big endian)
cpp - C++ backend
hexagon - Hexagon
mips - Mips
mips64 - Mips64 [experimental]
mips64el - Mips64el [experimental]
mipsel - Mipsel
msp430 - MSP430 [experimental]
nvptx - NVIDIA PTX 32-bit
nvptx64 - NVIDIA PTX 64-bit
ppc32 - PowerPC 32
ppc64 - PowerPC 64
ppc64le - PowerPC 64 LE
r600 - AMD GPUs HD2XXX-HD6XXX
sparc - Sparc
sparcv9 - Sparc V9
systemz - SystemZ
thumb - Thumb
thumbeb - Thumb (big endian)
x86 - 32-bit X86: Pentium-Pro and above
x86-64 - 64-bit X86: EM64T and AMD64
xcore - XCore
root@kerisy:/home/zoujiaqing# nodejs
nodejs
root@kerisy:/home/zoujiaqing# nodejs --version
v4.2.2
root@kerisy:/home/zoujiaqing# php --version
PHP 5.6.14-1 (cli)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies
可以看到对应的版本:
golang: 1.5.1
dlang(ldc2): 2.066.1
nodejs: 4.2.2
php: 4.6.14
golang代码:
package main
import (
"io"
"net/http"
"log"
)
func HelloServer(w http.ResponseWriter, req *http.Request) {
io.WriteString(w, "hello, world!\n")
}
func main() {