SlideShare a Scribd company logo
1 of 18
www.skypicker.com
Mám 20€ a chcem ísť do Londýna!
Čo to robí?

•   Search engine
•   Booking engine
•   UX
•   Customer support
•   Magic & Science
Obrázok stacku

            Booking




Data                    Payment/penaze




             Search
== predávame letenky, takto
Tech
• Javascript, everywhere (CanJS)
    – yeoman, node, grunt, bower, testacular
•   Python
•   MongoDB & Redis
•   Celery & uWSGI
•   Nginx & MySQL & stuff

• Trello & Apiary
uWSGI
• uwsgi/wsgi vs uWSGI
• wsgi = slabšie http pre py
  – PEP 333 a 3333


• uWSGI – lepítko medzi web fw a nginx

• čo Tornado/Diesel?
uWSGi features
•   performance
•   funguje všade (nginx, apache…)
•   multiprotocol (uwsgi, http, whatever)
•   shared memory
•   zerg
•   management workerov
•   pluginy
Performance
•   Throughput (req/sec)




•   Danke - http://blog.kgriffs.com
Config Nginx
upstream uwsgicluster        {
           server 127.0.0.1:9999;
           server 127.0.0.1:10000 backup=1;
         }



server   {
         location /images {
                     root /var/www/obrazky;
                    }

         location /lietadla {
                    include uwsgi_params;
                    uwsgi_pass uwsgicluster;
                    uwsgi_read_timeout 60; uwsgi_connect_timeout 60;
                    }
         }
uWSGI config
[uwsgi]
socket = 127.0.0.1:9999
master = true                        #master proces
processes = 5
harakiri = 20                         #max 20s na dotaz
max-requests=15              #max req na 1 proces
limit-as=500                          #max memory na 1 proces
memory-report=true
carbon = 127.0.0.1:2003              #graphite
file = lietadlo.py
daemonize = lietadlo.log
touch-reload = lietadlo.py
Shared memory - Py
/home/virtualenv/bin/uwsgi -s :3033 --pyshell --cache 1000
*** Cache subsystem initialized: 64MB (key: 2096 bytes, keys: 2096000 bytes, data:
65536000 bytes) preallocated ***
uwsgi socket 0 bound to TCP address :3033 fd 3
import uwsgi
uwsgi.cache_set("foo_key1", "foo_value")
key = uwsgi.cache_get("foo_key")
from redis import Redis
redis = Redis(unix_socket_path="/var/run/redis/redis.sock", db = 7)
redis.set("foo_key","foo_value")
key = redis.get("foo_key")

d = {}
d["foo_key "] = "foo_value"
key = d["foo_key "]
Shared memory - perfo
25


20


15
                                                  Py dict
10                                                uWSGI
                                                  Redis
 5


 0
     Get request   Spotreba ram pre 10 procesov
Shared mem : Redis
from datetime import datetime
                                    80:1
opak = 10000
start = datetime.now()
for x in range(opak):
              key=uwsgi.cache_get("foo_key")

print datetime.now()-start
0:00:00.006963

start = datetime.now()
for x in range(opak):
              key = redis.get("foo_key")

print datetime.now()-start
0:00:00.545974

start = datetime.now()
for x in range(opak):
              key = d["foo_key "]

print datetime.now()-start
0:00:00.003890
Zerg mode
• Realtime pridanie workerov

• Škálovanie

• Test deployment
Zerg deploy
./uwsgi –M –p 8 --pidfile main.pid --module welcome --zerg-server /var/run/mutalisk

./uwsgi --zerg /var/run/mutalisk --pidfile test.pid s--master --processes 4 --module
welcome

uwsgi --pause main.pid

#Naskočí zerg… shit shit shit

uwsgi --resume main.pid
uwsgi --stop test.pid
Logging v uWSGI
• oddelenie error/access logov

• Mongo, Redis, ZeroMQ, network, Graphite

• Alert system

• Do budúcna Sentry/Airbrake (uWSGI 1.9)
Top prusers v SP
• TSP

