SlideShare a Scribd company logo
1 of 23
Drupal Meetup - Jakarta



      Arradi Nur Rizal
    Drupal Performance
     23 February 2013
Biasanya komentar yang ada

    Drupal lambat

    Kalau memory nya kurang di tambahin

    Jgn pakai CCK/views/Panels dll

    Kalau kamu tdk install x, bakal lambat dll

    Perlu Multiple servers

    Harus ada mysql slave server

    Pakai ada Varnish. Masalah bakal beres
Filosofi nya

    Performance tuning is a process

    Tidak ada jalan cepat

    Setiap site berbeda beda
Bagaimana si website itu bekerja?

    Ada yang tahu ?
Step 0: Evaluasi
−   Catat performance sebelum instalasi module atau
    penambahan feature
−   Catat performance setelah instalasi module atau
    feature.
−   Catat penggunakan memory
−   tips: use tag performance in issue queue untuk
    evaluasi suatu module.
Step 1: Masalahnya dimana si?

    Kapan terjadinya?
    −   Di semua halaman? anonymous user dan/atau
        authenticated user?
    −   Hanya ketika menyimpan konten ? Hanya ketika
        login?
    −   Ketika loadnya besar? Terjadi secara acak dalam
        satu hari?
Step 1: Masalahnya dimana si?

    Kapan mulai terjadi kelambatan?
    −   Hindari perasaan “sepertinya lebih cepat/lambat”
    −   Catat data performance
    −   Catat dan simpan log dari setiap update/upgrade.
Step 1: Masalahnya dimana si?

    Siapa/apa yang musti disalahkan?
    −   Tes semua feature yang sudah di
        implementasikan satu per satu untuk mencari
        masalah.
    −   Catat perubahan infrastruktur. Seperti perubahan
        permission di hosting.
Step 1: Masalahnya dimana si?

    Dimana masalahnya terjadi ?
    −   page building modules (views and panels)
    −   external web services (user logins, Any 3rd-party
        integration)
    −   Kerumitan website (jumlah modules, views di
        dalam panels di dalam panels)
Step 1: Masalahnya dimana si?

    Components yang salah konfigurasi
    −   Tidak di cache secara default
    −   Tahu apa yang sudah di cache
Step 1: Masalahnya dimana si?

    Gunakan devel module
    −   Query log. Untuk mengecek query log
        
            Contoh: Cek apa ada query yang sama di eksekusi
            dalam satu halaman
    −   Xhprof. Untuk analisa fungsi2. Akan menunjukan
        fungsi mana yang memakan waktu yang lama
Step 1: Masalahnya dimana

    Biasanya ada di

     - statistic module (matikan), pakai google
    analytics

     - tracker module (matikan), use tracker 2

     - XMLSitemap (matikan 1.x branch)

      - Nodewords (), meta tag nya di digunakan
    di theme atau mengunakan page alter

     - user relationship module,

      - any kind of access control modules (OG,
    taxonomy access control)
Step 2: Gunakan Caching
−   component level caching
    
        Paling bagus untuk authenticated user
    
        stores-userfacing components
−   page-level caching
    
        Cache yang paling mungkin/gampang
    
        Hanya untuk anonymous users
    
        Disimpan dalam format full HTML
    
        Tips: set sangat rendah, 1 minute
Step 2: Gunakan Caching

    Gunakan block caching
    −   Akan dimatikan oleh node access
    −   Performa paling baik untuk for authenticated users
    −   Jika ada perubahan konten, block dan page cache
        akan di hapus.
    −   Gunakan "minimum cache lifetime"

    Gunakan expiration of cached pages

    Gunakan aggregation/ compression hanya di
    production
Step 3: Optimumkan Software

    install pressflow jika memakai drupal 6

    Gunakan CDNs, reverse proxies dan Slave
    database servers

    Anonymous users jangan mempunyai session.
Step 3: Optimumkan Software
                  (PHP)

    install APC (Another PHP Cache), kurangi disk
    access (terutama di cloud servers)ketika
    mengkompilasi PHP files

    Simpan file PHP yang sudah di kompilasi di
    memory.

    Di php.ini gunakan shm_size = 128M supaya
    drupal cukup di dalam cache

    apc.php akan memberikan statistic pengunaan
    apc. Anda ingin 99% hit rate. Karena itu berarti
    anda 99% tidak membaca dari disk.
