SlideShare ist ein Scribd-Unternehmen logo
1 von 30
Downloaden Sie, um offline zu lesen
Scaling FastAGI Applications with Go 
Lefteris Zafiris NTA Ltd 
Astricon 2014 Las Vegas
Who we are 
VoIP engineer at NTA ltd 
Voice and text toolset 
- Flite Asterisk App 
- eSpeak Asterisk App 
- googleTTS 
- speech recognition - Google speech API 
- Text translation 
github.com/zaf
Who we are 
NTA Ltd - nta.co.uk 
- UK based VoIP provider since 2001 
- Hosted PBX services 
- SIP 
- FOSS 
- Kamailio / Asterisk 
- Perl
Perl stack 
- FastAGI server 
- Net::Server 
- fork / prefork 
- Memory 
- Capacity - calls / server
Enter Go 
2007 Google 
Rob Pike, Ken Thompson, Robert Griesemer 
- Statically typed 
- Garbage-collected 
- Natively compiled 
- Concurrency 
- C family 
- Pragmatic, minimalistic
Enter Go 
Do not communicate by sharing memory. 
Share memory by communicating. 
- Goroutines 
lightweight threads 
cheap 
multiplexed in OS threads 
- Channels 
communication 
synchronization
Enter Go 
/* 
A simple example in go 
*/ 
package main 
import "fmt" 
func main() { 
var msg string 
msg = "Hello Astricon" 
// Retroactively say hello to all Astricons! 
for i := 0; i <= 10; i++ { 
fmt.Println(msg, 2004+i) 
} 
}
Go toolset 
- go command 
test 
fmt 
build 
install 
- Debugging 
gdb 
- Package management 
go get
AGI Package 
- AGI and FastAGI support 
- Simple familiar interface 
- BSD Licence 
- Install: 
go get github.com/zaf/agi
AGI Package 
- Session structure 
AGI environment variables 
Env map[string]string 
- Reply structure 
Numeric result of the AGI command 
Res int 
Additional returned data 
Dat string
AGI Package 
- AGI commands as methods of the Session struct 
func (a *Session) Answer() (Reply, error) 
func (a *Session) SendText(text string) (Reply, 
error) 
func (a *Session) Hangup(channel ...string) 
(Reply, error) 
func (a *Session) SayDigits(digit int, 
escape string) (Reply, error)
AGI Package usage 
- Create a new session: 
myAgi := agi.New() 
- Initialize, read and parse AGI environment: 
myAgi.Init(nil) 
- Execute AGI commands: 
myAgi.StreamFile("hello-world", "#")
AGI example 
package main 
import ( 
"log" 
"github.com/zaf/agi" 
) 
func main() { 
// Create a new AGI session and Parse the AGI environment. 
myAgi := agi.New() 
err := myAgi.Init(nil) 
if err != nil { 
log.Fatalf("Error Parsing AGI environment: %vn", err) 
} 
// Print a message on the asterisk console using Verbose. 
_, err := myAgi.Verbose("Hello World") 
if err != nil { 
log.Fatalf("AGI reply error: %vn", err) 
} 
}
FastAGI Example 
func main() { 
// Create a tcp listener on port 4573 and start a new goroutine for each connection. 
ln, err := net.Listen("tcp", ":4573") 
if err != nil { 
log.Fatal(err) 
} 
defer ln.Close() 
for { 
conn, err := ln.Accept() 
if err != nil { 
log.Println(err) 
continue 
} 
go connHandle(conn) 
} 
}
FastAGI Example 
func connHandle(c net.Conn) { 
defer c.Close() 
myAgi := agi.New() 
// Create I/O buffers 
rw := bufio.NewReadWriter(bufio.NewReader(c), bufio.NewWriter(c)) 
err := myAgi.Init(rw) 
if err != nil { 
log.Println(err) 
return 
} 
rep, err := myAgi.StreamFile("hello", "1234567890#*") 
if err != nil { 
log.Println(err) 
return 
} 
// Check AGI command return value 
if rep.Res == -1 { 
log.Println("Failed to playback file") 
} 
}
Error Handling 
func connHandle(c net.Conn) { 
defer func() { 
c.Close() 
if err := recover(); err != nil { 
log.Println("Session terminated:", err) 
} 
}() 
myAgi := agi.New() 
rw := bufio.NewReadWriter(bufio.NewReader(c), bufio.NewWriter(c)) 
err := myAgi.Init(rw) 
checkErr(err) 
_, err := myAgi.Verbose("Hello World") 
checkErr(err) 
} 
//Check for AGI Protocol errors or hangups 
func checkErr(e error) { 
if e != nil { 
panic(e) 
} 
}
AGI Debug 
- Error testing 
- Performance testing 
- Security testing 
Eliminate the use of Asterisk 
Custom AGI Payloads
Agistress 
A client that can connect to servers using the Asterisk Gateway 
Interface 
- user defined payloads 
- user controlled session parameters 
- fast - parallel session spawning 
- performance measuring 
- written in Go 
go get github.com/zaf/agistress
Agistress 
Run once and display full debug output of the AGI session: 
agistress -host 127.0.0.1 -single 
Stress test the AGI server by spawning 10 sessions 10 times per 
second and display performance details: 
agistress -host 127.0.0.1 -sess 10 -runs 10 
Run once using custom AGI payload from config file: 
agistress -host 127.0.0.1 -single -conf payload.conf
Agistress 
Config file: 
- JSON format 
- Environment variables 
- AGI Command replies 
- Reply delay
Agistress 
Config file sample: 
{ 
"AgiPayload": [ 
{"Msg": "200 result=0", "Delay": 10}, 
{"Msg": "200 result=0", "Delay": 10}, 
{"Msg": "200 result=1 endpos=1234", "Delay": 3000}, 
{"Msg": "HANGUP"} 
] 
}
Agistress 
Sample output: 
Running FastAGI bench against: 192.168.1.10:4573 
Press Enter to stop. 
A new run each: 100ms 
Sessions per run: 10 
Reply delay: 50ms 
FastAGI Sessions 
Active: 20 
Completed: 520 
Duration: 206121479 ns (last 10000 sessions average) 
Failed: 0
Measuring 
Comparison between FastAGI implementations: 
- Perl: 
Asterisk::AGI 
Net::Server::PreFork 
- Go: 
agi package 
net package
Measuring 
Simple sound file Playback application: 
- Start session and parse AGI Env 
- Parse FastAGI request URI 
agi://10.11.12.13/myagi?file=echo-test 
- Check channel status 
- Answer channel 
- Playback given file 
Perl: 73 loc (http://goo.gl/hdsxuw) 
Go: 90 loc (http://goo.gl/uxezg7)
Benchmark 
Stress test using agistress: 
- 1 session/sec 
agistress -delay=0 
- 25 sessions/sec 
agistress -runs=5 -sess=5 -delay=0 
- 50 sessions/sec 
agistress -runs=10 -sess=5 -delay=0 
- 100 sessions/sec 
agistress -runs=10 -sess=10 -delay=0 
- 200 and 400 sessions/sec
Benchmark 
Memory usage: 
Many active sessions 
Custom AGI Payload, 5 sec playback duration 
- 12 active sessions: 
agistress -sess=2 -conf=sample.conf 
- 24 active sessions: 
agistress -sess=4 -conf=sample.conf 
- 48, 96 and 192 sessions
Results 
- Up to 3 times less CPU usage 
- Up to 2.5 times shorter runtime 
- Enormous memory savings
Thank You!

Weitere ähnliche Inhalte

Was ist angesagt?

Using ARI and AGI to Connect Asterisk Instances
Using ARI and AGI to Connect Asterisk Instances Using ARI and AGI to Connect Asterisk Instances
Using ARI and AGI to Connect Asterisk Instances Jöran Vinzens
 
Kubernetes Networking with Cilium - Deep Dive
Kubernetes Networking with Cilium - Deep DiveKubernetes Networking with Cilium - Deep Dive
Kubernetes Networking with Cilium - Deep DiveMichal Rostecki
 
AstriCon 2017 - Docker Swarm & Asterisk
AstriCon 2017  - Docker Swarm & AsteriskAstriCon 2017  - Docker Swarm & Asterisk
AstriCon 2017 - Docker Swarm & AsteriskEvan McGee
 
Linux 4.x Tracing: Performance Analysis with bcc/BPF
Linux 4.x Tracing: Performance Analysis with bcc/BPFLinux 4.x Tracing: Performance Analysis with bcc/BPF
Linux 4.x Tracing: Performance Analysis with bcc/BPFBrendan Gregg
 
BPF - in-kernel virtual machine
BPF - in-kernel virtual machineBPF - in-kernel virtual machine
BPF - in-kernel virtual machineAlexei Starovoitov
 
All about Zookeeper and ClickHouse Keeper.pdf
All about Zookeeper and ClickHouse Keeper.pdfAll about Zookeeper and ClickHouse Keeper.pdf
All about Zookeeper and ClickHouse Keeper.pdfAltinity Ltd
 
Apache kafka 모니터링을 위한 Metrics 이해 및 최적화 방안
Apache kafka 모니터링을 위한 Metrics 이해 및 최적화 방안Apache kafka 모니터링을 위한 Metrics 이해 및 최적화 방안
Apache kafka 모니터링을 위한 Metrics 이해 및 최적화 방안SANG WON PARK
 
netfilter and iptables
netfilter and iptablesnetfilter and iptables
netfilter and iptablesKernel TLV
 
OpenSCAP Overview(security scanning for docker image and container)
OpenSCAP Overview(security scanning for docker image and container)OpenSCAP Overview(security scanning for docker image and container)
OpenSCAP Overview(security scanning for docker image and container)Jooho Lee
 
Docker Security workshop slides
Docker Security workshop slidesDocker Security workshop slides
Docker Security workshop slidesDocker, Inc.
 
카프카, 산전수전 노하우
카프카, 산전수전 노하우카프카, 산전수전 노하우
카프카, 산전수전 노하우if kakao
 
Neat tricks to bypass CSRF-protection
Neat tricks to bypass CSRF-protectionNeat tricks to bypass CSRF-protection
Neat tricks to bypass CSRF-protectionMikhail Egorov
 
Expanding Asterisk with Kamailio
Expanding Asterisk with KamailioExpanding Asterisk with Kamailio
Expanding Asterisk with KamailioFred Posner
 
Go Profiling - John Graham-Cumming
Go Profiling - John Graham-Cumming Go Profiling - John Graham-Cumming
Go Profiling - John Graham-Cumming Cloudflare
 
RedisConf17- Using Redis at scale @ Twitter
RedisConf17- Using Redis at scale @ TwitterRedisConf17- Using Redis at scale @ Twitter
RedisConf17- Using Redis at scale @ TwitterRedis Labs
 
Cilium - Container Networking with BPF & XDP
Cilium - Container Networking with BPF & XDPCilium - Container Networking with BPF & XDP
Cilium - Container Networking with BPF & XDPThomas Graf
 
Xdp and ebpf_maps
Xdp and ebpf_mapsXdp and ebpf_maps
Xdp and ebpf_mapslcplcp1
 

Was ist angesagt? (20)

Using ARI and AGI to Connect Asterisk Instances
Using ARI and AGI to Connect Asterisk Instances Using ARI and AGI to Connect Asterisk Instances
Using ARI and AGI to Connect Asterisk Instances
 
Kubernetes Networking with Cilium - Deep Dive
Kubernetes Networking with Cilium - Deep DiveKubernetes Networking with Cilium - Deep Dive
Kubernetes Networking with Cilium - Deep Dive
 
AstriCon 2017 - Docker Swarm & Asterisk
AstriCon 2017  - Docker Swarm & AsteriskAstriCon 2017  - Docker Swarm & Asterisk
AstriCon 2017 - Docker Swarm & Asterisk
 
Linux 4.x Tracing: Performance Analysis with bcc/BPF
Linux 4.x Tracing: Performance Analysis with bcc/BPFLinux 4.x Tracing: Performance Analysis with bcc/BPF
Linux 4.x Tracing: Performance Analysis with bcc/BPF
 
BPF - in-kernel virtual machine
BPF - in-kernel virtual machineBPF - in-kernel virtual machine
BPF - in-kernel virtual machine
 
All about Zookeeper and ClickHouse Keeper.pdf
All about Zookeeper and ClickHouse Keeper.pdfAll about Zookeeper and ClickHouse Keeper.pdf
All about Zookeeper and ClickHouse Keeper.pdf
 
Apache kafka 모니터링을 위한 Metrics 이해 및 최적화 방안
Apache kafka 모니터링을 위한 Metrics 이해 및 최적화 방안Apache kafka 모니터링을 위한 Metrics 이해 및 최적화 방안
Apache kafka 모니터링을 위한 Metrics 이해 및 최적화 방안
 
netfilter and iptables
netfilter and iptablesnetfilter and iptables
netfilter and iptables
 
OpenSCAP Overview(security scanning for docker image and container)
OpenSCAP Overview(security scanning for docker image and container)OpenSCAP Overview(security scanning for docker image and container)
OpenSCAP Overview(security scanning for docker image and container)
 
The basics of fluentd
The basics of fluentdThe basics of fluentd
The basics of fluentd
 
Docker Security workshop slides
Docker Security workshop slidesDocker Security workshop slides
Docker Security workshop slides
 
카프카, 산전수전 노하우
카프카, 산전수전 노하우카프카, 산전수전 노하우
카프카, 산전수전 노하우
 
eBPF maps 101
eBPF maps 101eBPF maps 101
eBPF maps 101
 
Neat tricks to bypass CSRF-protection
Neat tricks to bypass CSRF-protectionNeat tricks to bypass CSRF-protection
Neat tricks to bypass CSRF-protection
 
Expanding Asterisk with Kamailio
Expanding Asterisk with KamailioExpanding Asterisk with Kamailio
Expanding Asterisk with Kamailio
 
Go Profiling - John Graham-Cumming
Go Profiling - John Graham-Cumming Go Profiling - John Graham-Cumming
Go Profiling - John Graham-Cumming
 
PostgreSQL and RAM usage
PostgreSQL and RAM usagePostgreSQL and RAM usage
PostgreSQL and RAM usage
 
RedisConf17- Using Redis at scale @ Twitter
RedisConf17- Using Redis at scale @ TwitterRedisConf17- Using Redis at scale @ Twitter
RedisConf17- Using Redis at scale @ Twitter
 
Cilium - Container Networking with BPF & XDP
Cilium - Container Networking with BPF & XDPCilium - Container Networking with BPF & XDP
Cilium - Container Networking with BPF & XDP
 
Xdp and ebpf_maps
Xdp and ebpf_mapsXdp and ebpf_maps
Xdp and ebpf_maps
 

Andere mochten auch

Lecture 16 Part 2
Lecture 16 Part 2Lecture 16 Part 2
Lecture 16 Part 2giskende
 
A Rational approach to application migration and modernization
A Rational approach to application migration and modernizationA Rational approach to application migration and modernization
A Rational approach to application migration and modernizationIBM Rational software
 
Test Automation and Service Virtualization Services Offerings from Rational L...
Test Automation and Service Virtualization Services Offerings from Rational L...Test Automation and Service Virtualization Services Offerings from Rational L...
Test Automation and Service Virtualization Services Offerings from Rational L...IBM Rational software
 
Lecture 16 Part 1
Lecture 16 Part 1Lecture 16 Part 1
Lecture 16 Part 1giskende
 
The red river_rebellions1869_1870[1]
The red river_rebellions1869_1870[1]The red river_rebellions1869_1870[1]
The red river_rebellions1869_1870[1]Nicolemarie4
 
Optymalizacja procesu zarządzania komunikacją marki na platformach społecznoś...
Optymalizacja procesu zarządzania komunikacją marki na platformach społecznoś...Optymalizacja procesu zarządzania komunikacją marki na platformach społecznoś...
Optymalizacja procesu zarządzania komunikacją marki na platformach społecznoś...NapoleonCat.com
 
Lecture 19
Lecture 19Lecture 19
Lecture 19giskende
 
Oι φαναριώτες στην ελληνικη επανασταση. Εργασία στο μάθημα της ιστορίας. Γ΄Γυ...
Oι φαναριώτες στην ελληνικη επανασταση. Εργασία στο μάθημα της ιστορίας. Γ΄Γυ...Oι φαναριώτες στην ελληνικη επανασταση. Εργασία στο μάθημα της ιστορίας. Γ΄Γυ...
Oι φαναριώτες στην ελληνικη επανασταση. Εργασία στο μάθημα της ιστορίας. Γ΄Γυ...Εύα Ζαρκογιάννη
 
Primaria 4-junio-sesion
Primaria 4-junio-sesionPrimaria 4-junio-sesion
Primaria 4-junio-sesionRuben Dario
 
Becker School District
Becker School DistrictBecker School District
Becker School DistrictDigium
 
ΕΡΓΑΣΙΑ ΜΑΘΗΤΩΝ ΣΤΟ ΜΑΘΗΜΑ ΤΗΣ ΙΣΤΟΡΙΑΣ -ΥΠΕΥΘΥΝΗ ΚΑΘΗΓΗΤΡΙΑ ΖΑΡΚΟΓΙΑΝΝΗ ΕΥΑ
ΕΡΓΑΣΙΑ ΜΑΘΗΤΩΝ ΣΤΟ ΜΑΘΗΜΑ ΤΗΣ ΙΣΤΟΡΙΑΣ -ΥΠΕΥΘΥΝΗ ΚΑΘΗΓΗΤΡΙΑ ΖΑΡΚΟΓΙΑΝΝΗ ΕΥΑΕΡΓΑΣΙΑ ΜΑΘΗΤΩΝ ΣΤΟ ΜΑΘΗΜΑ ΤΗΣ ΙΣΤΟΡΙΑΣ -ΥΠΕΥΘΥΝΗ ΚΑΘΗΓΗΤΡΙΑ ΖΑΡΚΟΓΙΑΝΝΗ ΕΥΑ
ΕΡΓΑΣΙΑ ΜΑΘΗΤΩΝ ΣΤΟ ΜΑΘΗΜΑ ΤΗΣ ΙΣΤΟΡΙΑΣ -ΥΠΕΥΘΥΝΗ ΚΑΘΗΓΗΤΡΙΑ ΖΑΡΚΟΓΙΑΝΝΗ ΕΥΑΕύα Ζαρκογιάννη
 
Łódź - doskonałe miasto dla marketing miejsc
Łódź - doskonałe miasto dla  marketing miejscŁódź - doskonałe miasto dla  marketing miejsc
Łódź - doskonałe miasto dla marketing miejscNapoleonCat.com
 
Logging En Monitoring Presentatie Met Penetratie Testen 0.5
Logging En Monitoring Presentatie Met Penetratie Testen 0.5Logging En Monitoring Presentatie Met Penetratie Testen 0.5
Logging En Monitoring Presentatie Met Penetratie Testen 0.5Ferdinand_u
 
Napoleon. Raport aktywności branż na Facebooku - kwiecień 2012
Napoleon. Raport aktywności branż na Facebooku - kwiecień 2012Napoleon. Raport aktywności branż na Facebooku - kwiecień 2012
Napoleon. Raport aktywności branż na Facebooku - kwiecień 2012NapoleonCat.com
 

Andere mochten auch (20)

Lecture 16 Part 2
Lecture 16 Part 2Lecture 16 Part 2
Lecture 16 Part 2
 
A Rational approach to application migration and modernization
A Rational approach to application migration and modernizationA Rational approach to application migration and modernization
A Rational approach to application migration and modernization
 
Test Automation and Service Virtualization Services Offerings from Rational L...
Test Automation and Service Virtualization Services Offerings from Rational L...Test Automation and Service Virtualization Services Offerings from Rational L...
Test Automation and Service Virtualization Services Offerings from Rational L...
 
Lecture 16 Part 1
Lecture 16 Part 1Lecture 16 Part 1
Lecture 16 Part 1
 
vFutebol - Mídia Kit
vFutebol - Mídia KitvFutebol - Mídia Kit
vFutebol - Mídia Kit
 
The red river_rebellions1869_1870[1]
The red river_rebellions1869_1870[1]The red river_rebellions1869_1870[1]
The red river_rebellions1869_1870[1]
 
Optymalizacja procesu zarządzania komunikacją marki na platformach społecznoś...
Optymalizacja procesu zarządzania komunikacją marki na platformach społecznoś...Optymalizacja procesu zarządzania komunikacją marki na platformach społecznoś...
Optymalizacja procesu zarządzania komunikacją marki na platformach społecznoś...
 
Mitch pt3
Mitch pt3Mitch pt3
Mitch pt3
 
Lecture 19
Lecture 19Lecture 19
Lecture 19
 
Portfolio research
Portfolio researchPortfolio research
Portfolio research
 
First5
First5First5
First5
 
Radar
RadarRadar
Radar
 
Oι φαναριώτες στην ελληνικη επανασταση. Εργασία στο μάθημα της ιστορίας. Γ΄Γυ...
Oι φαναριώτες στην ελληνικη επανασταση. Εργασία στο μάθημα της ιστορίας. Γ΄Γυ...Oι φαναριώτες στην ελληνικη επανασταση. Εργασία στο μάθημα της ιστορίας. Γ΄Γυ...
Oι φαναριώτες στην ελληνικη επανασταση. Εργασία στο μάθημα της ιστορίας. Γ΄Γυ...
 
Primaria 4-junio-sesion
Primaria 4-junio-sesionPrimaria 4-junio-sesion
Primaria 4-junio-sesion
 
Becker School District
Becker School DistrictBecker School District
Becker School District
 
ΕΡΓΑΣΙΑ ΜΑΘΗΤΩΝ ΣΤΟ ΜΑΘΗΜΑ ΤΗΣ ΙΣΤΟΡΙΑΣ -ΥΠΕΥΘΥΝΗ ΚΑΘΗΓΗΤΡΙΑ ΖΑΡΚΟΓΙΑΝΝΗ ΕΥΑ
ΕΡΓΑΣΙΑ ΜΑΘΗΤΩΝ ΣΤΟ ΜΑΘΗΜΑ ΤΗΣ ΙΣΤΟΡΙΑΣ -ΥΠΕΥΘΥΝΗ ΚΑΘΗΓΗΤΡΙΑ ΖΑΡΚΟΓΙΑΝΝΗ ΕΥΑΕΡΓΑΣΙΑ ΜΑΘΗΤΩΝ ΣΤΟ ΜΑΘΗΜΑ ΤΗΣ ΙΣΤΟΡΙΑΣ -ΥΠΕΥΘΥΝΗ ΚΑΘΗΓΗΤΡΙΑ ΖΑΡΚΟΓΙΑΝΝΗ ΕΥΑ
ΕΡΓΑΣΙΑ ΜΑΘΗΤΩΝ ΣΤΟ ΜΑΘΗΜΑ ΤΗΣ ΙΣΤΟΡΙΑΣ -ΥΠΕΥΘΥΝΗ ΚΑΘΗΓΗΤΡΙΑ ΖΑΡΚΟΓΙΑΝΝΗ ΕΥΑ
 
Łódź - doskonałe miasto dla marketing miejsc
Łódź - doskonałe miasto dla  marketing miejscŁódź - doskonałe miasto dla  marketing miejsc
Łódź - doskonałe miasto dla marketing miejsc
 
Logging En Monitoring Presentatie Met Penetratie Testen 0.5
Logging En Monitoring Presentatie Met Penetratie Testen 0.5Logging En Monitoring Presentatie Met Penetratie Testen 0.5
Logging En Monitoring Presentatie Met Penetratie Testen 0.5
 
Newspaper Ideas
Newspaper IdeasNewspaper Ideas
Newspaper Ideas
 
Napoleon. Raport aktywności branż na Facebooku - kwiecień 2012
Napoleon. Raport aktywności branż na Facebooku - kwiecień 2012Napoleon. Raport aktywności branż na Facebooku - kwiecień 2012
Napoleon. Raport aktywności branż na Facebooku - kwiecień 2012
 

Ähnlich wie Scaling FastAGI Applications with Go

Geeks Anonymes - Le langage Go
Geeks Anonymes - Le langage GoGeeks Anonymes - Le langage Go
Geeks Anonymes - Le langage GoGeeks Anonymes
 
The GO Language : From Beginners to Gophers
The GO Language : From Beginners to GophersThe GO Language : From Beginners to Gophers
The GO Language : From Beginners to GophersAlessandro Sanino
 
Plack perl superglue for web frameworks and servers
Plack perl superglue for web frameworks and serversPlack perl superglue for web frameworks and servers
Plack perl superglue for web frameworks and serversTatsuhiko Miyagawa
 
GoFFIng around with Ruby #RubyConfPH
GoFFIng around with Ruby #RubyConfPHGoFFIng around with Ruby #RubyConfPH
GoFFIng around with Ruby #RubyConfPHGautam Rege
 
Golang basics for Java developers - Part 1
Golang basics for Java developers - Part 1Golang basics for Java developers - Part 1
Golang basics for Java developers - Part 1Robert Stern
 
A deep dive into PEP-3156 and the new asyncio module
A deep dive into PEP-3156 and the new asyncio moduleA deep dive into PEP-3156 and the new asyncio module
A deep dive into PEP-3156 and the new asyncio moduleSaúl Ibarra Corretgé
 
fog or: How I Learned to Stop Worrying and Love the Cloud
fog or: How I Learned to Stop Worrying and Love the Cloudfog or: How I Learned to Stop Worrying and Love the Cloud
fog or: How I Learned to Stop Worrying and Love the CloudWesley Beary
 
fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)
fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)
fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)Wesley Beary
 