• Optimalizácia memory/sorted sets v Redise

• uWSGI 1.9 :)
Konec


• jk@skypicker.com

• www.skypicker.com

More Related Content

What's hot

Nodejs - Should Ruby Developers Care?
Nodejs - Should Ruby Developers Care?Nodejs - Should Ruby Developers Care?
Nodejs - Should Ruby Developers Care?Felix Geisendörfer
 
Dirty - How simple is your database?
Dirty - How simple is your database?Dirty - How simple is your database?
Dirty - How simple is your database?Felix Geisendörfer
 
Node.js - A practical introduction (v2)
Node.js  - A practical introduction (v2)Node.js  - A practical introduction (v2)
Node.js - A practical introduction (v2)Felix Geisendörfer
 
Presentation of JSConf.eu
Presentation of JSConf.euPresentation of JSConf.eu
Presentation of JSConf.euFredrik Wendt
 
Openstack at NTT Feb 7, 2011
Openstack at NTT Feb 7, 2011Openstack at NTT Feb 7, 2011
Openstack at NTT Feb 7, 2011Open Stack
 
高性能かつスケールアウト可能なHPCクラウド AIST Super Green Cloud
高性能かつスケールアウト可能なHPCクラウド AIST Super Green Cloud高性能かつスケールアウト可能なHPCクラウド AIST Super Green Cloud
高性能かつスケールアウト可能なHPCクラウド AIST Super Green CloudRyousei Takano
 
Масштабируемая конфигурация Nginx, Игорь Сысоев (Nginx)
Масштабируемая конфигурация Nginx, Игорь Сысоев (Nginx)Масштабируемая конфигурация Nginx, Игорь Сысоев (Nginx)
Масштабируемая конфигурация Nginx, Игорь Сысоев (Nginx)Ontico
 
HBaseCon 2013: OpenTSDB at Box
HBaseCon 2013: OpenTSDB at BoxHBaseCon 2013: OpenTSDB at Box
HBaseCon 2013: OpenTSDB at BoxCloudera, Inc.
 
2 docker engine_hands_on
2 docker engine_hands_on2 docker engine_hands_on
2 docker engine_hands_onFEG
 
"Metrics: Where and How", Vsevolod Polyakov
"Metrics: Where and How", Vsevolod Polyakov"Metrics: Where and How", Vsevolod Polyakov
"Metrics: Where and How", Vsevolod PolyakovYulia Shcherbachova
 
Best Practices in Handling Performance Issues
Best Practices in Handling Performance IssuesBest Practices in Handling Performance Issues
Best Practices in Handling Performance IssuesOdoo
 

What's hot (19)

Nodejs - Should Ruby Developers Care?
Nodejs - Should Ruby Developers Care?Nodejs - Should Ruby Developers Care?
Nodejs - Should Ruby Developers Care?
 
Node.js - As a networking tool
Node.js - As a networking toolNode.js - As a networking tool
Node.js - As a networking tool
 
Dirty - How simple is your database?
Dirty - How simple is your database?Dirty - How simple is your database?
Dirty - How simple is your database?
 
Node.js - A practical introduction (v2)
Node.js  - A practical introduction (v2)Node.js  - A practical introduction (v2)
Node.js - A practical introduction (v2)
 
Nodejs - A quick tour (v4)
Nodejs - A quick tour (v4)Nodejs - A quick tour (v4)
Nodejs - A quick tour (v4)
 
Presentation of JSConf.eu
Presentation of JSConf.euPresentation of JSConf.eu
Presentation of JSConf.eu
 
Openstack at NTT Feb 7, 2011
Openstack at NTT Feb 7, 2011Openstack at NTT Feb 7, 2011
Openstack at NTT Feb 7, 2011
 
Mysqlnd uh
Mysqlnd uhMysqlnd uh
Mysqlnd uh
 
Nodejs - A quick tour (v5)
Nodejs - A quick tour (v5)Nodejs - A quick tour (v5)
Nodejs - A quick tour (v5)
 
