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

69 Girls ✠ 9599264170 ✠ Call Girls In East Of Kailash (VIP)
69 Girls ✠ 9599264170 ✠ Call Girls In East Of Kailash (VIP)69 Girls ✠ 9599264170 ✠ Call Girls In East Of Kailash (VIP)
69 Girls ✠ 9599264170 ✠ Call Girls In East Of Kailash (VIP)Escort Service
 
Solbello Sun Shade Umbrella for Beach 2024
Solbello Sun Shade Umbrella for Beach 2024Solbello Sun Shade Umbrella for Beach 2024
Solbello Sun Shade Umbrella for Beach 2024Solbello
 
Inspirational Quotes About Italy and Food
Inspirational Quotes About Italy and FoodInspirational Quotes About Italy and Food
Inspirational Quotes About Italy and FoodKasia Chojecki
 
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
 
Disney Dreams in Europe: A Guide to Disneyland Paris
Disney Dreams in Europe: A Guide to Disneyland ParisDisney Dreams in Europe: A Guide to Disneyland Paris
Disney Dreams in Europe: A Guide to Disneyland ParisisangoTravel
 
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
 
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
 
5S - House keeping (Seiri, Seiton, Seiso, Seiketsu, Shitsuke)
5S - House keeping (Seiri, Seiton, Seiso, Seiketsu, Shitsuke)5S - House keeping (Seiri, Seiton, Seiso, Seiketsu, Shitsuke)
5S - House keeping (Seiri, Seiton, Seiso, Seiketsu, Shitsuke)Mazie Garcia
 
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
 
How Safe Is It To Witness Whales In Maui’s Waters
How Safe Is It To Witness Whales In Maui’s WatersHow Safe Is It To Witness Whales In Maui’s Waters
How Safe Is It To Witness Whales In Maui’s WatersMakena Coast 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
 
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
 
Revolutionalizing Travel: A VacAI Update
Revolutionalizing Travel: A VacAI UpdateRevolutionalizing Travel: A VacAI Update
Revolutionalizing Travel: A VacAI Updatejoymorrison10
 
Phil....National-Capital-Region-NCR.pptx
Phil....National-Capital-Region-NCR.pptxPhil....National-Capital-Region-NCR.pptx
Phil....National-Capital-Region-NCR.pptxDitasDelaCruz
 
Enjoy ➥8448380779▻ Call Girls In Sector 62 Noida Escorts Delhi NCR
Enjoy ➥8448380779▻ Call Girls In Sector 62 Noida Escorts Delhi NCREnjoy ➥8448380779▻ Call Girls In Sector 62 Noida Escorts Delhi NCR
Enjoy ➥8448380779▻ Call Girls In Sector 62 Noida Escorts Delhi NCRalexsharmaa01
 
Enjoy ➥8448380779▻ Call Girls In Sector 74 Noida Escorts Delhi NCR
Enjoy ➥8448380779▻ Call Girls In Sector 74 Noida Escorts Delhi NCREnjoy ➥8448380779▻ Call Girls In Sector 74 Noida Escorts Delhi NCR
Enjoy ➥8448380779▻ Call Girls In Sector 74 Noida Escorts Delhi NCRalexsharmaa01
 

Recently uploaded (16)

69 Girls ✠ 9599264170 ✠ Call Girls In East Of Kailash (VIP)
69 Girls ✠ 9599264170 ✠ Call Girls In East Of Kailash (VIP)69 Girls ✠ 9599264170 ✠ Call Girls In East Of Kailash (VIP)
69 Girls ✠ 9599264170 ✠ Call Girls In East Of Kailash (VIP)
 
Solbello Sun Shade Umbrella for Beach 2024
Solbello Sun Shade Umbrella for Beach 2024Solbello Sun Shade Umbrella for Beach 2024
Solbello Sun Shade Umbrella for Beach 2024
 
Inspirational Quotes About Italy and Food
Inspirational Quotes About Italy and FoodInspirational Quotes About Italy and Food
Inspirational Quotes About Italy and Food
 
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
 
Disney Dreams in Europe: A Guide to Disneyland Paris
Disney Dreams in Europe: A Guide to Disneyland ParisDisney Dreams in Europe: A Guide to Disneyland Paris
Disney Dreams in Europe: A Guide to Disneyland Paris
 
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
 
Paragliding Billing Bir at Himachal Pardesh
Paragliding Billing Bir at Himachal PardeshParagliding Billing Bir at Himachal Pardesh
Paragliding Billing Bir at Himachal Pardesh
 
5S - House keeping (Seiri, Seiton, Seiso, Seiketsu, Shitsuke)
5S - House keeping (Seiri, Seiton, Seiso, Seiketsu, Shitsuke)5S - House keeping (Seiri, Seiton, Seiso, Seiketsu, Shitsuke)
5S - House keeping (Seiri, Seiton, Seiso, Seiketsu, Shitsuke)
 
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
 
How Safe Is It To Witness Whales In Maui’s Waters
How Safe Is It To Witness Whales In Maui’s WatersHow Safe Is It To Witness Whales In Maui’s Waters
How Safe Is It To Witness Whales In Maui’s Waters
 
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
 
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.
 
Revolutionalizing Travel: A VacAI Update
Revolutionalizing Travel: A VacAI UpdateRevolutionalizing Travel: A VacAI Update
Revolutionalizing Travel: A VacAI Update
 
Phil....National-Capital-Region-NCR.pptx
Phil....National-Capital-Region-NCR.pptxPhil....National-Capital-Region-NCR.pptx
Phil....National-Capital-Region-NCR.pptx
 
Enjoy ➥8448380779▻ Call Girls In Sector 62 Noida Escorts Delhi NCR
Enjoy ➥8448380779▻ Call Girls In Sector 62 Noida Escorts Delhi NCREnjoy ➥8448380779▻ Call Girls In Sector 62 Noida Escorts Delhi NCR
Enjoy ➥8448380779▻ Call Girls In Sector 62 Noida Escorts Delhi NCR
 
Enjoy ➥8448380779▻ Call Girls In Sector 74 Noida Escorts Delhi NCR
Enjoy ➥8448380779▻ Call Girls In Sector 74 Noida Escorts Delhi NCREnjoy ➥8448380779▻ Call Girls In Sector 74 Noida Escorts Delhi NCR
Enjoy ➥8448380779▻ Call Girls In Sector 74 Noida Escorts Delhi NCR
 

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 :)