Improving go-git performance
Improving go-git performanceImproving go-git performance
Improving go-git performancesource{d}
 
Using Flow-based programming to write tools and workflows for Scientific Comp...
Using Flow-based programming to write tools and workflows for Scientific Comp...Using Flow-based programming to write tools and workflows for Scientific Comp...
Using Flow-based programming to write tools and workflows for Scientific Comp...Samuel Lampa
 
Scaling python webapps from 0 to 50 million users - A top-down approach
Scaling python webapps from 0 to 50 million users - A top-down approachScaling python webapps from 0 to 50 million users - A top-down approach
Scaling python webapps from 0 to 50 million users - A top-down approachJinal Jhaveri
 
Global Interpreter Lock: Episode I - Break the Seal
Global Interpreter Lock: Episode I - Break the SealGlobal Interpreter Lock: Episode I - Break the Seal
Global Interpreter Lock: Episode I - Break the SealTzung-Bi Shih
 
Владимир Мигуро "Дао Node.js"
Владимир Мигуро "Дао Node.js"Владимир Мигуро "Дао Node.js"
Владимир Мигуро "Дао Node.js"EPAM Systems
 
Real-Time Python Web: Gevent and Socket.io
Real-Time Python Web: Gevent and Socket.ioReal-Time Python Web: Gevent and Socket.io
Real-Time Python Web: Gevent and Socket.ioRick Copeland
 