Ender
EnderEnder
Ender
 
高性能かつスケールアウト可能なHPCクラウド AIST Super Green Cloud
高性能かつスケールアウト可能なHPCクラウド AIST Super Green Cloud高性能かつスケールアウト可能なHPCクラウド AIST Super Green Cloud
高性能かつスケールアウト可能なHPCクラウド AIST Super Green Cloud
 
Масштабируемая конфигурация Nginx, Игорь Сысоев (Nginx)
Масштабируемая конфигурация Nginx, Игорь Сысоев (Nginx)Масштабируемая конфигурация Nginx, Игорь Сысоев (Nginx)
Масштабируемая конфигурация Nginx, Игорь Сысоев (Nginx)
 
HBaseCon 2013: OpenTSDB at Box
HBaseCon 2013: OpenTSDB at BoxHBaseCon 2013: OpenTSDB at Box
HBaseCon 2013: OpenTSDB at Box
 
2 docker engine_hands_on
2 docker engine_hands_on2 docker engine_hands_on
2 docker engine_hands_on
 
"Metrics: Where and How", Vsevolod Polyakov
"Metrics: Where and How", Vsevolod Polyakov"Metrics: Where and How", Vsevolod Polyakov
"Metrics: Where and How", Vsevolod Polyakov
 
Node.js - A Quick Tour II
Node.js - A Quick Tour IINode.js - A Quick Tour II
Node.js - A Quick Tour II
 
Go Memory
Go MemoryGo Memory
Go Memory
 
Ac cuda c_1
Ac cuda c_1Ac cuda c_1
Ac cuda c_1
 
Best Practices in Handling Performance Issues
Best Practices in Handling Performance IssuesBest Practices in Handling Performance Issues
Best Practices in Handling Performance Issues
 

Similar to Jk rubyslava 25

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
 
How we use and deploy Varnish at Opera
How we use and deploy Varnish at OperaHow we use and deploy Varnish at Opera
How we use and deploy Varnish at OperaCosimo Streppone
 
Real World Lessons on the Pain Points of Node.js Applications
Real World Lessons on the Pain Points of Node.js ApplicationsReal World Lessons on the Pain Points of Node.js Applications
Real World Lessons on the Pain Points of Node.js ApplicationsBen Hall
 
Building and Scaling Node.js Applications
Building and Scaling Node.js ApplicationsBuilding and Scaling Node.js Applications
Building and Scaling Node.js ApplicationsOhad Kravchick
 
Monitoring MySQL with OpenTSDB
Monitoring MySQL with OpenTSDBMonitoring MySQL with OpenTSDB
Monitoring MySQL with OpenTSDBGeoffrey Anderson
 
DUG'20: 12 - DAOS in Lenovo’s HPC Innovation Center
DUG'20: 12 - DAOS in Lenovo’s HPC Innovation CenterDUG'20: 12 - DAOS in Lenovo’s HPC Innovation Center
DUG'20: 12 - DAOS in Lenovo’s HPC Innovation CenterAndrey Kudryavtsev
 
Future Decoded - Node.js per sviluppatori .NET
Future Decoded - Node.js per sviluppatori .NETFuture Decoded - Node.js per sviluppatori .NET
Future Decoded - Node.js per sviluppatori .NETGianluca Carucci
 
"Swoole: double troubles in c", Alexandr Vronskiy
"Swoole: double troubles in c", Alexandr Vronskiy"Swoole: double troubles in c", Alexandr Vronskiy
"Swoole: double troubles in c", Alexandr VronskiyFwdays
 
Non-blocking I/O, Event loops and node.js
Non-blocking I/O, Event loops and node.jsNon-blocking I/O, Event loops and node.js
Non-blocking I/O, Event loops and node.jsMarcus Frödin
 
Deployment with Fabric
Deployment with FabricDeployment with Fabric
Deployment with Fabricandymccurdy
 
Salesforce at Stacki Atlanta Meetup February 2016
Salesforce at Stacki Atlanta Meetup February 2016Salesforce at Stacki Atlanta Meetup February 2016
Salesforce at Stacki Atlanta Meetup February 2016StackIQ
 
