SlideShare a Scribd company logo
1 of 24
Download to read offline
Dicas e Truques de
Otimização de Websites
Python
Dicas e Truques de Otimização
de Websites Python
Fabiano Weimar dos Santos [Xiru]
xiru@xiru.org
FISL 9.0 - 2008
Porto Alegre - RS
O que iremos ver?
● Na PyCon Brasil II (2006) foram apresentados testes
de performance com o Plone versão 2.1
● Dessa vez, iremos testar o Plone versão 3.0.6
– Dicas de CacheFu 1.1.1
● Agumas dicas para Django também...
Zope Padrão
● xiru:~ root# ab -c 50 -n 1000 http://127.0.0.1:8080/
● Concurrency Level: 50
● Time taken for tests: 5.101460 seconds
● Complete requests: 1000
● Failed requests: 0
● Write errors: 0
● Total transferred: 2937000 bytes
● HTML transferred: 2714000 bytes
● Requests per second: 196.02 [#/sec] (mean)
● Time per request: 255.073 [ms] (mean)
● Time per request: 5.101 [ms] (mean, across all concurrent requests)
● Transfer rate: 562.19 [Kbytes/sec] received
Plone Padrão
● xiru:~ root# ab -c 5 -n 100 http://127.0.0.1:8080/Plone/
● Concurrency Level: 5
● Time taken for tests: 13.514732 seconds
● Complete requests: 100
● Failed requests: 0
● Write errors: 0
● Total transferred: 2059600 bytes
● HTML transferred: 2031800 bytes
● Requests per second: 7.40 [#/sec] (mean)
● Time per request: 675.737 [ms] (mean)
● Time per request: 135.147 [ms] (mean, across all concurrent requests)
● Transfer rate: 148.80 [Kbytes/sec] received
Instalando Squid
● xiru:~ xiru$ ab -c 5 -n 100 http://xiru/
● Concurrency Level: 5
● Time taken for tests: 5.676328 seconds
● Complete requests: 100
● Failed requests: 0
● Write errors: 0
● Total transferred: 2002400 bytes
● HTML transferred: 1966400 bytes
● Requests per second: 17.62 [#/sec] (mean)
● Time per request: 283.816 [ms] (mean)
● Time per request: 56.763 [ms] (mean, across all concurrent requests)
● Transfer rate: 344.41 [Kbytes/sec] received
Instalando CacheFu
● xiru:~ xiru$ ab -c 5 -n 100 http://xiru/
● Concurrency Level: 5
● Time taken for tests: 6.83538 seconds
● Complete requests: 100
● Failed requests: 0
● Write errors: 0
● Total transferred: 2022929 bytes
● HTML transferred: 1986569 bytes
● Requests per second: 16.44 [#/sec] (mean)
● Time per request: 304.177 [ms] (mean)
● Time per request: 60.835 [ms] (mean, across all concurrent requests)
● Transfer rate: 324.65 [Kbytes/sec] received
Habilitando CacheFu
● xiru:~ xiru$ ab -c 5 -n 100 http://xiru/
● Concurrency Level: 5
● Time taken for tests: 2.57365 seconds
● Complete requests: 100
● Failed requests: 0
● Write errors: 0
● Total transferred: 2024900 bytes
● HTML transferred: 1966900 bytes
● Requests per second: 48.61 [#/sec] (mean)
● Time per request: 102.868 [ms] (mean)
● Time per request: 20.574 [ms] (mean, across all concurrent requests)
● Transfer rate: 960.94 [Kbytes/sec] received
Regra ContentTypes
● xiru:~ xiru$ ab -c 5 -n 100 http://xiru/
● Concurrency Level: 5
● Time taken for tests: 0.158232 seconds
● Complete requests: 100
● Failed requests: 0
● Write errors: 0
● Total transferred: 2026700 bytes
● HTML transferred: 1966900 bytes
● Requests per second: 631.98 [#/sec] (mean)
● Time per request: 7.912 [ms] (mean)
● Time per request: 1.582 [ms] (mean, across all concurrent requests)
● Transfer rate: 12506.95 [Kbytes/sec] received
ulimit
● xiru:squid-2.6.STABLE19 root# ulimit -a
● core file size (blocks, -c) 0
● data seg size (kbytes, -d) 6144
● file size (blocks, -f) unlimited
● max locked memory (kbytes, -l) unlimited
● max memory size (kbytes, -m) unlimited
● open files (-n) 4096
● pipe size (512 bytes, -p) 1
● stack size (kbytes, -s) 8192
● cpu time (seconds, -t) unlimited
● max user processes (-u) 266
● virtual memory (kbytes, -v) unlimited
ulimit
● xiru:logs root# grep descri cache.log
● 2008/04/18 11:43:22| With 256 file descriptors available
● 2008/04/18 11:59:35| With 256 file descriptors available
● 2008/04/18 12:15:47| WARNING! Your cache is running out of filedescriptors
● 2008/04/18 12:21:22| WARNING! Your cache is running out of filedescriptors
● 2008/04/18 12:24:53| With 4096 file descriptors available
250 Conexões
● xiru:logs root# ab -c 250 -n 10000 http://xiru/
● Concurrency Level: 250
● Time taken for tests: 16.539946 seconds
● Complete requests: 10000
● Failed requests: 0
● Write errors: 0
● Total transferred: 202782643 bytes
● HTML transferred: 196789049 bytes
● Requests per second: 604.60 [#/sec] (mean)
● Time per request: 413.499 [ms] (mean)
● Time per request: 1.654 [ms] (mean, across all concurrent requests)
● Transfer rate: 11972.77 [Kbytes/sec] received
500 Conexões
● xiru:logs root# ab -c 500 -n 10000 http://xiru/
● Concurrency Level: 500
● Time taken for tests: 17.624794 seconds
● Complete requests: 10000
● Failed requests: 0
● Write errors: 0
● Total transferred: 202889958 bytes
● HTML transferred: 196890973 bytes
● Requests per second: 567.38 [#/sec] (mean)
● Time per request: 881.240 [ms] (mean)
● Time per request: 1.762 [ms] (mean, across all concurrent requests)
● Transfer rate: 11241.78 [Kbytes/sec] received
750 Conexões
● xiru:logs root# ab -c 750 -n 10000 http://xiru/
● Concurrency Level: 750
● Time taken for tests: 17.903481 seconds
● Complete requests: 10000
● Failed requests: 0
● Write errors: 0
● Total transferred: 203484669 bytes
● HTML transferred: 197466516 bytes
● Requests per second: 558.55 [#/sec] (mean)
● Time per request: 1342.761 [ms] (mean)
● Time per request: 1.790 [ms] (mean, across all concurrent requests)
● Transfer rate: 11099.24 [Kbytes/sec] received
Dicas e Truques
● Invista seu tempo em “debug” de headers HTTP
● Nenhuma aplicação dinâmica terá performance sem
cache
● Cache compartilhado sempre será mais rápido do que
cache no browser (mas isso nem sempre é possível)
● Use extensões do firefox para auxiliar no seu trabalho
– Web Developer, Firebug
– YSlow (developer.yahoo.com/yslow)

More Related Content

What's hot

Highload осень 2012 лекция 1
Highload осень 2012 лекция 1Highload осень 2012 лекция 1
Highload осень 2012 лекция 1Technopark
 
Масштабируемая конфигурация Nginx, Игорь Сысоев (Nginx)
Масштабируемая конфигурация Nginx, Игорь Сысоев (Nginx)Масштабируемая конфигурация Nginx, Игорь Сысоев (Nginx)
Масштабируемая конфигурация Nginx, Игорь Сысоев (Nginx)Ontico
 
Как понять, что происходит на сервере? / Александр Крижановский (NatSys Lab.,...
Как понять, что происходит на сервере? / Александр Крижановский (NatSys Lab.,...Как понять, что происходит на сервере? / Александр Крижановский (NatSys Lab.,...
Как понять, что происходит на сервере? / Александр Крижановский (NatSys Lab.,...Ontico
 
Как построить видеоплатформу на 200 Гбитс / Ольховченков Вячеслав (Integros)
Как построить видеоплатформу на 200 Гбитс / Ольховченков Вячеслав (Integros)Как построить видеоплатформу на 200 Гбитс / Ольховченков Вячеслав (Integros)
Как построить видеоплатформу на 200 Гбитс / Ольховченков Вячеслав (Integros)Ontico
 
NginX - good practices, tips and advanced techniques
NginX - good practices, tips and advanced techniquesNginX - good practices, tips and advanced techniques
NginX - good practices, tips and advanced techniquesClaudio Borges
 
High Performance Python Microservice Communication
High Performance Python Microservice CommunicationHigh Performance Python Microservice Communication
High Performance Python Microservice CommunicationJoe Cabrera
 
Dexador Rises
Dexador RisesDexador Rises
Dexador Risesfukamachi
 
Magento 2 Seminar - Miguel Balparda - M2 with PHP 7 and Varnish
Magento 2 Seminar - Miguel Balparda - M2 with PHP 7 and VarnishMagento 2 Seminar - Miguel Balparda - M2 with PHP 7 and Varnish
Magento 2 Seminar - Miguel Balparda - M2 with PHP 7 and VarnishYireo
 
Nodejs - Should Ruby Developers Care?
Nodejs - Should Ruby Developers Care?Nodejs - Should Ruby Developers Care?
Nodejs - Should Ruby Developers Care?Felix Geisendörfer
 
Breaking the RpiDocker challenge
Breaking the RpiDocker challenge Breaking the RpiDocker challenge
Breaking the RpiDocker challenge Nicolas De Loof
 
Доклад Антона Поварова "Go in Badoo" с Golang Meetup
Доклад Антона Поварова "Go in Badoo" с Golang MeetupДоклад Антона Поварова "Go in Badoo" с Golang Meetup
Доклад Антона Поварова "Go in Badoo" с Golang MeetupBadoo Development
 
Gnocchi v3 brownbag
Gnocchi v3 brownbagGnocchi v3 brownbag
Gnocchi v3 brownbagGordon Chung
 
Containers: What are they, Really?
Containers: What are they, Really?Containers: What are they, Really?
Containers: What are they, Really?Sneha Inguva
 
Ansible as a better shell script
Ansible as a better shell scriptAnsible as a better shell script
Ansible as a better shell scriptTakuya Nishimoto
 

What's hot (20)

Ruby e xmpp
Ruby e xmppRuby e xmpp
Ruby e xmpp
 
Go破壊
Go破壊Go破壊
Go破壊
 
Highload осень 2012 лекция 1
Highload осень 2012 лекция 1Highload осень 2012 лекция 1
Highload осень 2012 лекция 1
 
Масштабируемая конфигурация Nginx, Игорь Сысоев (Nginx)
Масштабируемая конфигурация Nginx, Игорь Сысоев (Nginx)Масштабируемая конфигурация Nginx, Игорь Сысоев (Nginx)
Масштабируемая конфигурация Nginx, Игорь Сысоев (Nginx)
 
Как понять, что происходит на сервере? / Александр Крижановский (NatSys Lab.,...
Как понять, что происходит на сервере? / Александр Крижановский (NatSys Lab.,...Как понять, что происходит на сервере? / Александр Крижановский (NatSys Lab.,...
Как понять, что происходит на сервере? / Александр Крижановский (NatSys Lab.,...
 
Как построить видеоплатформу на 200 Гбитс / Ольховченков Вячеслав (Integros)
Как построить видеоплатформу на 200 Гбитс / Ольховченков Вячеслав (Integros)Как построить видеоплатформу на 200 Гбитс / Ольховченков Вячеслав (Integros)
Как построить видеоплатформу на 200 Гбитс / Ольховченков Вячеслав (Integros)
 
NginX - good practices, tips and advanced techniques
NginX - good practices, tips and advanced techniquesNginX - good practices, tips and advanced techniques
NginX - good practices, tips and advanced techniques
 
High Performance Python Microservice Communication
High Performance Python Microservice CommunicationHigh Performance Python Microservice Communication
High Performance Python Microservice Communication
 
tdc2012
tdc2012tdc2012
tdc2012
 
Dexador Rises
Dexador RisesDexador Rises
Dexador Rises
 
Threads and Node.js
Threads and Node.jsThreads and Node.js
Threads and Node.js
 
Magento 2 Seminar - Miguel Balparda - M2 with PHP 7 and Varnish
Magento 2 Seminar - Miguel Balparda - M2 with PHP 7 and VarnishMagento 2 Seminar - Miguel Balparda - M2 with PHP 7 and Varnish
Magento 2 Seminar - Miguel Balparda - M2 with PHP 7 and Varnish
 
Nodejs - Should Ruby Developers Care?
Nodejs - Should Ruby Developers Care?Nodejs - Should Ruby Developers Care?
Nodejs - Should Ruby Developers Care?
 
Breaking the RpiDocker challenge
Breaking the RpiDocker challenge Breaking the RpiDocker challenge
Breaking the RpiDocker challenge
 
Доклад Антона Поварова "Go in Badoo" с Golang Meetup
Доклад Антона Поварова "Go in Badoo" с Golang MeetupДоклад Антона Поварова "Go in Badoo" с Golang Meetup
Доклад Антона Поварова "Go in Badoo" с Golang Meetup
 
Node.js - As a networking tool
Node.js - As a networking toolNode.js - As a networking tool
Node.js - As a networking tool
 
Kraken mesoscon 2018
Kraken mesoscon 2018Kraken mesoscon 2018
Kraken mesoscon 2018
 
Gnocchi v3 brownbag
Gnocchi v3 brownbagGnocchi v3 brownbag
Gnocchi v3 brownbag
 
Containers: What are they, Really?
Containers: What are they, Really?Containers: What are they, Really?
Containers: What are they, Really?
 
Ansible as a better shell script
Ansible as a better shell scriptAnsible as a better shell script
Ansible as a better shell script
 

Viewers also liked

Conhecendo o ubuntu enterprise cloud - UEC
Conhecendo o ubuntu enterprise cloud - UECConhecendo o ubuntu enterprise cloud - UEC
Conhecendo o ubuntu enterprise cloud - UECFabiano Weimar
 
Implementação de Serviços de Voz em Ambientes Virtuais
Implementação de Serviços de Voz em Ambientes VirtuaisImplementação de Serviços de Voz em Ambientes Virtuais
Implementação de Serviços de Voz em Ambientes VirtuaisEduardo Damasceno
 
Wanda rutkiewicz prezentacja
Wanda rutkiewicz prezentacjaWanda rutkiewicz prezentacja
Wanda rutkiewicz prezentacjaWKL49
 
Functional Creations Catalog
Functional Creations CatalogFunctional Creations Catalog
Functional Creations CatalogHillary Eustis
 
викторина дисней (1)
викторина дисней (1)викторина дисней (1)
викторина дисней (1)Inna Salamova
 
Synergistic Approach to Health and Wellness
Synergistic Approach to Health and WellnessSynergistic Approach to Health and Wellness
Synergistic Approach to Health and WellnessDolores Van Bourgondien
 
Mount everest
Mount everestMount everest
Mount everestWKL49
 
Secreto y pensamientos
Secreto y pensamientosSecreto y pensamientos
Secreto y pensamientosJorge Petardo
 

Viewers also liked (11)

Asistente Virtual e-Helper BOLETIN
Asistente Virtual e-Helper BOLETINAsistente Virtual e-Helper BOLETIN
Asistente Virtual e-Helper BOLETIN
 
Conhecendo o ubuntu enterprise cloud - UEC
Conhecendo o ubuntu enterprise cloud - UECConhecendo o ubuntu enterprise cloud - UEC
Conhecendo o ubuntu enterprise cloud - UEC
 
Implementação de Serviços de Voz em Ambientes Virtuais
Implementação de Serviços de Voz em Ambientes VirtuaisImplementação de Serviços de Voz em Ambientes Virtuais
Implementação de Serviços de Voz em Ambientes Virtuais
 
Wanda rutkiewicz prezentacja
Wanda rutkiewicz prezentacjaWanda rutkiewicz prezentacja
Wanda rutkiewicz prezentacja
 
Functional Creations Catalog
Functional Creations CatalogFunctional Creations Catalog
Functional Creations Catalog
 
викторина дисней (1)
викторина дисней (1)викторина дисней (1)
викторина дисней (1)
 
Synergistic Approach to Health and Wellness
Synergistic Approach to Health and WellnessSynergistic Approach to Health and Wellness
Synergistic Approach to Health and Wellness
 
Pr
PrPr
Pr
 
Novidades do plone 4
Novidades do plone 4Novidades do plone 4
Novidades do plone 4
 
Mount everest
Mount everestMount everest
Mount everest
 
Secreto y pensamientos
Secreto y pensamientosSecreto y pensamientos
Secreto y pensamientos
 

Similar to Optimize Websites Python Tips Tricks

Introduction to performance tuning perl web applications
Introduction to performance tuning perl web applicationsIntroduction to performance tuning perl web applications
Introduction to performance tuning perl web applicationsPerrin Harkins
 
Microservices with Micronaut
Microservices with MicronautMicroservices with Micronaut
Microservices with MicronautQAware GmbH
 
Resolving Firebird performance problems
Resolving Firebird performance problemsResolving Firebird performance problems
Resolving Firebird performance problemsAlexey Kovyazin
 
PyCon AU 2015 - Using benchmarks to understand how wsgi servers work
PyCon AU 2015  - Using benchmarks to understand how wsgi servers workPyCon AU 2015  - Using benchmarks to understand how wsgi servers work
PyCon AU 2015 - Using benchmarks to understand how wsgi servers workGraham Dumpleton
 
EVCache: Lowering Costs for a Low Latency Cache with RocksDB
EVCache: Lowering Costs for a Low Latency Cache with RocksDBEVCache: Lowering Costs for a Low Latency Cache with RocksDB
EVCache: Lowering Costs for a Low Latency Cache with RocksDBScott Mansfield
 
Full Stack Load Testing
Full Stack Load Testing Full Stack Load Testing
Full Stack Load Testing Terral R Jordan
 
On the way to low latency (2nd edition)
On the way to low latency (2nd edition)On the way to low latency (2nd edition)
On the way to low latency (2nd edition)Artem Orobets
 
Microservices with Micronaut
Microservices with MicronautMicroservices with Micronaut
Microservices with MicronautQAware GmbH
 
Microservices with Micronaut
Microservices with MicronautMicroservices with Micronaut
Microservices with MicronautQAware GmbH
 
"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
 
Improving Kafka at-least-once performance at Uber
Improving Kafka at-least-once performance at UberImproving Kafka at-least-once performance at Uber
Improving Kafka at-least-once performance at UberYing Zheng
 
HPPG - high performance photo gallery
HPPG - high performance photo galleryHPPG - high performance photo gallery
HPPG - high performance photo galleryRemigijus Kiminas
 
WordPress&映像配信セミナー+さぶみっと!オフ会- 第2回 さぶみっと! WEB制作セミナー Supported by NTTスマートコネクト
WordPress&映像配信セミナー+さぶみっと!オフ会- 第2回 さぶみっと! WEB制作セミナー Supported by NTTスマートコネクトWordPress&映像配信セミナー+さぶみっと!オフ会- 第2回 さぶみっと! WEB制作セミナー Supported by NTTスマートコネクト
WordPress&映像配信セミナー+さぶみっと!オフ会- 第2回 さぶみっと! WEB制作セミナー Supported by NTTスマートコネクトHiromichi Koga
 
Mage Titans USA 2016 - Miguel Balparda - Magento 2: Premium Performance with ...
Mage Titans USA 2016 - Miguel Balparda - Magento 2: Premium Performance with ...Mage Titans USA 2016 - Miguel Balparda - Magento 2: Premium Performance with ...
Mage Titans USA 2016 - Miguel Balparda - Magento 2: Premium Performance with ...Stacey Whitney
 
Pinot: Realtime OLAP for 530 Million Users - Sigmod 2018
Pinot: Realtime OLAP for 530 Million Users - Sigmod 2018Pinot: Realtime OLAP for 530 Million Users - Sigmod 2018
Pinot: Realtime OLAP for 530 Million Users - Sigmod 2018Seunghyun Lee
 

Similar to Optimize Websites Python Tips Tricks (20)

From LAMP to LNNP
From LAMP to LNNPFrom LAMP to LNNP
From LAMP to LNNP
 
Introduction to performance tuning perl web applications
Introduction to performance tuning perl web applicationsIntroduction to performance tuning perl web applications
Introduction to performance tuning perl web applications
 
Microservices with Micronaut
Microservices with MicronautMicroservices with Micronaut
Microservices with Micronaut
 
Resolving Firebird performance problems
Resolving Firebird performance problemsResolving Firebird performance problems
Resolving Firebird performance problems
 
PyCon AU 2015 - Using benchmarks to understand how wsgi servers work
PyCon AU 2015  - Using benchmarks to understand how wsgi servers workPyCon AU 2015  - Using benchmarks to understand how wsgi servers work
PyCon AU 2015 - Using benchmarks to understand how wsgi servers work
 
EVCache: Lowering Costs for a Low Latency Cache with RocksDB
EVCache: Lowering Costs for a Low Latency Cache with RocksDBEVCache: Lowering Costs for a Low Latency Cache with RocksDB
EVCache: Lowering Costs for a Low Latency Cache with RocksDB
 
Full Stack Load Testing
Full Stack Load Testing Full Stack Load Testing
Full Stack Load Testing
 
On the way to low latency (2nd edition)
On the way to low latency (2nd edition)On the way to low latency (2nd edition)
On the way to low latency (2nd edition)
 
Haproxy - zastosowania
Haproxy - zastosowaniaHaproxy - zastosowania
Haproxy - zastosowania
 
Microservices with Micronaut
Microservices with MicronautMicroservices with Micronaut
Microservices with Micronaut
 
mod_perl 2.0 For Speed Freaks!
mod_perl 2.0 For Speed Freaks!mod_perl 2.0 For Speed Freaks!
mod_perl 2.0 For Speed Freaks!
 
JEEConf. Vanilla java
JEEConf. Vanilla javaJEEConf. Vanilla java
JEEConf. Vanilla java
 
Microservices with Micronaut
Microservices with MicronautMicroservices with Micronaut
Microservices with Micronaut
 
"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
 
Improving Kafka at-least-once performance at Uber
Improving Kafka at-least-once performance at UberImproving Kafka at-least-once performance at Uber
Improving Kafka at-least-once performance at Uber
 
HPPG - high performance photo gallery
HPPG - high performance photo galleryHPPG - high performance photo gallery
HPPG - high performance photo gallery
 
WordPress&映像配信セミナー+さぶみっと!オフ会- 第2回 さぶみっと! WEB制作セミナー Supported by NTTスマートコネクト
WordPress&映像配信セミナー+さぶみっと!オフ会- 第2回 さぶみっと! WEB制作セミナー Supported by NTTスマートコネクトWordPress&映像配信セミナー+さぶみっと!オフ会- 第2回 さぶみっと! WEB制作セミナー Supported by NTTスマートコネクト
WordPress&映像配信セミナー+さぶみっと!オフ会- 第2回 さぶみっと! WEB制作セミナー Supported by NTTスマートコネクト
 
さぶみっと
さぶみっとさぶみっと
さぶみっと
 
Mage Titans USA 2016 - Miguel Balparda - Magento 2: Premium Performance with ...
Mage Titans USA 2016 - Miguel Balparda - Magento 2: Premium Performance with ...Mage Titans USA 2016 - Miguel Balparda - Magento 2: Premium Performance with ...
Mage Titans USA 2016 - Miguel Balparda - Magento 2: Premium Performance with ...
 
Pinot: Realtime OLAP for 530 Million Users - Sigmod 2018
Pinot: Realtime OLAP for 530 Million Users - Sigmod 2018Pinot: Realtime OLAP for 530 Million Users - Sigmod 2018
Pinot: Realtime OLAP for 530 Million Users - Sigmod 2018
 

More from Fabiano Weimar

Plone, Zope e Python - Da Universidade ao Governo - SulComp II (2006)
Plone, Zope e Python - Da Universidade ao Governo - SulComp II (2006)Plone, Zope e Python - Da Universidade ao Governo - SulComp II (2006)
Plone, Zope e Python - Da Universidade ao Governo - SulComp II (2006)Fabiano Weimar
 
Performance Tuning de Clusters Plone - PyConBrasil 2 (2006)
Performance Tuning de Clusters Plone - PyConBrasil 2 (2006)Performance Tuning de Clusters Plone - PyConBrasil 2 (2006)
Performance Tuning de Clusters Plone - PyConBrasil 2 (2006)Fabiano Weimar
 
Meu Plone Site está lento. O que fazer???
Meu Plone Site está lento. O que fazer???Meu Plone Site está lento. O que fazer???
Meu Plone Site está lento. O que fazer???Fabiano Weimar
 
Portal SEBRAE - Quando o Plone Gerencia o Conteúdo Alheio
Portal SEBRAE - Quando o Plone Gerencia o Conteúdo AlheioPortal SEBRAE - Quando o Plone Gerencia o Conteúdo Alheio
Portal SEBRAE - Quando o Plone Gerencia o Conteúdo AlheioFabiano Weimar
 
Introducao ao sistema de gerenciamento de conteúdo Plone
Introducao ao sistema de gerenciamento de conteúdo PloneIntroducao ao sistema de gerenciamento de conteúdo Plone
Introducao ao sistema de gerenciamento de conteúdo PloneFabiano Weimar
 
Integração de sistemas legados com Plone
Integração de sistemas legados com PloneIntegração de sistemas legados com Plone
Integração de sistemas legados com PloneFabiano Weimar
 
Algoritmos genéticos em python - PyConBrasil 3 (2007)
Algoritmos genéticos em python - PyConBrasil 3 (2007)Algoritmos genéticos em python - PyConBrasil 3 (2007)
Algoritmos genéticos em python - PyConBrasil 3 (2007)Fabiano Weimar
 
Faça seu portal voar usando o plone.app.caching
Faça seu portal voar usando o plone.app.cachingFaça seu portal voar usando o plone.app.caching
Faça seu portal voar usando o plone.app.cachingFabiano Weimar
 
Adaptando o Plone para plataformas móveis
Adaptando o Plone para plataformas móveisAdaptando o Plone para plataformas móveis
Adaptando o Plone para plataformas móveisFabiano Weimar
 
Plone Yak Shaving and Bikeshedding
Plone Yak Shaving and BikesheddingPlone Yak Shaving and Bikeshedding
Plone Yak Shaving and BikesheddingFabiano Weimar
 
Otimização de infra estrutura para hospedagem de websites
Otimização de infra estrutura para hospedagem de websitesOtimização de infra estrutura para hospedagem de websites
Otimização de infra estrutura para hospedagem de websitesFabiano Weimar
 
Understanding Plone Security
Understanding Plone SecurityUnderstanding Plone Security
Understanding Plone SecurityFabiano Weimar
 
Tips and Tricks about Plone Development for Mobile Platforms
Tips and Tricks about Plone Development for Mobile PlatformsTips and Tricks about Plone Development for Mobile Platforms
Tips and Tricks about Plone Development for Mobile PlatformsFabiano Weimar
 
Sistema de protocolo de documentos - SPDO
Sistema de protocolo de documentos - SPDOSistema de protocolo de documentos - SPDO
Sistema de protocolo de documentos - SPDOFabiano Weimar
 
Reconhecimento de fala em português brasileiro
Reconhecimento de fala em português brasileiroReconhecimento de fala em português brasileiro
Reconhecimento de fala em português brasileiroFabiano Weimar
 
Plone na plataforma mobile
Plone na plataforma mobilePlone na plataforma mobile
Plone na plataforma mobileFabiano Weimar
 

More from Fabiano Weimar (20)

Plone, Zope e Python - Da Universidade ao Governo - SulComp II (2006)
Plone, Zope e Python - Da Universidade ao Governo - SulComp II (2006)Plone, Zope e Python - Da Universidade ao Governo - SulComp II (2006)
Plone, Zope e Python - Da Universidade ao Governo - SulComp II (2006)
 
Performance Tuning de Clusters Plone - PyConBrasil 2 (2006)
Performance Tuning de Clusters Plone - PyConBrasil 2 (2006)Performance Tuning de Clusters Plone - PyConBrasil 2 (2006)
Performance Tuning de Clusters Plone - PyConBrasil 2 (2006)
 
Meu Plone Site está lento. O que fazer???
Meu Plone Site está lento. O que fazer???Meu Plone Site está lento. O que fazer???
Meu Plone Site está lento. O que fazer???
 
Portal SEBRAE - Quando o Plone Gerencia o Conteúdo Alheio
Portal SEBRAE - Quando o Plone Gerencia o Conteúdo AlheioPortal SEBRAE - Quando o Plone Gerencia o Conteúdo Alheio
Portal SEBRAE - Quando o Plone Gerencia o Conteúdo Alheio
 
Introducao ao sistema de gerenciamento de conteúdo Plone
Introducao ao sistema de gerenciamento de conteúdo PloneIntroducao ao sistema de gerenciamento de conteúdo Plone
Introducao ao sistema de gerenciamento de conteúdo Plone
 
Integração de sistemas legados com Plone
Integração de sistemas legados com PloneIntegração de sistemas legados com Plone
Integração de sistemas legados com Plone
 
Algoritmos genéticos em python - PyConBrasil 3 (2007)
Algoritmos genéticos em python - PyConBrasil 3 (2007)Algoritmos genéticos em python - PyConBrasil 3 (2007)
Algoritmos genéticos em python - PyConBrasil 3 (2007)
 
Faça seu portal voar usando o plone.app.caching
Faça seu portal voar usando o plone.app.cachingFaça seu portal voar usando o plone.app.caching
Faça seu portal voar usando o plone.app.caching
 
Adaptando o Plone para plataformas móveis
Adaptando o Plone para plataformas móveisAdaptando o Plone para plataformas móveis
Adaptando o Plone para plataformas móveis
 
Plone Yak Shaving and Bikeshedding
Plone Yak Shaving and BikesheddingPlone Yak Shaving and Bikeshedding
Plone Yak Shaving and Bikeshedding
 
Otimização de infra estrutura para hospedagem de websites
Otimização de infra estrutura para hospedagem de websitesOtimização de infra estrutura para hospedagem de websites
Otimização de infra estrutura para hospedagem de websites
 
Understanding Plone Security
Understanding Plone SecurityUnderstanding Plone Security
Understanding Plone Security
 
Tips and Tricks about Plone Development for Mobile Platforms
Tips and Tricks about Plone Development for Mobile PlatformsTips and Tricks about Plone Development for Mobile Platforms
Tips and Tricks about Plone Development for Mobile Platforms
 
Segurança no plone
Segurança no ploneSegurança no plone
Segurança no plone
 
Sistema de protocolo de documentos - SPDO
Sistema de protocolo de documentos - SPDOSistema de protocolo de documentos - SPDO
Sistema de protocolo de documentos - SPDO
 
O novo plone 4
O novo plone 4O novo plone 4
O novo plone 4
 
Reconhecimento de fala em português brasileiro
Reconhecimento de fala em português brasileiroReconhecimento de fala em português brasileiro
Reconhecimento de fala em português brasileiro
 
IPv6
IPv6IPv6
IPv6
 
Plone na nuvem
Plone na nuvemPlone na nuvem
Plone na nuvem
 
Plone na plataforma mobile
Plone na plataforma mobilePlone na plataforma mobile
Plone na plataforma mobile
 

Optimize Websites Python Tips Tricks

  • 1. Dicas e Truques de Otimização de Websites Python
  • 2. Dicas e Truques de Otimização de Websites Python Fabiano Weimar dos Santos [Xiru] xiru@xiru.org FISL 9.0 - 2008 Porto Alegre - RS
  • 3. O que iremos ver? ● Na PyCon Brasil II (2006) foram apresentados testes de performance com o Plone versão 2.1 ● Dessa vez, iremos testar o Plone versão 3.0.6 – Dicas de CacheFu 1.1.1 ● Agumas dicas para Django também...
  • 4. Zope Padrão ● xiru:~ root# ab -c 50 -n 1000 http://127.0.0.1:8080/ ● Concurrency Level: 50 ● Time taken for tests: 5.101460 seconds ● Complete requests: 1000 ● Failed requests: 0 ● Write errors: 0 ● Total transferred: 2937000 bytes ● HTML transferred: 2714000 bytes ● Requests per second: 196.02 [#/sec] (mean) ● Time per request: 255.073 [ms] (mean) ● Time per request: 5.101 [ms] (mean, across all concurrent requests) ● Transfer rate: 562.19 [Kbytes/sec] received
  • 5. Plone Padrão ● xiru:~ root# ab -c 5 -n 100 http://127.0.0.1:8080/Plone/ ● Concurrency Level: 5 ● Time taken for tests: 13.514732 seconds ● Complete requests: 100 ● Failed requests: 0 ● Write errors: 0 ● Total transferred: 2059600 bytes ● HTML transferred: 2031800 bytes ● Requests per second: 7.40 [#/sec] (mean) ● Time per request: 675.737 [ms] (mean) ● Time per request: 135.147 [ms] (mean, across all concurrent requests) ● Transfer rate: 148.80 [Kbytes/sec] received
  • 6.
  • 7.
  • 8.
  • 9. Instalando Squid ● xiru:~ xiru$ ab -c 5 -n 100 http://xiru/ ● Concurrency Level: 5 ● Time taken for tests: 5.676328 seconds ● Complete requests: 100 ● Failed requests: 0 ● Write errors: 0 ● Total transferred: 2002400 bytes ● HTML transferred: 1966400 bytes ● Requests per second: 17.62 [#/sec] (mean) ● Time per request: 283.816 [ms] (mean) ● Time per request: 56.763 [ms] (mean, across all concurrent requests) ● Transfer rate: 344.41 [Kbytes/sec] received
  • 10. Instalando CacheFu ● xiru:~ xiru$ ab -c 5 -n 100 http://xiru/ ● Concurrency Level: 5 ● Time taken for tests: 6.83538 seconds ● Complete requests: 100 ● Failed requests: 0 ● Write errors: 0 ● Total transferred: 2022929 bytes ● HTML transferred: 1986569 bytes ● Requests per second: 16.44 [#/sec] (mean) ● Time per request: 304.177 [ms] (mean) ● Time per request: 60.835 [ms] (mean, across all concurrent requests) ● Transfer rate: 324.65 [Kbytes/sec] received
  • 11. Habilitando CacheFu ● xiru:~ xiru$ ab -c 5 -n 100 http://xiru/ ● Concurrency Level: 5 ● Time taken for tests: 2.57365 seconds ● Complete requests: 100 ● Failed requests: 0 ● Write errors: 0 ● Total transferred: 2024900 bytes ● HTML transferred: 1966900 bytes ● Requests per second: 48.61 [#/sec] (mean) ● Time per request: 102.868 [ms] (mean) ● Time per request: 20.574 [ms] (mean, across all concurrent requests) ● Transfer rate: 960.94 [Kbytes/sec] received
  • 12.
  • 13.
  • 14. Regra ContentTypes ● xiru:~ xiru$ ab -c 5 -n 100 http://xiru/ ● Concurrency Level: 5 ● Time taken for tests: 0.158232 seconds ● Complete requests: 100 ● Failed requests: 0 ● Write errors: 0 ● Total transferred: 2026700 bytes ● HTML transferred: 1966900 bytes ● Requests per second: 631.98 [#/sec] (mean) ● Time per request: 7.912 [ms] (mean) ● Time per request: 1.582 [ms] (mean, across all concurrent requests) ● Transfer rate: 12506.95 [Kbytes/sec] received
  • 15.
  • 16.
  • 17.
  • 18. ulimit ● xiru:squid-2.6.STABLE19 root# ulimit -a ● core file size (blocks, -c) 0 ● data seg size (kbytes, -d) 6144 ● file size (blocks, -f) unlimited ● max locked memory (kbytes, -l) unlimited ● max memory size (kbytes, -m) unlimited ● open files (-n) 4096 ● pipe size (512 bytes, -p) 1 ● stack size (kbytes, -s) 8192 ● cpu time (seconds, -t) unlimited ● max user processes (-u) 266 ● virtual memory (kbytes, -v) unlimited
  • 19. ulimit ● xiru:logs root# grep descri cache.log ● 2008/04/18 11:43:22| With 256 file descriptors available ● 2008/04/18 11:59:35| With 256 file descriptors available ● 2008/04/18 12:15:47| WARNING! Your cache is running out of filedescriptors ● 2008/04/18 12:21:22| WARNING! Your cache is running out of filedescriptors ● 2008/04/18 12:24:53| With 4096 file descriptors available
  • 20. 250 Conexões ● xiru:logs root# ab -c 250 -n 10000 http://xiru/ ● Concurrency Level: 250 ● Time taken for tests: 16.539946 seconds ● Complete requests: 10000 ● Failed requests: 0 ● Write errors: 0 ● Total transferred: 202782643 bytes ● HTML transferred: 196789049 bytes ● Requests per second: 604.60 [#/sec] (mean) ● Time per request: 413.499 [ms] (mean) ● Time per request: 1.654 [ms] (mean, across all concurrent requests) ● Transfer rate: 11972.77 [Kbytes/sec] received
  • 21. 500 Conexões ● xiru:logs root# ab -c 500 -n 10000 http://xiru/ ● Concurrency Level: 500 ● Time taken for tests: 17.624794 seconds ● Complete requests: 10000 ● Failed requests: 0 ● Write errors: 0 ● Total transferred: 202889958 bytes ● HTML transferred: 196890973 bytes ● Requests per second: 567.38 [#/sec] (mean) ● Time per request: 881.240 [ms] (mean) ● Time per request: 1.762 [ms] (mean, across all concurrent requests) ● Transfer rate: 11241.78 [Kbytes/sec] received
  • 22. 750 Conexões ● xiru:logs root# ab -c 750 -n 10000 http://xiru/ ● Concurrency Level: 750 ● Time taken for tests: 17.903481 seconds ● Complete requests: 10000 ● Failed requests: 0 ● Write errors: 0 ● Total transferred: 203484669 bytes ● HTML transferred: 197466516 bytes ● Requests per second: 558.55 [#/sec] (mean) ● Time per request: 1342.761 [ms] (mean) ● Time per request: 1.790 [ms] (mean, across all concurrent requests) ● Transfer rate: 11099.24 [Kbytes/sec] received
  • 23.
  • 24. Dicas e Truques ● Invista seu tempo em “debug” de headers HTTP ● Nenhuma aplicação dinâmica terá performance sem cache ● Cache compartilhado sempre será mais rápido do que cache no browser (mas isso nem sempre é possível) ● Use extensões do firefox para auxiliar no seu trabalho – Web Developer, Firebug – YSlow (developer.yahoo.com/yslow)