Cloud meets Fog & Puppet A Story of Version Controlled Infrastructure
Cloud meets Fog & Puppet A Story of Version Controlled InfrastructureCloud meets Fog & Puppet A Story of Version Controlled Infrastructure
Cloud meets Fog & Puppet A Story of Version Controlled InfrastructureHabeeb Rahman
 
How Secure Are Docker Containers?
How Secure Are Docker Containers?How Secure Are Docker Containers?
How Secure Are Docker Containers?Ben Hall
 
Introduction to PowerShell
Introduction to PowerShellIntroduction to PowerShell
Introduction to PowerShellBoulos Dib
 
Use PEG to Write a Programming Language Parser
Use PEG to Write a Programming Language ParserUse PEG to Write a Programming Language Parser
Use PEG to Write a Programming Language ParserYodalee
 
Finagle and Java Service Framework at Pinterest
Finagle and Java Service Framework at PinterestFinagle and Java Service Framework at Pinterest
Finagle and Java Service Framework at PinterestPavan Chitumalla
 

Ähnlich wie Scaling FastAGI Applications with Go (20)

Geeks Anonymes - Le langage Go
Geeks Anonymes - Le langage GoGeeks Anonymes - Le langage Go
Geeks Anonymes - Le langage Go
 
The GO Language : From Beginners to Gophers
The GO Language : From Beginners to GophersThe GO Language : From Beginners to Gophers
The GO Language : From Beginners to Gophers
 