Automating Complex Setups with Puppet
Automating Complex Setups with PuppetAutomating Complex Setups with Puppet
Automating Complex Setups with PuppetKris Buytaert
 
How Secure Are Docker Containers?
How Secure Are Docker Containers?How Secure Are Docker Containers?
How Secure Are Docker Containers?Ben Hall
 
Beyond Golden Containers: Complementing Docker with Puppet
Beyond Golden Containers: Complementing Docker with PuppetBeyond Golden Containers: Complementing Docker with Puppet
Beyond Golden Containers: Complementing Docker with Puppetlutter
 
Writing robust Node.js applications
Writing robust Node.js applicationsWriting robust Node.js applications
Writing robust Node.js applicationsTom Croucher
 
node.js - Eventful JavaScript on the Server
node.js - Eventful JavaScript on the Servernode.js - Eventful JavaScript on the Server
node.js - Eventful JavaScript on the ServerDavid Ruiz
 
Automating complex infrastructures with Puppet
Automating complex infrastructures with PuppetAutomating complex infrastructures with Puppet
Automating complex infrastructures with PuppetKris Buytaert
 
CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak
CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak   CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak
CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak PROIDEA
 
Virtualization and automation of library software/machines + Puppet
Virtualization and automation of library software/machines + PuppetVirtualization and automation of library software/machines + Puppet
Virtualization and automation of library software/machines + PuppetOmar Reygaert
 

Similar to Jk rubyslava 25 (20)

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)
 
How we use and deploy Varnish at Opera
How we use and deploy Varnish at OperaHow we use and deploy Varnish at Opera
How we use and deploy Varnish at Opera
 
Real World Lessons on the Pain Points of Node.js Applications
Real World Lessons on the Pain Points of Node.js ApplicationsReal World Lessons on the Pain Points of Node.js Applications
Real World Lessons on the Pain Points of Node.js Applications
 
Building and Scaling Node.js Applications
Building and Scaling Node.js ApplicationsBuilding and Scaling Node.js Applications
Building and Scaling Node.js Applications
 
Monitoring MySQL with OpenTSDB
Monitoring MySQL with OpenTSDBMonitoring MySQL with OpenTSDB
Monitoring MySQL with OpenTSDB
 
DUG'20: 12 - DAOS in Lenovo’s HPC Innovation Center
DUG'20: 12 - DAOS in Lenovo’s HPC Innovation CenterDUG'20: 12 - DAOS in Lenovo’s HPC Innovation Center
DUG'20: 12 - DAOS in Lenovo’s HPC Innovation Center
 
Future Decoded - Node.js per sviluppatori .NET
Future Decoded - Node.js per sviluppatori .NETFuture Decoded - Node.js per sviluppatori .NET
Future Decoded - Node.js per sviluppatori .NET
 
"Swoole: double troubles in c", Alexandr Vronskiy
"Swoole: double troubles in c", Alexandr Vronskiy"Swoole: double troubles in c", Alexandr Vronskiy
"Swoole: double troubles in c", Alexandr Vronskiy
 
Non-blocking I/O, Event loops and node.js
Non-blocking I/O, Event loops and node.jsNon-blocking I/O, Event loops and node.js
Non-blocking I/O, Event loops and node.js
 
Deployment with Fabric
Deployment with FabricDeployment with Fabric
Deployment with Fabric
 
Salesforce at Stacki Atlanta Meetup February 2016
Salesforce at Stacki Atlanta Meetup February 2016Salesforce at Stacki Atlanta Meetup February 2016
Salesforce at Stacki Atlanta Meetup February 2016
 
Automating Complex Setups with Puppet
Automating Complex Setups with PuppetAutomating Complex Setups with Puppet
Automating Complex Setups with Puppet
 
How Secure Are Docker Containers?
How Secure Are Docker Containers?How Secure Are Docker Containers?
How Secure Are Docker Containers?
 
