当前位置:网站首页>Iris, the web framework of go
Iris, the web framework of go
2022-06-30 19:12:00 【It workers】
Recently started to learn GO Of WEB frame ,IRIS Claims to be Go Fastest back end Web frame , At present, the fastest growing Go Web frame . Provide complete MVC Function and look to the future .
So start with it .
github Address
https://github.com/kataras/iris
file
https://docs.iris-go.com/
install
go get -u github.com/kataras/iris
edit main.go
package main
import "github.com/kataras/iris"
func main() {
app := iris.Default()
// Method: GET
// Resource: http://localhost:8080/
app.Handle("GET", "/", func(ctx iris.Context) {
ctx.HTML("Hello world!")
})
// same as app.Handle("GET", "/ping", [...])
// Method: GET
// Resource: http://localhost:8080/ping
app.Get("/ping", func(ctx iris.Context) {
ctx.WriteString("pong")
})
// Method: GET
// Resource: http://localhost:8080/hello
app.Get("/hello", func(ctx iris.Context) {
ctx.JSON(iris.Map{"message": "Hello iris web framework."})
})
// http://localhost:8080
// http://localhost:8080/ping
// http://localhost:8080/hello
app.Run(iris.Addr(":8080"))
}function
go run main.go
Open a new window to execute
curl http://localhost:8080
result Hello world!
Or browser visit http://localhost:8080
test
Now do a simple stress test on it
The system configuration 1 nucleus 1G Memory , operating system :CentOS 7.4 64 position
ab -n 10000 -c 1000 http://localhost:8080/
# result
This is ApacheBench, Version 2.3 <$Revision: 1430300 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking localhost (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests
Completed 10000 requests
Finished 10000 requests
Server Software:
Server Hostname: localhost
Server Port: 8080
Document Path: /
Document Length: 12 bytes
Concurrency Level: 1000
Time taken for tests: 3.102 seconds
Complete requests: 10000
Failed requests: 0
Write errors: 0
Total transferred: 1280000 bytes
HTML transferred: 120000 bytes
Requests per second: 3223.45 [#/sec] (mean)
Time per request: 310.227 [ms] (mean)
Time per request: 0.310 [ms] (mean, across all concurrent requests)
Transfer rate: 402.93 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 168 383.5 2 3013
Processing: 8 138 325.4 23 2005
Waiting: 1 137 325.5 22 2002
Total: 8 306 625.5 26 3067
Percentage of the requests served within a certain time (ms)
50% 26
66% 34
75% 59
80% 90
90% 1480
95% 1748
98% 1925
99% 3014
100% 3067 (longest request)
边栏推荐
- C WinForm program interface optimization example
- Word——Word在试图打开文件时遇到错误的一种解决办法
- mysql 递归
- 《被讨厌的勇气:“自我启发之父”阿德勒的哲学课》
- Teach you to quickly set up a live studio in 30 minutes
- PO模式简介「建议收藏」
- Swin-Transformer(2021-08)
- PC端微信多开
- 「杂谈」如何改善数据分析工作中的三大被动局面
- AI chief architect 10-aica-lanxiang, propeller frame design and core technology
猜你喜欢

Hospital online consultation applet source code Internet hospital source code smart hospital source code

华兴证券:混合云原生架构下的 Kitex 实践

Swin-Transformer(2021-08)

法国A+ 法国VOC标签最高环保级别

Detailed single case mode

3.10 haas506 2.0 development tutorial example TFT

Redis入门到精通01

SaaS project management system solution for the financial service industry helps enterprises tap a broader growth service space

Cloud Native Landing Practice Using rainbond for extension dimension information

浏览器窗口切换激活事件 visibilitychange
随机推荐
云上“视界” 创新无限 | 2022阿里云直播峰会正式上线
Rust 如何实现依赖注入?
Kalman滤波器--从高斯融合推导
开发那些事儿:如何在视频中添加文字水印?
How to use AI technology to optimize the independent station customer service system? Listen to the experts!
Construction and practice of full stack code test coverage and use case discovery system
mysql修改数据类型_MySQL修改字段类型[通俗易懂]
Swin-Transformer(2021-08)
3.10 haas506 2.0开发教程-example-TFT
PHP uses queues to solve maze problems
GameFi链游系统开发NFT技术
Four tips tell you how to use SMS to promote business sales?
sqlserver SQL Server Management Studio和Transact-SQL创建账户、创建访问指定数据库的只读用户
详解单例模式
屏幕显示技术进化史
Infineon - GTM architecture -generic timer module
Nodejs installation and introduction
Solution of enterprise supply chain system in medical industry: realize collaborative visualization of medical digital intelligent supply chain
The folder is transferred between servers. The folder content is empty
系统集成项目管理工程师认证高频考点:编制项目范围管理计划