Plack perl superglue for web frameworks and servers
Plack perl superglue for web frameworks and serversPlack perl superglue for web frameworks and servers
Plack perl superglue for web frameworks and servers
 
GoFFIng around with Ruby #RubyConfPH
GoFFIng around with Ruby #RubyConfPHGoFFIng around with Ruby #RubyConfPH
GoFFIng around with Ruby #RubyConfPH
 
Golang basics for Java developers - Part 1
Golang basics for Java developers - Part 1Golang basics for Java developers - Part 1
Golang basics for Java developers - Part 1
 
A deep dive into PEP-3156 and the new asyncio module
A deep dive into PEP-3156 and the new asyncio moduleA deep dive into PEP-3156 and the new asyncio module
A deep dive into PEP-3156 and the new asyncio module
 
fog or: How I Learned to Stop Worrying and Love the Cloud
fog or: How I Learned to Stop Worrying and Love the Cloudfog or: How I Learned to Stop Worrying and Love the Cloud
fog or: How I Learned to Stop Worrying and Love the Cloud
 
fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)
fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)
fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)
 
Improving go-git performance
Improving go-git performanceImproving go-git performance
Improving go-git performance
 
Using Flow-based programming to write tools and workflows for Scientific Comp...
Using Flow-based programming to write tools and workflows for Scientific Comp...Using Flow-based programming to write tools and workflows for Scientific Comp...
Using Flow-based programming to write tools and workflows for Scientific Comp...
 