Beyond Golden Containers: Complementing Docker with Puppet
Beyond Golden Containers: Complementing Docker with PuppetBeyond Golden Containers: Complementing Docker with Puppet
Beyond Golden Containers: Complementing Docker with Puppet
 
Writing robust Node.js applications
Writing robust Node.js applicationsWriting robust Node.js applications
Writing robust Node.js applications
 
node.js - Eventful JavaScript on the Server
node.js - Eventful JavaScript on the Servernode.js - Eventful JavaScript on the Server
node.js - Eventful JavaScript on the Server
 
Automating complex infrastructures with Puppet
Automating complex infrastructures with PuppetAutomating complex infrastructures with Puppet
Automating complex infrastructures with Puppet
 
CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak
CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak   CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak
CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak
 
Virtualization and automation of library software/machines + Puppet
Virtualization and automation of library software/machines + PuppetVirtualization and automation of library software/machines + Puppet
Virtualization and automation of library software/machines + Puppet
 

Recently uploaded

Melanie Smith Tourism, Wellbeing and Happiness
Melanie Smith Tourism, Wellbeing and HappinessMelanie Smith Tourism, Wellbeing and Happiness
Melanie Smith Tourism, Wellbeing and HappinessEDGAR TARRÉS FALCÓ
 
What Are Some Tips For A Safe White River Rafting Experience
What Are Some Tips For A Safe White River Rafting ExperienceWhat Are Some Tips For A Safe White River Rafting Experience
What Are Some Tips For A Safe White River Rafting ExperienceTahoe Whitewater Tours
 
Discover the Magic of Sicily: Your Travel Guide
Discover the Magic of Sicily: Your Travel GuideDiscover the Magic of Sicily: Your Travel Guide
Discover the Magic of Sicily: Your Travel GuideTime for Sicily
 
Lucknow to Sitapur Cab | Lucknow to Sitapur Taxi
Lucknow to Sitapur Cab | Lucknow to Sitapur TaxiLucknow to Sitapur Cab | Lucknow to Sitapur Taxi
Lucknow to Sitapur Cab | Lucknow to Sitapur TaxiCab Bazar
 
a presentation for foreigners about how to travel in Germany.
a presentation for foreigners about how to travel in Germany.a presentation for foreigners about how to travel in Germany.
a presentation for foreigners about how to travel in Germany.moritzmieg
 
Sizzling Summer Adventures Unforgettable Tours Under the Sun
Sizzling Summer Adventures Unforgettable Tours Under the SunSizzling Summer Adventures Unforgettable Tours Under the Sun
Sizzling Summer Adventures Unforgettable Tours Under the SunSnowshoe Tahoe
 
5 beautyfull places visiting in uttrakhand
5 beautyfull places visiting in uttrakhand5 beautyfull places visiting in uttrakhand
5 beautyfull places visiting in uttrakhandaradhya3287
 
It’s Time Get Refresh Travel Around The World
It’s Time Get Refresh Travel Around The WorldIt’s Time Get Refresh Travel Around The World
It’s Time Get Refresh Travel Around The WorldParagliding Billing Bir
 
László Puczkó Wellbeing Tourism and Economy
László Puczkó Wellbeing Tourism and EconomyLászló Puczkó Wellbeing Tourism and Economy
László Puczkó Wellbeing Tourism and EconomyEDGAR TARRÉS FALCÓ
 
What Are The Must-Know Tips For First-Time Jet Skiers In Aruba
What Are The Must-Know Tips For First-Time Jet Skiers In ArubaWhat Are The Must-Know Tips For First-Time Jet Skiers In Aruba
What Are The Must-Know Tips For First-Time Jet Skiers In ArubaDelphi Watersports
 
Paragliding Billing Bir at Himachal Pardesh
Paragliding Billing Bir at Himachal PardeshParagliding Billing Bir at Himachal Pardesh
Paragliding Billing Bir at Himachal PardeshParagliding Billing Bir
 
