当前位置:网站首页>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)
边栏推荐
- Rust 如何实现依赖注入?
- 联想YOGA 27 2022,超强配置全面升级
- Large file transfer software based on UDP protocol
- 3.10 haas506 2.0 development tutorial example TFT
- Swin-transformer --relative positional Bias
- How does rust implement dependency injection?
- MySQL事务并发问题和MVCC机制
- sqlserver SQL Server Management Studio和Transact-SQL创建账户、创建访问指定数据库的只读用户
- How to seamlessly transition from traditional microservice framework to service grid ASM
- 一点比较有意思的模块
猜你喜欢

3.10 haas506 2.0 development tutorial example TFT

Teach you to quickly set up a live studio in 30 minutes

The easynvr platform equipment channels are all online. What is the reason for the "network request failure" in the operation?

Opencv data type code table dtype

PC端微信多开

Geoffrey Hinton: my 50 years of in-depth study and Research on mental skills

教你30分钟快速搭建直播间

熵-条件熵-联合熵-互信息-交叉熵

The online procurement system of the electronic components industry accurately matches the procurement demand and leverages the digital development of the electronic industry

Digital intelligent supplier management system solution for coal industry: data driven, supplier intelligent platform helps enterprises reduce costs and increase efficiency
随机推荐
Is it safe to open a mobile stock account? Is it reliable?
torch stack() meshgrid()
At present, the big guys are joining the two streams of flinksql, cdcmysql and Kafka, and the results are put into MySQL or KA
领导:谁再用 Redis 过期监听实现关闭订单,立马滚蛋!
「干货」数据分析常用的10种统计学方法,附上重点应用场景
MRO industrial products procurement management system: enable MRO enterprise procurement nodes to build a new digital procurement system
mysql函数获取全路径
视频内容生产与消费创新
MySQL transaction concurrency and mvcc mechanism
Courage to be hated: Adler's philosophy class: the father of self inspiration
浏览器窗口切换激活事件 visibilitychange
NFT technology for gamefi chain game system development
C WinForm program interface optimization example
ONEFLOW source code parsing: automatic inference of operator signature
Classic problem of leetcode dynamic programming (I)
PC wechat multi open
How to do a good job in software system demand research? Seven weapons make it easy for you to do it
torch stack() meshgrid()
Electron 入门
亲测flutter打包apk后大小,比较满意