Scaling python webapps from 0 to 50 million users - A top-down approach
Scaling python webapps from 0 to 50 million users - A top-down approachScaling python webapps from 0 to 50 million users - A top-down approach
Scaling python webapps from 0 to 50 million users - A top-down approach
 
Global Interpreter Lock: Episode I - Break the Seal
Global Interpreter Lock: Episode I - Break the SealGlobal Interpreter Lock: Episode I - Break the Seal
Global Interpreter Lock: Episode I - Break the Seal
 
Владимир Мигуро "Дао Node.js"
Владимир Мигуро "Дао Node.js"Владимир Мигуро "Дао Node.js"
Владимир Мигуро "Дао Node.js"
 
Real-Time Python Web: Gevent and Socket.io
Real-Time Python Web: Gevent and Socket.ioReal-Time Python Web: Gevent and Socket.io
Real-Time Python Web: Gevent and Socket.io
 
Cloud meets Fog & Puppet A Story of Version Controlled Infrastructure
Cloud meets Fog & Puppet A Story of Version Controlled InfrastructureCloud meets Fog & Puppet A Story of Version Controlled Infrastructure
Cloud meets Fog & Puppet A Story of Version Controlled Infrastructure
 
How Secure Are Docker Containers?
How Secure Are Docker Containers?How Secure Are Docker Containers?
How Secure Are Docker Containers?
 