Busy Season Mastery Simple Strategies to Optimize Your Lodging Business!.pptx
Busy Season Mastery Simple Strategies to Optimize Your Lodging Business!.pptxBusy Season Mastery Simple Strategies to Optimize Your Lodging Business!.pptx
Busy Season Mastery Simple Strategies to Optimize Your Lodging Business!.pptxRezStream
 
Canada PR - Eligibility, Steps to apply and Visa processing fees
Canada PR - Eligibility, Steps to apply and Visa processing feesCanada PR - Eligibility, Steps to apply and Visa processing fees
Canada PR - Eligibility, Steps to apply and Visa processing feesY-Axis Overseas Careers
 
The Roles of Aviation Auditors - Presentation
The Roles of Aviation Auditors - PresentationThe Roles of Aviation Auditors - Presentation
The Roles of Aviation Auditors - PresentationTilak Ramaprakash
 
Top Five Best Places to Visit in India.pdf
Top Five Best Places to Visit in India.pdfTop Five Best Places to Visit in India.pdf
Top Five Best Places to Visit in India.pdfonlinevisaindia
 
What Unwritten Rules Of Surfing Etiquette Are Crucial For Beginners To Grasp
What Unwritten Rules Of Surfing Etiquette Are Crucial For Beginners To GraspWhat Unwritten Rules Of Surfing Etiquette Are Crucial For Beginners To Grasp
What Unwritten Rules Of Surfing Etiquette Are Crucial For Beginners To GraspHanalei Surf School
 
What Safety Precautions Are Recommended For Na Pali Snorkeling Adventure
What Safety Precautions Are Recommended For Na Pali Snorkeling AdventureWhat Safety Precautions Are Recommended For Na Pali Snorkeling Adventure
What Safety Precautions Are Recommended For Na Pali Snorkeling AdventureHanalei Charters
 
Authentic Travel Experience 2024 Greg DeShields.pptx
Authentic Travel Experience 2024 Greg DeShields.pptxAuthentic Travel Experience 2024 Greg DeShields.pptx
Authentic Travel Experience 2024 Greg DeShields.pptxGregory DeShields
 
Transportation Options_ Getting to Keukenhof Gardens from Amsterdam.pdf
Transportation Options_ Getting to Keukenhof Gardens from Amsterdam.pdfTransportation Options_ Getting to Keukenhof Gardens from Amsterdam.pdf
Transportation Options_ Getting to Keukenhof Gardens from Amsterdam.pdfGlobalbustours
 
Sicily Holidays Guide Book: Unveiling the Treasures of Italy's Jewel
Sicily Holidays Guide Book: Unveiling the Treasures of Italy's JewelSicily Holidays Guide Book: Unveiling the Treasures of Italy's Jewel
Sicily Holidays Guide Book: Unveiling the Treasures of Italy's JewelTime for Sicily
 

Recently uploaded (20)

Melanie Smith Tourism, Wellbeing and Happiness
Melanie Smith Tourism, Wellbeing and HappinessMelanie Smith Tourism, Wellbeing and Happiness
Melanie Smith Tourism, Wellbeing and Happiness
 
What Are Some Tips For A Safe White River Rafting Experience
What Are Some Tips For A Safe White River Rafting ExperienceWhat Are Some Tips For A Safe White River Rafting Experience
What Are Some Tips For A Safe White River Rafting Experience
 
Discover the Magic of Sicily: Your Travel Guide
Discover the Magic of Sicily: Your Travel GuideDiscover the Magic of Sicily: Your Travel Guide
Discover the Magic of Sicily: Your Travel Guide
 
Lucknow to Sitapur Cab | Lucknow to Sitapur Taxi
Lucknow to Sitapur Cab | Lucknow to Sitapur TaxiLucknow to Sitapur Cab | Lucknow to Sitapur Taxi
Lucknow to Sitapur Cab | Lucknow to Sitapur Taxi
 
a presentation for foreigners about how to travel in Germany.
a presentation for foreigners about how to travel in Germany.a presentation for foreigners about how to travel in Germany.
a presentation for foreigners about how to travel in Germany.
 
