Kasım 21, 2008, 05:35:55 ÖS *
Merhaba, Ziyaretçi. Lütfen giriş yapın veya üye olun.

Kullanıcı adınızı, parolanızı ve aktif kalma süresini giriniz
 
   Ana Sayfa   Yardım Ara Giriş Yap Kayıt  
Sayfa: [1]
  Yazdır  
Gönderen Konu: ApacheBench with Mod_GZip, Mod_Deflate  (Okunma Sayısı 288 defa)
Fesih
Yönetici
*****
Mesaj Sayısı: 414


Üyelik Bilgileri
« : Mayıs 04, 2007, 03:26:34 ÖS »

ApacheBench is one of the most common programs used to benchmark web servers.
By default apachebench will run using HTTP/1.0 requests and without compression enabled even if the tested server supports that.

For example:

Kod:

ab -n 1 -v 4 “http://www.netlojik.net/”
This is ApacheBench, Version 2.0.41-dev <$Revision: 1.141 $> apache-2.0
Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/
Benchmarking www.netlojik.net (be patient)…
INFO: POST header ==

GET / HTTP/1.0
User-Agent: ApacheBench/2.0.41-dev
Host: www.netlojik.net
Accept: */*

LOG: header received:
HTTP/1.1 200 OK
Date: Fri, 27 Oct 2006 21:55:53 GMT
Server: Apache
Status: 200 OK
Connection: close
Content-Type: text/html; charset=UTF-8

Now this might be ok, but if compression is enabled on the server (mod_gzip or deflate depending from the web server version you are running) then the results of the benchmark will not use this because the client (ab) will not advertise itself supporting any compression method. If you want to do this then you only have to add the following parameter to the ab command:
-H “Accept-Encoding: gzip,deflate”
and if the remote server supports any compression method, either mod_gzip (apache1) or mod_deflate (apache2) then it will be used. This allows us to run benchmarks with and without compression and evaluate the difference in the results.

Kod:

ab -n 1 -v 4 -H “Accept-Encoding: gzip,deflate” “http://www.netlojik.net/”
This is ApacheBench, Version 2.0.41-dev <$Revision: 1.141 $> apache-2.0
Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/
Benchmarking www.netlojik.net (be patient)…
INFO: POST header ==

GET / HTTP/1.0
User-Agent: ApacheBench/2.0.41-dev
Host: www.netlojik.net
Accept: */*
Accept-Encoding: gzip,deflate

LOG: header received:
HTTP/1.1 200 OK
Date: Sat, 28 Oct 2006 09:27:25 GMT
Server: Apache
Status: 200 OK
Content-Encoding: gzip
Vary: Accept-Encoding
Connection: close
Content-Type: text/html; charset=UTF-8

As you can see in the above example compression is used in this benchmark run.
If needed you can also use just the individual compression method by adding the parameter:
-H “Accept-Encoding: gzip” for mod_gzip or
-H “Accept-Encoding: deflate” for mod_deflate.

The apache logs for each of the above tests look like this:

  • Alıntı
    The first run without any compression:
    [28/Oct/2006:00:57:34 +0300] "GET / HTTP/1.0" 200 61424 “-” “ApacheBench/2.0.41-dev”
  • Alıntı
    Second run with compression enabled:
    [28/Oct/2006:00:59:13 +0300] "GET / HTTP/1.0" 200 12905 “-” “ApacheBench/2.0.41-dev”
Logged
Sayfa: [1]
  Yazdır  
 

Ahtapot 2
Bu Sayfa 0.258 Saniyede 17 Sorgu ile Oluşturuldu

Kasım 19, 2008, 06:09:28 ÖS