Introduction to PowerShell
Introduction to PowerShellIntroduction to PowerShell
Introduction to PowerShell
 
Use PEG to Write a Programming Language Parser
Use PEG to Write a Programming Language ParserUse PEG to Write a Programming Language Parser
Use PEG to Write a Programming Language Parser
 
Finagle and Java Service Framework at Pinterest
Finagle and Java Service Framework at PinterestFinagle and Java Service Framework at Pinterest
Finagle and Java Service Framework at Pinterest
 
Intro to PSGI and Plack
Intro to PSGI and PlackIntro to PSGI and Plack
Intro to PSGI and Plack
 

Mehr von Digium

AstriCon 2017 Recap
AstriCon 2017 RecapAstriCon 2017 Recap
AstriCon 2017 RecapDigium
 
MegaFreight - South Africa’s largest independent freight forwarder
MegaFreight - South Africa’s largest independent freight forwarderMegaFreight - South Africa’s largest independent freight forwarder
MegaFreight - South Africa’s largest independent freight forwarderDigium
 
Danny Windham, Digium CEO, Keynote address - ITEXPO East 2015, Miamii
Danny Windham, Digium CEO, Keynote address - ITEXPO East 2015, MiamiiDanny Windham, Digium CEO, Keynote address - ITEXPO East 2015, Miamii
Danny Windham, Digium CEO, Keynote address - ITEXPO East 2015, MiamiiDigium
 
AstriCon 2014 keynote: Russell Bryant
AstriCon 2014 keynote: Russell BryantAstriCon 2014 keynote: Russell Bryant
AstriCon 2014 keynote: Russell BryantDigium
 
Distribution, redundancy and high availability using OpenSIPS
Distribution, redundancy and high availability using OpenSIPSDistribution, redundancy and high availability using OpenSIPS
Distribution, redundancy and high availability using OpenSIPSDigium
 
Getting the best out of WebRTC
Getting the best out of WebRTCGetting the best out of WebRTC
Getting the best out of WebRTCDigium
 
Automatic Configuration Management for Kamailio and Asterisk in the era of Pu...
Automatic Configuration Management for Kamailio and Asterisk in the era of Pu...Automatic Configuration Management for Kamailio and Asterisk in the era of Pu...
Automatic Configuration Management for Kamailio and Asterisk in the era of Pu...Digium
 
Making your Asterisk System Secure
Making your Asterisk System SecureMaking your Asterisk System Secure
Making your Asterisk System SecureDigium
 
WebRTC: The Big Debate, Shut Up and Build Something
WebRTC: The Big Debate, Shut Up and Build SomethingWebRTC: The Big Debate, Shut Up and Build Something
WebRTC: The Big Debate, Shut Up and Build SomethingDigium
 
Connecting Non-SIP IP Camera to Your PBX
Connecting Non-SIP IP Camera to Your PBXConnecting Non-SIP IP Camera to Your PBX
Connecting Non-SIP IP Camera to Your PBXDigium
 
The Past and Future of VoIP
The Past and Future of VoIPThe Past and Future of VoIP
The Past and Future of VoIPDigium
 
Developing an ivr payment system with asterisk (astricon 2014 las vegas nevada)
Developing an ivr payment system with asterisk (astricon 2014 las vegas nevada)Developing an ivr payment system with asterisk (astricon 2014 las vegas nevada)
Developing an ivr payment system with asterisk (astricon 2014 las vegas nevada)Digium
 
More than a phone system. A better way to communicate.
More than a phone system. A better way to communicate.More than a phone system. A better way to communicate.
More than a phone system. A better way to communicate.Digium
 
Real Success Stories from IT Heroes
Real Success Stories from IT HeroesReal Success Stories from IT Heroes
Real Success Stories from IT HeroesDigium
 