Sizzling Summer Adventures Unforgettable Tours Under the Sun
Sizzling Summer Adventures Unforgettable Tours Under the SunSizzling Summer Adventures Unforgettable Tours Under the Sun
Sizzling Summer Adventures Unforgettable Tours Under the Sun
 
5 beautyfull places visiting in uttrakhand
5 beautyfull places visiting in uttrakhand5 beautyfull places visiting in uttrakhand
5 beautyfull places visiting in uttrakhand
 
It’s Time Get Refresh Travel Around The World
It’s Time Get Refresh Travel Around The WorldIt’s Time Get Refresh Travel Around The World
It’s Time Get Refresh Travel Around The World
 
László Puczkó Wellbeing Tourism and Economy
László Puczkó Wellbeing Tourism and EconomyLászló Puczkó Wellbeing Tourism and Economy
László Puczkó Wellbeing Tourism and Economy
 
What Are The Must-Know Tips For First-Time Jet Skiers In Aruba
What Are The Must-Know Tips For First-Time Jet Skiers In ArubaWhat Are The Must-Know Tips For First-Time Jet Skiers In Aruba
What Are The Must-Know Tips For First-Time Jet Skiers In Aruba
 
Paragliding Billing Bir at Himachal Pardesh
Paragliding Billing Bir at Himachal PardeshParagliding Billing Bir at Himachal Pardesh
Paragliding Billing Bir at Himachal Pardesh
 
Busy Season Mastery Simple Strategies to Optimize Your Lodging Business!.pptx
Busy Season Mastery Simple Strategies to Optimize Your Lodging Business!.pptxBusy Season Mastery Simple Strategies to Optimize Your Lodging Business!.pptx
Busy Season Mastery Simple Strategies to Optimize Your Lodging Business!.pptx
 
Canada PR - Eligibility, Steps to apply and Visa processing fees
Canada PR - Eligibility, Steps to apply and Visa processing feesCanada PR - Eligibility, Steps to apply and Visa processing fees
Canada PR - Eligibility, Steps to apply and Visa processing fees
 
The Roles of Aviation Auditors - Presentation
The Roles of Aviation Auditors - PresentationThe Roles of Aviation Auditors - Presentation
The Roles of Aviation Auditors - Presentation
 
Top Five Best Places to Visit in India.pdf
Top Five Best Places to Visit in India.pdfTop Five Best Places to Visit in India.pdf
Top Five Best Places to Visit in India.pdf
 
What Unwritten Rules Of Surfing Etiquette Are Crucial For Beginners To Grasp
What Unwritten Rules Of Surfing Etiquette Are Crucial For Beginners To GraspWhat Unwritten Rules Of Surfing Etiquette Are Crucial For Beginners To Grasp
What Unwritten Rules Of Surfing Etiquette Are Crucial For Beginners To Grasp
 
What Safety Precautions Are Recommended For Na Pali Snorkeling Adventure
What Safety Precautions Are Recommended For Na Pali Snorkeling AdventureWhat Safety Precautions Are Recommended For Na Pali Snorkeling Adventure
What Safety Precautions Are Recommended For Na Pali Snorkeling Adventure
 
Authentic Travel Experience 2024 Greg DeShields.pptx
Authentic Travel Experience 2024 Greg DeShields.pptxAuthentic Travel Experience 2024 Greg DeShields.pptx
Authentic Travel Experience 2024 Greg DeShields.pptx
 
Transportation Options_ Getting to Keukenhof Gardens from Amsterdam.pdf
Transportation Options_ Getting to Keukenhof Gardens from Amsterdam.pdfTransportation Options_ Getting to Keukenhof Gardens from Amsterdam.pdf
Transportation Options_ Getting to Keukenhof Gardens from Amsterdam.pdf
 
Sicily Holidays Guide Book: Unveiling the Treasures of Italy's Jewel
Sicily Holidays Guide Book: Unveiling the Treasures of Italy's JewelSicily Holidays Guide Book: Unveiling the Treasures of Italy's Jewel
Sicily Holidays Guide Book: Unveiling the Treasures of Italy's Jewel
 

