Drupal Performance Indonesia
-
Upload
ra-wismoyo -
Category
Documents
-
view
263 -
download
6
description
Transcript of Drupal Performance Indonesia
![Page 1: Drupal Performance Indonesia](https://reader035.fdocument.pub/reader035/viewer/2022081421/554ddb10b4c905d10e8b50c1/html5/thumbnails/1.jpg)
Drupal Meetup - Jakarta
Arradi Nur RizalDrupal Performance23 February 2013
![Page 2: Drupal Performance Indonesia](https://reader035.fdocument.pub/reader035/viewer/2022081421/554ddb10b4c905d10e8b50c1/html5/thumbnails/2.jpg)
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
![Page 3: Drupal Performance Indonesia](https://reader035.fdocument.pub/reader035/viewer/2022081421/554ddb10b4c905d10e8b50c1/html5/thumbnails/3.jpg)
Filosofi nya
Performance tuning is a process Tidak ada jalan cepat Setiap site berbeda beda
![Page 4: Drupal Performance Indonesia](https://reader035.fdocument.pub/reader035/viewer/2022081421/554ddb10b4c905d10e8b50c1/html5/thumbnails/4.jpg)
Bagaimana si website itu bekerja?
Ada yang tahu ?
![Page 5: Drupal Performance Indonesia](https://reader035.fdocument.pub/reader035/viewer/2022081421/554ddb10b4c905d10e8b50c1/html5/thumbnails/5.jpg)
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.
![Page 6: Drupal Performance Indonesia](https://reader035.fdocument.pub/reader035/viewer/2022081421/554ddb10b4c905d10e8b50c1/html5/thumbnails/6.jpg)
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?
![Page 7: Drupal Performance Indonesia](https://reader035.fdocument.pub/reader035/viewer/2022081421/554ddb10b4c905d10e8b50c1/html5/thumbnails/7.jpg)
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.
![Page 8: Drupal Performance Indonesia](https://reader035.fdocument.pub/reader035/viewer/2022081421/554ddb10b4c905d10e8b50c1/html5/thumbnails/8.jpg)
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.
![Page 9: Drupal Performance Indonesia](https://reader035.fdocument.pub/reader035/viewer/2022081421/554ddb10b4c905d10e8b50c1/html5/thumbnails/9.jpg)
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)
![Page 10: Drupal Performance Indonesia](https://reader035.fdocument.pub/reader035/viewer/2022081421/554ddb10b4c905d10e8b50c1/html5/thumbnails/10.jpg)
Step 1: Masalahnya dimana si?
Components yang salah konfigurasi Tidak di cache secara default Tahu apa yang sudah di cache
![Page 11: Drupal Performance Indonesia](https://reader035.fdocument.pub/reader035/viewer/2022081421/554ddb10b4c905d10e8b50c1/html5/thumbnails/11.jpg)
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
![Page 12: Drupal Performance Indonesia](https://reader035.fdocument.pub/reader035/viewer/2022081421/554ddb10b4c905d10e8b50c1/html5/thumbnails/12.jpg)
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)
![Page 13: Drupal Performance Indonesia](https://reader035.fdocument.pub/reader035/viewer/2022081421/554ddb10b4c905d10e8b50c1/html5/thumbnails/13.jpg)
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
![Page 14: Drupal Performance Indonesia](https://reader035.fdocument.pub/reader035/viewer/2022081421/554ddb10b4c905d10e8b50c1/html5/thumbnails/14.jpg)
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
![Page 15: Drupal Performance Indonesia](https://reader035.fdocument.pub/reader035/viewer/2022081421/554ddb10b4c905d10e8b50c1/html5/thumbnails/15.jpg)
Step 3: Optimumkan Software
install pressflow jika memakai drupal 6 Gunakan CDNs, reverse proxies dan Slave
database servers Anonymous users jangan mempunyai session.
![Page 16: Drupal Performance Indonesia](https://reader035.fdocument.pub/reader035/viewer/2022081421/554ddb10b4c905d10e8b50c1/html5/thumbnails/16.jpg)
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.
![Page 17: Drupal Performance Indonesia](https://reader035.fdocument.pub/reader035/viewer/2022081421/554ddb10b4c905d10e8b50c1/html5/thumbnails/17.jpg)
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
![Page 18: Drupal Performance Indonesia](https://reader035.fdocument.pub/reader035/viewer/2022081421/554ddb10b4c905d10e8b50c1/html5/thumbnails/18.jpg)
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)
Membaca dari disk/hard disk adalah hal yang memberatkan performance website.
![Page 19: Drupal Performance Indonesia](https://reader035.fdocument.pub/reader035/viewer/2022081421/554ddb10b4c905d10e8b50c1/html5/thumbnails/19.jpg)
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
![Page 20: Drupal Performance Indonesia](https://reader035.fdocument.pub/reader035/viewer/2022081421/554ddb10b4c905d10e8b50c1/html5/thumbnails/20.jpg)
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
![Page 21: Drupal Performance Indonesia](https://reader035.fdocument.pub/reader035/viewer/2022081421/554ddb10b4c905d10e8b50c1/html5/thumbnails/21.jpg)
Step 4: Tambah software
varnish - silly fast reverse-proxy cache - berada di depan apache - server menggunakan images, static files dan
anonymous page dari memory.
![Page 22: Drupal Performance Indonesia](https://reader035.fdocument.pub/reader035/viewer/2022081421/554ddb10b4c905d10e8b50c1/html5/thumbnails/22.jpg)
Pertanyaan ?
Untuk lebih detail, bisa meminta workshop tambahan :)