Smart Deductions for Small Business
Smart Deductions for Small BusinessSmart Deductions for Small Business
Smart Deductions for Small BusinessDigium
 
How to Build Your Brand with UC
How to Build Your Brand with UCHow to Build Your Brand with UC
How to Build Your Brand with UCDigium
 
6 Ways a New Phone System can make your Life Easier
6 Ways a New Phone System can make your Life Easier6 Ways a New Phone System can make your Life Easier
6 Ways a New Phone System can make your Life EasierDigium
 
Security Strategies for UC
Security Strategies for UCSecurity Strategies for UC
Security Strategies for UCDigium
 
Switchvox - The Best Value in Unified Communications
Switchvox - The Best Value in Unified CommunicationsSwitchvox - The Best Value in Unified Communications
Switchvox - The Best Value in Unified CommunicationsDigium
 
Five Essential Benefits Driving UC Adoption by SMBs
Five Essential Benefits Driving UC Adoption by SMBsFive Essential Benefits Driving UC Adoption by SMBs
Five Essential Benefits Driving UC Adoption by SMBsDigium
 

Mehr von Digium (20)

AstriCon 2017 Recap
AstriCon 2017 RecapAstriCon 2017 Recap
AstriCon 2017 Recap
 
MegaFreight - South Africa’s largest independent freight forwarder
MegaFreight - South Africa’s largest independent freight forwarderMegaFreight - South Africa’s largest independent freight forwarder
MegaFreight - South Africa’s largest independent freight forwarder
 
Danny Windham, Digium CEO, Keynote address - ITEXPO East 2015, Miamii
Danny Windham, Digium CEO, Keynote address - ITEXPO East 2015, MiamiiDanny Windham, Digium CEO, Keynote address - ITEXPO East 2015, Miamii
Danny Windham, Digium CEO, Keynote address - ITEXPO East 2015, Miamii
 
AstriCon 2014 keynote: Russell Bryant
AstriCon 2014 keynote: Russell BryantAstriCon 2014 keynote: Russell Bryant
AstriCon 2014 keynote: Russell Bryant
 
Distribution, redundancy and high availability using OpenSIPS
Distribution, redundancy and high availability using OpenSIPSDistribution, redundancy and high availability using OpenSIPS
Distribution, redundancy and high availability using OpenSIPS
 
Getting the best out of WebRTC
Getting the best out of WebRTCGetting the best out of WebRTC
Getting the best out of WebRTC
 
Automatic Configuration Management for Kamailio and Asterisk in the era of Pu...
Automatic Configuration Management for Kamailio and Asterisk in the era of Pu...Automatic Configuration Management for Kamailio and Asterisk in the era of Pu...
Automatic Configuration Management for Kamailio and Asterisk in the era of Pu...
 
Making your Asterisk System Secure
Making your Asterisk System SecureMaking your Asterisk System Secure
Making your Asterisk System Secure
 
WebRTC: The Big Debate, Shut Up and Build Something
WebRTC: The Big Debate, Shut Up and Build SomethingWebRTC: The Big Debate, Shut Up and Build Something
WebRTC: The Big Debate, Shut Up and Build Something
 
Connecting Non-SIP IP Camera to Your PBX
Connecting Non-SIP IP Camera to Your PBXConnecting Non-SIP IP Camera to Your PBX
Connecting Non-SIP IP Camera to Your PBX
 
The Past and Future of VoIP
The Past and Future of VoIPThe Past and Future of VoIP
The Past and Future of VoIP
 
Developing an ivr payment system with asterisk (astricon 2014 las vegas nevada)
Developing an ivr payment system with asterisk (astricon 2014 las vegas nevada)Developing an ivr payment system with asterisk (astricon 2014 las vegas nevada)
Developing an ivr payment system with asterisk (astricon 2014 las vegas nevada)
 
More than a phone system. A better way to communicate.
More than a phone system. A better way to communicate.More than a phone system. A better way to communicate.
More than a phone system. A better way to communicate.
 
Real Success Stories from IT Heroes
Real Success Stories from IT HeroesReal Success Stories from IT Heroes
Real Success Stories from IT Heroes
 
Smart Deductions for Small Business
Smart Deductions for Small BusinessSmart Deductions for Small Business
Smart Deductions for Small Business
 
How to Build Your Brand with UC
How to Build Your Brand with UCHow to Build Your Brand with UC
How to Build Your Brand with UC
 
6 Ways a New Phone System can make your Life Easier
6 Ways a New Phone System can make your Life Easier6 Ways a New Phone System can make your Life Easier
6 Ways a New Phone System can make your Life Easier
 
Security Strategies for UC
Security Strategies for UCSecurity Strategies for UC
Security Strategies for UC
 
Switchvox - The Best Value in Unified Communications
Switchvox - The Best Value in Unified CommunicationsSwitchvox - The Best Value in Unified Communications
Switchvox - The Best Value in Unified Communications
 
Five Essential Benefits Driving UC Adoption by SMBs
Five Essential Benefits Driving UC Adoption by SMBsFive Essential Benefits Driving UC Adoption by SMBs
Five Essential Benefits Driving UC Adoption by SMBs
 

Kürzlich hochgeladen