Jk rubyslava 25

  • 1. www.skypicker.com Mám 20€ a chcem ísť do Londýna!
  • 2. Čo to robí? • Search engine • Booking engine • UX • Customer support • Magic & Science
  • 3. Obrázok stacku Booking Data Payment/penaze Search
  • 5. Tech • Javascript, everywhere (CanJS) – yeoman, node, grunt, bower, testacular • Python • MongoDB & Redis • Celery & uWSGI • Nginx & MySQL & stuff • Trello & Apiary
  • 6. uWSGI • uwsgi/wsgi vs uWSGI • wsgi = slabšie http pre py – PEP 333 a 3333 • uWSGI – lepítko medzi web fw a nginx • čo Tornado/Diesel?
  • 7. uWSGi features • performance • funguje všade (nginx, apache…) • multiprotocol (uwsgi, http, whatever) • shared memory • zerg • management workerov • pluginy
  • 8. Performance • Throughput (req/sec) • Danke - http://blog.kgriffs.com
  • 9. Config Nginx upstream uwsgicluster { server 127.0.0.1:9999; server 127.0.0.1:10000 backup=1; } server { location /images { root /var/www/obrazky; } location /lietadla { include uwsgi_params; uwsgi_pass uwsgicluster; uwsgi_read_timeout 60; uwsgi_connect_timeout 60; } }
  • 10. uWSGI config [uwsgi] socket = 127.0.0.1:9999 master = true #master proces processes = 5 harakiri = 20 #max 20s na dotaz max-requests=15 #max req na 1 proces limit-as=500 #max memory na 1 proces memory-report=true carbon = 127.0.0.1:2003 #graphite file = lietadlo.py daemonize = lietadlo.log touch-reload = lietadlo.py
  • 11. Shared memory - Py /home/virtualenv/bin/uwsgi -s :3033 --pyshell --cache 1000 *** Cache subsystem initialized: 64MB (key: 2096 bytes, keys: 2096000 bytes, data: 65536000 bytes) preallocated *** uwsgi socket 0 bound to TCP address :3033 fd 3 import uwsgi uwsgi.cache_set("foo_key1", "foo_value") key = uwsgi.cache_get("foo_key") from redis import Redis redis = Redis(unix_socket_path="/var/run/redis/redis.sock", db = 7) redis.set("foo_key","foo_value") key = redis.get("foo_key") d = {} d["foo_key "] = "foo_value" key = d["foo_key "]
  • 12. Shared memory - perfo 25 20 15 Py dict 10 uWSGI Redis 5 0 Get request Spotreba ram pre 10 procesov
  • 13. Shared mem : Redis from datetime import datetime 80:1 opak = 10000 start = datetime.now() for x in range(opak): key=uwsgi.cache_get("foo_key") print datetime.now()-start 0:00:00.006963 start = datetime.now() for x in range(opak): key = redis.get("foo_key") print datetime.now()-start 0:00:00.545974 start = datetime.now() for x in range(opak): key = d["foo_key "] print datetime.now()-start 0:00:00.003890
  • 14. Zerg mode • Realtime pridanie workerov • Škálovanie • Test deployment
  • 15. Zerg deploy ./uwsgi –M –p 8 --pidfile main.pid --module welcome --zerg-server /var/run/mutalisk ./uwsgi --zerg /var/run/mutalisk --pidfile test.pid s--master --processes 4 --module welcome uwsgi --pause main.pid #Naskočí zerg… shit shit shit uwsgi --resume main.pid uwsgi --stop test.pid
  • 16. Logging v uWSGI • oddelenie error/access logov • Mongo, Redis, ZeroMQ, network, Graphite • Alert system • Do budúcna Sentry/Airbrake (uWSGI 1.9)
  • 17. Top prusers v SP • TSP • Optimalizácia memory/sorted sets v Redise • uWSGI 1.9 :)