Step 3: Optimumkan Software
                  (MySQL)

    Gunakan database slaves

    "Lindungi" the Master database dari queries sebisa mungkin.

    Nyalakan query caching dan innoDB buffers (default in D7)

    Tools untuk mengecek
    −   mysqltuner.pl
    −   launchpad.net/mysql-tuning-primer

    Tips
    −   myisam, best in read
    −   innodb_ best in insert, update.
    −   module db_tunner
Step 3: Optimumkan Software
                  (Apache)

    Prefork* vs Worker

    FastCGI vs mod_php*

    .htaccss vs Virtual Host entries

    KeepAlive On of Off

    Disable "unneded modules"

    calculate MaxClients
    −   MaxClients * httpd size = Penggunaan Memory
    −   httpd size = Jumlah memory yang digunakan
        untuk menjalankan drupal (lebih banyak modules,
        lebih besar ukuran httpd size)
Step 4: Tambah software

    Tambah memcached

    - Semua caches tables and sessions disimpan di dalam
    memory.

    - Halaman untuk Anonymous user akan di ambil dari
    memory dengan page cache enabled

    - Akan menaruh semua cache table di dalam memory

    - Beri ruang yang luas untuk berkembang. 128MB
    sebagai permulaan

    Cek memcache.php


    Cari memcache.php dengan cara find / -name
    memcache.php
Step 4: Tambah software

    apache solr

    - search menggunakan banyak cpu

    - Menggunakan tomcat sebagai host

    - Membutuhkan process cpu yang besar, tetap
    menggunakan memory yang rendah. Coba
    taruh di mesin yang berbeda.

    Module: apachesolr, search_api
Step 4: Tambah software

    varnish

    - silly fast reverse-proxy cache

    - berada di depan apache

    - server menggunakan images, static files dan
    anonymous page dari memory.
Pertanyaan ?

    Untuk lebih detail, bisa meminta workshop
    tambahan :)
Contact

    anrizal@gmail.com

    @arradirizal

    Www.arradi.com

    Www.anrizal.com

More Related Content