[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 

Kürzlich hochgeladen (20)

[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 

Scaling FastAGI Applications with Go

  • 1. Scaling FastAGI Applications with Go Lefteris Zafiris NTA Ltd Astricon 2014 Las Vegas
  • 2. Who we are VoIP engineer at NTA ltd Voice and text toolset - Flite Asterisk App - eSpeak Asterisk App - googleTTS - speech recognition - Google speech API - Text translation github.com/zaf
  • 3. Who we are NTA Ltd - nta.co.uk - UK based VoIP provider since 2001 - Hosted PBX services - SIP - FOSS - Kamailio / Asterisk - Perl
  • 4. Perl stack - FastAGI server - Net::Server - fork / prefork - Memory - Capacity - calls / server
  • 5. Enter Go 2007 Google Rob Pike, Ken Thompson, Robert Griesemer - Statically typed - Garbage-collected - Natively compiled - Concurrency - C family - Pragmatic, minimalistic
  • 6. Enter Go Do not communicate by sharing memory. Share memory by communicating. - Goroutines lightweight threads cheap multiplexed in OS threads - Channels communication synchronization
  • 7. Enter Go /* A simple example in go */ package main import "fmt" func main() { var msg string msg = "Hello Astricon" // Retroactively say hello to all Astricons! for i := 0; i <= 10; i++ { fmt.Println(msg, 2004+i) } }
  • 8. Go toolset - go command test fmt build install - Debugging gdb - Package management go get
  • 9. AGI Package - AGI and FastAGI support - Simple familiar interface - BSD Licence - Install: go get github.com/zaf/agi
  • 10. AGI Package - Session structure AGI environment variables Env map[string]string - Reply structure Numeric result of the AGI command Res int Additional returned data Dat string
  • 11. AGI Package - AGI commands as methods of the Session struct func (a *Session) Answer() (Reply, error) func (a *Session) SendText(text string) (Reply, error) func (a *Session) Hangup(channel ...string) (Reply, error) func (a *Session) SayDigits(digit int, escape string) (Reply, error)
  • 12. AGI Package usage - Create a new session: myAgi := agi.New() - Initialize, read and parse AGI environment: myAgi.Init(nil) - Execute AGI commands: myAgi.StreamFile("hello-world", "#")
  • 13. AGI example package main import ( "log" "github.com/zaf/agi" ) func main() { // Create a new AGI session and Parse the AGI environment. myAgi := agi.New() err := myAgi.Init(nil) if err != nil { log.Fatalf("Error Parsing AGI environment: %vn", err) } // Print a message on the asterisk console using Verbose. _, err := myAgi.Verbose("Hello World") if err != nil { log.Fatalf("AGI reply error: %vn", err) } }
  • 14. FastAGI Example func main() { // Create a tcp listener on port 4573 and start a new goroutine for each connection. ln, err := net.Listen("tcp", ":4573") if err != nil { log.Fatal(err) } defer ln.Close() for { conn, err := ln.Accept() if err != nil { log.Println(err) continue } go connHandle(conn) } }
  • 15. FastAGI Example func connHandle(c net.Conn) { defer c.Close() myAgi := agi.New() // Create I/O buffers rw := bufio.NewReadWriter(bufio.NewReader(c), bufio.NewWriter(c)) err := myAgi.Init(rw) if err != nil { log.Println(err) return } rep, err := myAgi.StreamFile("hello", "1234567890#*") if err != nil { log.Println(err) return } // Check AGI command return value if rep.Res == -1 { log.Println("Failed to playback file") } }
  • 16. Error Handling func connHandle(c net.Conn) { defer func() { c.Close() if err := recover(); err != nil { log.Println("Session terminated:", err) } }() myAgi := agi.New() rw := bufio.NewReadWriter(bufio.NewReader(c), bufio.NewWriter(c)) err := myAgi.Init(rw) checkErr(err) _, err := myAgi.Verbose("Hello World") checkErr(err) } //Check for AGI Protocol errors or hangups func checkErr(e error) { if e != nil { panic(e) } }
  • 17. AGI Debug - Error testing - Performance testing - Security testing Eliminate the use of Asterisk Custom AGI Payloads
  • 18. Agistress A client that can connect to servers using the Asterisk Gateway Interface - user defined payloads - user controlled session parameters - fast - parallel session spawning - performance measuring - written in Go go get github.com/zaf/agistress
  • 19. Agistress Run once and display full debug output of the AGI session: agistress -host 127.0.0.1 -single Stress test the AGI server by spawning 10 sessions 10 times per second and display performance details: agistress -host 127.0.0.1 -sess 10 -runs 10 Run once using custom AGI payload from config file: agistress -host 127.0.0.1 -single -conf payload.conf
  • 20. Agistress Config file: - JSON format - Environment variables - AGI Command replies - Reply delay
  • 21. Agistress Config file sample: { "AgiPayload": [ {"Msg": "200 result=0", "Delay": 10}, {"Msg": "200 result=0", "Delay": 10}, {"Msg": "200 result=1 endpos=1234", "Delay": 3000}, {"Msg": "HANGUP"} ] }
  • 22. Agistress Sample output: Running FastAGI bench against: 192.168.1.10:4573 Press Enter to stop. A new run each: 100ms Sessions per run: 10 Reply delay: 50ms FastAGI Sessions Active: 20 Completed: 520 Duration: 206121479 ns (last 10000 sessions average) Failed: 0
  • 23. Measuring Comparison between FastAGI implementations: - Perl: Asterisk::AGI Net::Server::PreFork - Go: agi package net package
  • 24. Measuring Simple sound file Playback application: - Start session and parse AGI Env - Parse FastAGI request URI agi://10.11.12.13/myagi?file=echo-test - Check channel status - Answer channel - Playback given file Perl: 73 loc (http://goo.gl/hdsxuw) Go: 90 loc (http://goo.gl/uxezg7)
  • 25. Benchmark Stress test using agistress: - 1 session/sec agistress -delay=0 - 25 sessions/sec agistress -runs=5 -sess=5 -delay=0 - 50 sessions/sec agistress -runs=10 -sess=5 -delay=0 - 100 sessions/sec agistress -runs=10 -sess=10 -delay=0 - 200 and 400 sessions/sec
  • 26.
  • 27. Benchmark Memory usage: Many active sessions Custom AGI Payload, 5 sec playback duration - 12 active sessions: agistress -sess=2 -conf=sample.conf - 24 active sessions: agistress -sess=4 -conf=sample.conf - 48, 96 and 192 sessions
  • 28.
  • 29. Results - Up to 3 times less CPU usage - Up to 2.5 times shorter runtime - Enormous memory savings