1. Halo Guest, pastikan Anda selalu menaati peraturan forum sebelum mengirimkan post atau thread baru.

VPS: Test kecepatan Server Apache VS Varnish VS Nginx

Discussion in 'Hosting & Domain' started by ewwink, Jan 20, 2013.

  1. ewwink

    ewwink Super Hero

    Joined:
    Apr 27, 2006
    Messages:
    2,836
    Likes Received:
    1,100
    Location:
    Tasikmalaya, Sunda, Indonesia
    bosen juga maen auto2an di shared hosting kena suspend terus karena melebihi resource limit yg ditetapkan akhirnya bikin sendiri webserver di VPS tp permasalahannya ternyata server Apache lambat dibanding hosting yg biasa dipakai (Litespeed server) dan setelah diperhitungkan ane install aja Reverse proxy + cache (Nginx + Varnish) di depan Apache dan berikut hasil benchmarknya,

    Spesifikasi Tes
    - Processor 1 Core
    - Memory 768mb
    - OS centos 6.3 64 bit
    - Apache 2.2.15
    - varnish 3.0.3
    - Nginx 1.2.6
    - membuka Worpress sebanyak 1000 kali di localhost

    Apache sajah perintah: ab -n 1000 -c 2 http://localhost:8080
    Time taken for tests: 197.883 seconds
    Total transferred: 283000 bytes
    HTML transferred: 0 bytes
    Requests per second: 5.05 [#/sec] (mean)
    Time per request: 395.765 [ms] (mean)
    Time per request: 197.883 [ms] (mean, across
    Transfer rate: 1.40 [Kbytes/sec] received

    varnish -> Apache perintah: ab -n 1000 -c 2 http://localhost:6081
    Time taken for tests: 0.202 seconds
    Total transferred: 362990 bytes
    HTML transferred: 0 bytes
    Requests per second: 1834.67 [#/sec] (mean)
    Time per request: 1.090 [ms] (mean)
    Time per request: 0.202 [ms] (mean, across all
    Transfer rate: 650.36 [Kbytes/sec] received

    Update: konnfigurasi dibawah tidak efeftif klo mau pake Nginx pasangannya FastCgi-cache
    Nginx -> varnish -> Apache perintah: ab -n 1000 -c 2 http://localhost:80
    Time taken for tests: 0.562 seconds
    Total transferred: 41781000 bytes
    HTML transferred: 41425000 bytes
    Requests per second: 1780.20 [#/sec] (mean)
    Time per request: 1.123 [ms] (mean)
    Time per request: 0.562 [ms] (mean, across all concurrent requests)
    Transfer rate: 72635.37 [Kbytes/sec] received


    dari data diatas dapat disimpulkan bahwa reverse proxy saat ini sangat perlu untuk webserver dan buat penggemar auto2an silahkan coba untuk buat server sendiri di VPS dengan menggunakan reverse proxy + cache hehe....
     
    Last edited: Mar 9, 2013
  2. GentZu AoZora

    GentZu AoZora Forbidden

    Joined:
    Nov 28, 2010
    Messages:
    2,932
    Likes Received:
    275
    Location:
    Bandung City
    ab: invalid URL
    Usage: ab [options] [http://]hostname[:port]/path
    Options are:
    -n requests Number of requests to perform
    -c concurrency Number of multiple requests to make
    -t timelimit Seconds to max. wait for responses
    -b windowsize Size of TCP send/receive buffer, in bytes
    -p postfile File containing data to POST. Remember also to set -T
    -u putfile File containing data to PUT. Remember also to set -T
    -T content-type Content-type header for POSTing, eg.
    'application/x-www-form-urlencoded'
    Default is 'text/plain'
    -v verbosity How much troubleshooting info to print
    -w Print out results in HTML tables
    -i Use HEAD instead of GET
    -x attributes String to insert as table attributes
    -y attributes String to insert as tr attributes
    -z attributes String to insert as td or th attributes
    -C attribute Add cookie, eg. 'Apache=1234. (repeatable)
    -H attribute Add Arbitrary header line, eg. 'Accept-Encoding: gzip'
    Inserted after all normal header lines. (repeatable)
    -A attribute Add Basic WWW Authentication, the attributes
    are a colon separated username and password.
    -P attribute Add Basic Proxy Authentication, the attributes
    are a colon separated username and password.
    -X proxy:port Proxyserver and port number to use
    -V Print version number and exit
    -k Use HTTP KeepAlive feature
    -d Do not show percentiles served table.
    -S Do not show confidence estimators and warnings.
    -g filename Output collected data to gnuplot format file.
    -e filename Output CSV file with percentages served
    -r Don't exit on socket receive errors.
    -h Display usage information (this message)
    -Z ciphersuite Specify SSL/TLS cipher suite (See openssl ciphers)
    -f protocol Specify SSL/TLS protocol (SSL2, SSL3, TLS1, or ALL)

    ane pakek nginx to apache, pingin ngetes...
     
  3. unregistered000

    unregistered000 Hero

    Joined:
    Mar 1, 2012
    Messages:
    607
    Likes Received:
    71
    sininya bukan penggemar auto auto an om :komunis:
     
  4. panjilesmana

    panjilesmana Pituin Sunda

    Joined:
    Nov 12, 2009
    Messages:
    1,281
    Likes Received:
    47
    Location:
    Depok
    Iyah shared host bikin gak tenang aja, dikit-dikit suspend apalagi kata CS nya (HG) dia akan terus mantau akun kita. Disamping ituh juga inodes nya cepet banget nambah, alhasil ngak ada support back up lagi.
     
  5. ewwink

    ewwink Super Hero

    Joined:
    Apr 27, 2006
    Messages:
    2,836
    Likes Received:
    1,100
    Location:
    Tasikmalaya, Sunda, Indonesia
  6. GentZu AoZora

    GentZu AoZora Forbidden

    Joined:
    Nov 28, 2010
    Messages:
    2,932
    Likes Received:
    275
    Location:
    Bandung City
    This is ApacheBench, Version 2.3 <$Revision: 655654 $>
    Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
    Licensed to The Apache Software Foundation, http://www.apache.org/

    Benchmarking localhost (be patient)
    apr_socket_recv: Connection refused (111)
     
  7. fikrionline

    fikrionline PASTI SUKSES

    Joined:
    Jan 2, 2010
    Messages:
    1,355
    Likes Received:
    146
    Location:
    Indonesia
    Pernah punya pengalaman seperti ini prihal nginx (Mohon maaf kalau agak OOT) :)

    CentOS + Nginx + PHP-FPM + APC + MySQL + Wordpress + W3-Total-Cache (Page cache ke disk enhanced, minify ke disk basic, database & object cache ke OPCode APC) = Sangat minim resource, load cepet. Tapi ya gitu, tiap 24 jam (Kadang lebih kadang kurang) server stop sendiri, harus restart server baru bisa normal. Pernah coba setting cronjob agar otomatis restart server tiap beberapa jam sekali ternyata belum efektif karena masih sering macet sendiri. Sampai sekarang masih penasaran mana yang salah, tapi belum ketemu juga.

    CentOS + Nginx + PHP-FPM + Memcache + MySQL + Wordpress + W3-Total-Cache (Page cache ke disk enhanced, minify ke disk basic, database & object cache ke Memcache) = Load sama cepatnya saat menggunakan APC tetapi penggunaan memory membengkak karena dipakai cache. Yang jadi masalah, ketika penggunaan memory sudah full, beberapa kali server macet dan tidak lagi memproses request. Harus restart OS agar bisa kembali normal, karena restast server saja belum bisa memberikan solusi.

    Pernah juga gabung kombinasi APC & Memcache dipakai bersama-sama, dengan mencoba beberapa kali setting pada bagian W3 Total Cache. Awal-awal memang bagus, tetapi selang beberapa hari server malah tidak jalan sama sekali. Belum ketemu mana settingan yang salah. Coba lihat-lihat file log tapi masih belum menemukan solusi.

    Terakhir, coba tanpa APC, tanpa Memcache dan tanpa W3 Total Cache, hanya optimasi file static pada konfigurasi nginx. Alhamdulillah sampai saat ini hampir tidak pernah bermasalah. Hanya saja untuk proses memang butuh core processor yang tangguh karena tidak pakai cache.

    Untuk varnish belum pernah coba, sebab lihat contoh setting untuk wordpress saja sudah pusing. Untuk apache no comment, karena memang jarang sekali pakai, sudah jatuh cinta pada nginx soalnya :D

    Ohya, yg saya pakai CentOS 5.8 32bit :)
     
  8. ewwink

    ewwink Super Hero

    Joined:
    Apr 27, 2006
    Messages:
    2,836
    Likes Received:
    1,100
    Location:
    Tasikmalaya, Sunda, Indonesia
    berarti servernya bukan localhost coba 127.0.0.1 atau cari dengan mengetik: ifconfig -a

    ane pake suphp jadi ga bisa pake APC atau php accelerator lainnya, klo untuk varnish 3.0.3 (juga nginx) sebagai reverse proxy ga perlu setingan khusus buat wordpress. enaknya pake varnish ga perlu lagi cache plugin (static cache) untuk wp sehigga proses PHP pun lebih cepat daripada pake pake plugin.
     
  9. mp3online

    mp3online Super Hero

    Joined:
    Jul 19, 2011
    Messages:
    2,228
    Likes Received:
    294
    Location:
    jakarta
    gak salah kamar ini om?
    kayaknya yg cocok di kamar hosting deh :)
     
  10. GentZu AoZora

    GentZu AoZora Forbidden

    Joined:
    Nov 28, 2010
    Messages:
    2,932
    Likes Received:
    275
    Location:
    Bandung City
    masih gaj bisa...
    di cobain ke ip/webnya langsung juga gak bisa...
    ane pakek kloxo...
     
  11. SKIZOID

    SKIZOID Newbie Abadi

    Joined:
    Jan 12, 2012
    Messages:
    1,248
    Likes Received:
    56
    Location:
    jawadwipa
    wah om mod kalo dibikinin tutorialnya pasti bermanfaat banget tuh.....
     
  12. antotok

    antotok Hero

    Joined:
    Sep 10, 2011
    Messages:
    504
    Likes Received:
    12
    Location:
    www
    Jadinya pakai yang mana mod Apache sajah / varnish -> Apache / Nginx -> varnish -> Apache

    TQ
     
  13. ewwink

    ewwink Super Hero

    Joined:
    Apr 27, 2006
    Messages:
    2,836
    Likes Received:
    1,100
    Location:
    Tasikmalaya, Sunda, Indonesia
    varnish + apache atau Nginx + FastCgi-cache lebih cepat hingga 4 kali lipat tapi rumit settingnya
     
    antotok likes this.
  14. fikrionline

    fikrionline PASTI SUKSES

    Joined:
    Jan 2, 2010
    Messages:
    1,355
    Likes Received:
    146
    Location:
    Indonesia
    Boleh minta contoh isi file nginx.conf (atau file setting lain) nya mastah, buat study banding? #ngarep banget :)
     
  15. elroses

    elroses Hero

    Joined:
    Sep 14, 2012
    Messages:
    513
    Likes Received:
    171
    Location:
    Tasikmalaya
    pusing juga ya bedain nya >.<
     
  16. Beraaga007

    Beraaga007 Newbie

    Joined:
    Feb 23, 2012
    Messages:
    3
    Likes Received:
    0
    ini apa cuma bisa buat localhost doang? kalau misal kita launch abnya di server lain, dan pointernya keserver target buat test itu bisa ga?
    contoh server 1 itu yg ngelakuin, server 2 itu jadi targetnya
     
  17. aldhy

    aldhy Hosting Group _ ▂ ▃ ▅ ▆ █

    Joined:
    Mar 17, 2013
    Messages:
    1,731
    Likes Received:
    104
    Location:
    Cirebon
    bisa ko, :)
     
  18. yunie12

    yunie12 Newbie

    Joined:
    Apr 2, 2015
    Messages:
    17
    Likes Received:
    0
    Location:
    Rumah
    pengen belajar lebih jauh tentang VPS ini :)
     
  19. mp3online

    mp3online Super Hero

    Joined:
    Jul 19, 2011
    Messages:
    2,228
    Likes Received:
    294
    Location:
    jakarta
    punyaku nginx + fastcgi-cache, kalo size cachenya udah di atas 10 gb kok situsku jd blank ya?
    di error log errornya disk full, pdhal free space nya msh banyak. kira2 salah di mana ya?
     
  20. vpswebs

    vpswebs Newbie

    Joined:
    Apr 11, 2015
    Messages:
    29
    Likes Received:
    1
    Location:
    Jakarta
    Cara Test nya gmn om ?? 8-}
     

Share This Page