Featured

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Drupal Performance Indonesia

  • 1. Drupal Meetup - Jakarta Arradi Nur Rizal Drupal Performance 23 February 2013
  • 2. Biasanya komentar yang ada  Drupal lambat  Kalau memory nya kurang di tambahin  Jgn pakai CCK/views/Panels dll  Kalau kamu tdk install x, bakal lambat dll  Perlu Multiple servers  Harus ada mysql slave server  Pakai ada Varnish. Masalah bakal beres
  • 3. Filosofi nya  Performance tuning is a process  Tidak ada jalan cepat  Setiap site berbeda beda
  • 4. Bagaimana si website itu bekerja?  Ada yang tahu ?
  • 5. Step 0: Evaluasi − Catat performance sebelum instalasi module atau penambahan feature − Catat performance setelah instalasi module atau feature. − Catat penggunakan memory − tips: use tag performance in issue queue untuk evaluasi suatu module.
  • 6. Step 1: Masalahnya dimana si?  Kapan terjadinya? − Di semua halaman? anonymous user dan/atau authenticated user? − Hanya ketika menyimpan konten ? Hanya ketika login? − Ketika loadnya besar? Terjadi secara acak dalam satu hari?
  • 7. Step 1: Masalahnya dimana si?  Kapan mulai terjadi kelambatan? − Hindari perasaan “sepertinya lebih cepat/lambat” − Catat data performance − Catat dan simpan log dari setiap update/upgrade.
  • 8. Step 1: Masalahnya dimana si?  Siapa/apa yang musti disalahkan? − Tes semua feature yang sudah di implementasikan satu per satu untuk mencari masalah. − Catat perubahan infrastruktur. Seperti perubahan permission di hosting.
  • 9. Step 1: Masalahnya dimana si?  Dimana masalahnya terjadi ? − page building modules (views and panels) − external web services (user logins, Any 3rd-party integration) − Kerumitan website (jumlah modules, views di dalam panels di dalam panels)
  • 10. Step 1: Masalahnya dimana si?  Components yang salah konfigurasi − Tidak di cache secara default − Tahu apa yang sudah di cache
  • 11. Step 1: Masalahnya dimana si?  Gunakan devel module − Query log. Untuk mengecek query log  Contoh: Cek apa ada query yang sama di eksekusi dalam satu halaman − Xhprof. Untuk analisa fungsi2. Akan menunjukan fungsi mana yang memakan waktu yang lama
  • 12. Step 1: Masalahnya dimana  Biasanya ada di  - statistic module (matikan), pakai google analytics  - tracker module (matikan), use tracker 2  - XMLSitemap (matikan 1.x branch)  - Nodewords (), meta tag nya di digunakan di theme atau mengunakan page alter  - user relationship module,  - any kind of access control modules (OG, taxonomy access control)
  • 13. Step 2: Gunakan Caching − component level caching  Paling bagus untuk authenticated user  stores-userfacing components − page-level caching  Cache yang paling mungkin/gampang  Hanya untuk anonymous users  Disimpan dalam format full HTML  Tips: set sangat rendah, 1 minute
  • 14. Step 2: Gunakan Caching  Gunakan block caching − Akan dimatikan oleh node access − Performa paling baik untuk for authenticated users − Jika ada perubahan konten, block dan page cache akan di hapus. − Gunakan "minimum cache lifetime"  Gunakan expiration of cached pages  Gunakan aggregation/ compression hanya di production
  • 15. Step 3: Optimumkan Software  install pressflow jika memakai drupal 6  Gunakan CDNs, reverse proxies dan Slave database servers  Anonymous users jangan mempunyai session.
  • 16. Step 3: Optimumkan Software (PHP)  install APC (Another PHP Cache), kurangi disk access (terutama di cloud servers)ketika mengkompilasi PHP files  Simpan file PHP yang sudah di kompilasi di memory.  Di php.ini gunakan shm_size = 128M supaya drupal cukup di dalam cache  apc.php akan memberikan statistic pengunaan apc. Anda ingin 99% hit rate. Karena itu berarti anda 99% tidak membaca dari disk.
  • 17. Step 3: Optimumkan Software (MySQL)  Gunakan database slaves  "Lindungi" the Master database dari queries sebisa mungkin.  Nyalakan query caching dan innoDB buffers (default in D7)  Tools untuk mengecek − mysqltuner.pl − launchpad.net/mysql-tuning-primer  Tips − myisam, best in read − innodb_ best in insert, update. − module db_tunner
  • 18. Step 3: Optimumkan Software (Apache)  Prefork* vs Worker  FastCGI vs mod_php*  .htaccss vs Virtual Host entries  KeepAlive On of Off  Disable "unneded modules"  calculate MaxClients − MaxClients * httpd size = Penggunaan Memory − httpd size = Jumlah memory yang digunakan untuk menjalankan drupal (lebih banyak modules, lebih besar ukuran httpd size)
  • 19. Step 4: Tambah software  Tambah memcached  - Semua caches tables and sessions disimpan di dalam memory.  - Halaman untuk Anonymous user akan di ambil dari memory dengan page cache enabled  - Akan menaruh semua cache table di dalam memory  - Beri ruang yang luas untuk berkembang. 128MB sebagai permulaan  Cek memcache.php  Cari memcache.php dengan cara find / -name memcache.php
  • 20. Step 4: Tambah software  apache solr  - search menggunakan banyak cpu  - Menggunakan tomcat sebagai host  - Membutuhkan process cpu yang besar, tetap menggunakan memory yang rendah. Coba taruh di mesin yang berbeda.  Module: apachesolr, search_api
  • 21. Step 4: Tambah software  varnish  - silly fast reverse-proxy cache  - berada di depan apache  - server menggunakan images, static files dan anonymous page dari memory.
  • 22. Pertanyaan ?  Untuk lebih detail, bisa meminta workshop tambahan :)
  • 23. Contact  anrizal@gmail.com  @arradirizal  Www.arradi.com  Www.anrizal.com