benchmark

  • apache

    The acronym LAMP refers to a solution stack of software, usually free and open source software, used to run dynamic Web sites or servers. It stand for:

    • Linux, for the operating system;
    • Apache, the Web server;
    • MySQL, the database management system (or database server);
    • Perl, Python, and PHP, the programming languages.

    &160;ab is a tool for benchmarking your Apache Hypertext Transfer Protocol (HTTP) server. It is designed to give you an impression of how your current Apache installation performs. This especially shows you how many requests per second your Apache installation is capable of serving.
    Apache-utils package contains utility programs for webservers and some add-on programs useful for any webserver. These include:

    • ab (Apache benchmark tool)
    • Logresolve (Resolve IP addresses to hostname in logfiles)
    • htpasswd (Manipulate basic authentication files)
    • htdigest (Manipulate digest authentication files)
    • dbmmanage (Manipulate basic authentication files in DBM format, using perl)
    • htdbm (Manipulate basic authentication files in DBM format, using APR)
    • rotatelogs (Periodically stop writing to a logfile and open a new one)
    • split-logfile (Split a single log including multiple vhosts)
    • checkgid (Checks whether the caller can setgid to the specified group)
    • check_forensic (Extract mod_log_forensic output from apache log files)

    This package Apache-Utils can be install through apt or YaST depending if you are using a Debian base distro or OpenSuse

    Prerequistes

    • Define realistic objectives, do not create too much virtual clients if you do not have usually that kind of user traffic..
    • For example an objective could be: number of users served, or percentage of the requests served within a certain time
    • This tool ab do not simulate realistic user behavior, it just hit a page without being able to simulate a complex workflow (like login, navigate and do things users usually do)
    • Try to monitor at the same time the CPU/Memory consumed in order not to make false assumption on apache settings (use top d 1)

    Attention

    It is an iterative process!

    1. Benchmark,
    2. Change settings and
    3. Restart benchmark.

    It is very important to only change a setting a time in order to better identify what is really bringing something! By changing only one settings at a time, you can:

    • Better see the influence on CPU, memory (you must look also at resources, a server swapping to disk is never good)
    • There is not so much universal settings bringing a speed kick (except DNSlookup off, keep alive small), some settings are depending on your Linux kernel version, CPU class, disk speed, network latency

    Other components

    mysql While tuning apache, you will see that most of the time is used in PHP/MySQL, for MySQL recommend to run at the same time tuning-primer.sh, read more here


    Usage

    ab [ -A auth-username:password ] [ -c concurrency ] [ -C cookie-name=value ] [ -d ] [ -e csv-file ] [ -g gnuplot-file ] [ -h ] [ -H custom-header ] [ -i ] [ -k ] [ -n requests ] [ -p POST-file ] [ -P proxy-auth-username:password ] [ -q ] [ -s ] [ -S ] [ -t timelimit ] [ -T content-type ] [ -v verbosity] [ -V ] [ -w ] [ -x <table>-attributes ] [ -X proxy[:port] ] [ -y <tr>-attributes ] [ -z <td>-attributes ] [http://]hostname[:port]/path

    Options

    -A auth-username:password
    Supply BASIC Authentication credentials to the server. The username and password are separated by a single : and sent on the wire base64 encoded. The string is sent regardless of whether the server needs it (i.e., has sent an 401 authentication needed).
    -c concurrency
    Number of multiple requests to perform at a time. Default is one request at a time.
    -C cookie-name=value
    Add a Cookie: line to the request. The argument is typically in the form of a name=value pair. This field is repeatable.
    -d
    Do not display the "percentage served within XX [ms] table". (legacy support).
    -e csv-file
    Write a Comma separated value (CSV) file which contains for each percentage (from 1% to 100%) the time (in milliseconds) it took to serve that percentage of the requests. This is usually more useful than the 'gnuplot' file; as the results are already 'binned'.
    -g gnuplot-file
    Write all measured values out as a 'gnuplot' or TSV (Tab separate values) file. This file can easily be imported into packages like Gnuplot, IDL, Mathematica, Igor or even Excel. The labels are on the first line of the file.
    -h
    Display usage information.
    -H custom-header
    Append extra headers to the request. The argument is typically in the form of a valid header line, containing a colon-separated field-value pair (i.e., "Accept-Encoding: zip/zop;8bit").
    -i
    Do HEAD requests instead of GET.
    -k
    Enable the HTTP KeepAlive feature, i.e., perform multiple requests within one HTTP session. Default is no KeepAlive.
    -n requests
    Number of requests to perform for the benchmarking session. The default is to just perform a single request which usually leads to non-representative benchmarking results.
    -p POST-file
    File containing data to POST.
    -P proxy-auth-username:password
    Supply BASIC Authentication credentials to a proxy en-route. The username and password are separated by a single : and sent on the wire base64 encoded. The string is sent regardless of whether the proxy needs it (i.e., has sent an 407 proxy authentication needed).
    -q
    When processing more than 150 requests, ab outputs a progress count on stderr every 10% or 100 requests or so. The -q flag will suppress these messages.
    -s
    When compiled in (ab -h will show you) use the SSL protected https rather than the http protocol. This feature is experimental and very rudimentary. You probably do not want to use it.
    -S
    Do not display the median and standard deviation values, nor display the warning/error messages when the average and median are more than one or two times the standard deviation apart. And default to the min/avg/max values. (legacy support).
    -t timelimit
    Maximum number of seconds to spend for benchmarking. This implies a -n 50000 internally. Use this to benchmark the server within a fixed total amount of time. Per default there is no timelimit.
    -T content-type
    Content-type header to use for POST data.
    -v verbosity
    Set verbosity level - 4 and above prints information on headers, 3 and above prints response codes (404, 200, etc.), 2 and above prints warnings and info.
    -V
    Display version number and exit.
    -w
    Print out results in HTML tables. Default table is two columns wide, with a white background.
    -x <table>-attributes
    String to use as attributes for <table>. Attributes are inserted <table here >.
    -X proxy[:port]
    Use a proxy server for the requests.
    -y <tr>-attributes
    String to use as attributes for <tr>.
    -z <td>-attributes
    String to use as attributes for <td>.


    Some real examples

    time /usr/sbin/ab2 -n 500 -c 30 http://www.waltercedric.com
    This will make 500 requests on them and hammering localhost for 30 seconds

    After tuning Before tuning
    Benchmarking www.waltercedric.comCompleted 100 requests
    Completed 200 requests
    Completed 300 requests
    Completed 400 requests
    Finished 500 requests
    Server Software:&160;&160;&160;&160;&160;&160;&160; NOYB
    Server Hostname:&160;&160;&160;&160;&160;&160;&160; www.waltercedric.com
    Server Port:&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160; 80
    Document Path:&160;&160;&160;&160;&160;&160;&160;&160;&160; /index.php
    Document Length:&160;&160;&160;&160;&160;&160;&160; 45532 bytes
    Concurrency Level:&160;&160;&160;&160;&160; 30
    Time taken for tests:&160;&160; 38.576375 seconds
    Complete requests:&160;&160;&160;&160;&160; 500
    Failed requests:&160;&160;&160;&160;&160;&160;&160; 19&160;
    &160;&160; (Connect: 0, Length: 19, Exceptions: 0)
    Write errors:&160;&160;&160;&160;&160;&160;&160;&160;&160;&160; 0
    Total transferred:&160;&160;&160;&160;&160; 23000106 bytes
    HTML transferred:&160;&160;&160;&160;&160;&160; 22762106 bytes
    Requests per second:&160;&160;&160; 12.96 [#/sec] (mean)
    Time per request:&160;&160;&160;&160;&160;&160; 2314.582 [ms] (mean)
    Time per request:&160;&160;&160;&160;&160;&160; 77.153 [ms] (mean, across all concurrent requests)
    Transfer rate:&160;&160;&160;&160;&160;&160;&160;&160;&160; 582.25 [Kbytes/sec] received
    Connection Times (ms)
    &160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160; min&160; mean[+/-sd] median&160;&160; max
    Connect:&160;&160;&160;&160;&160;&160;&160; 0&160;&160;&160; 8&160; 36.9&160;&160;&160;&160;&160; 0&160;&160;&160;&160; 207
    Processing:&160;&160; 394 2239 345.3&160;&160; 2237&160;&160;&160; 6223
    Waiting:&160;&160;&160;&160;&160; 379 2197 340.9&160;&160; 2190&160;&160;&160; 6173
    Total:&160;&160;&160;&160;&160;&160;&160; 397 2247 344.2&160;&160; 2239&160;&160;&160; 6223
    Percentage of the requests served within a certain time (ms)
    &160; 50%&160;&160; 2239
    &160; 66%&160;&160; 2294
    &160; 75%&160;&160; 2327
    &160; 80%&160;&160; 2357
    &160; 90%&160;&160; 2457
    &160; 95%&160;&160; 2560
    &160; 98%&160;&160; 2973
    &160; 99%&160;&160; 3341
    100%&160;&160; 6223 (longest request)
    real&160;&160;&160; 0m38.617s
    user&160;&160;&160; 0m0.024s
    sys&160;&160;&160;&160; 0m0.240s

    Benchmarking www.waltercedric.com
    Completed 100 requests
    Completed 200 requests
    Completed 300 requests
    Completed 400 requests
    Finished 500 requests

    Server Software:&160;&160;&160;&160;&160;&160;&160; NOYB
    Server Hostname:&160;&160;&160;&160;&160;&160;&160; www.waltercedric.com
    Server Port:&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160; 80

    Document Path:&160;&160;&160;&160;&160;&160;&160;&160;&160; /index.php
    Document Length:&160;&160;&160;&160;&160;&160;&160; 45532bytes

    Concurrency Level:&160;&160;&160;&160;&160; 30
    Time taken for tests:&160;&160; 108.897481 seconds
    Complete requests:&160;&160;&160;&160;&160; 500
    Failed requests:&160;&160;&160;&160;&160;&160;&160; 19
    &160;&160; (Connect: 0, Length: 19, Exceptions: 0)
    Write errors:&160;&160;&160;&160;&160;&160;&160;&160;&160;&160; 0
    Total transferred:&160;&160;&160;&160;&160; 23000106bytes
    HTML transferred:&160;&160;&160;&160; 23000106bytes
    Requests per second:&160;&160;&160; 4.59 [#/sec] (mean)
    Time per request:&160;&160;&160;&160;&160;&160; 6533.849 [ms] (mean)
    Time per request:&160;&160;&160;&160;&160;&160; 217.795 [ms] (mean, across all concurrent requests)
    Transfer rate:&160;&160;&160;&160;&160;&160;&160;&160;&160; 178.41 [Kbytes/sec] received

    Connection Times (ms)
    &160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160;&160; min&160; mean[+/-sd] median&160;&160; max
    Connect:&160;&160;&160;&160;&160;&160;&160; 0&160; 114 478.9&160;&160;&160;&160;&160; 0&160;&160;&160; 2276
    Processing:&160;&160; 336 6186 1665.2&160;&160; 6108&160;&160; 16189
    Waiting:&160;&160;&160; -5148 5982 1982.8&160;&160; 6066&160;&160; 16009
    Total:&160;&160;&160;&160;&160;&160;&160; 391 6301 1580.2&160;&160; 6120&160;&160; 17093

    Percentage of the requests served within a certain time (ms)
    &160; 50%&160;&160; 6120
    &160; 66%&160;&160; 6453
    &160; 75%&160;&160; 6778
    &160; 80%&160;&160; 7046
    &160; 90%&160;&160; 7861
    &160; 95%&160;&160; 8516
    &160; 98%&160; 10110
    &160; 99%&160; 12418
    100%&160; 17093 (longest request)

    real&160;&160;&160; 1m48.905s
    user&160;&160;&160; 0m0.024s
    sys&160;&160;&160;&160; 0m0.152s

    &160;

    time /usr/sbin/ab2 -kc 10 -t 30 http://www.waltercedric.com
    This will open 10 connections, using Keep-Alive on them and hammering localhost for 30 seconds


    Same tests but without mod_security

    • Mod_security is a module for Apache which act like a software firewall
    • Depending on the number of rules, can greatly affect through output speed


    time /usr/sbin/ab2 -kc 10 -t 30 http://www.waltercedric.com
    This will open 10 connections, using Keep-Alive on them and hammering localhost for 30 seconds

    real&160;&160;&160; 0m39.040s
    user&160;&160;&160; 0m0.020s
    sys&160;&160;&160;&160; 0m0.208s

    Nearly one second more with mod_security gotroot rules, worth the added security!

    If you want to know more options and how to use apache ab check the apache ab/ab2 man page click here for this man page

    How to optimize Apache/Joomla/PHP

    I forward You to some of my previous articles:

    And more ideas here Secure, Safe, Fast Linux Hosting

  • I am still waiting on the 4 last hard disks, they should arrive next week. While mounting everything together in the case, I was thinking on the range of tests I may do with this NAS before putting it online in production.

    What kind of operating system will I use? 
    OSSoftware
    RAID 5/6
    Hardware
    RAID 5/6
    Remarks
    Windows XPNeed Windows Server BUT there is a workaroundthrough the Promise EX350 driverI do not want a fully fledged OS for a file server, but want to look at performances
    Linux OpenFilerstandard using "mdam"through the Promise EX350 Linux driverelegant, free and OS footprint can be reduce at it's minimum
    OpenSolarisusing ZFS Raid-Zno driver supportZFS is a great file system, and RAID-Z solve some problem of software RAID5 and Hardware RAID5 at the same time!
    others?
    feel free to submit an alternative
    Contact me or use
    Comments

    click read more...


    And this is how my Network Array Storage looks like:
    NAS server
    Processor(s)AMD Athlon 64 3000+  BOX, Socket 939, Venice
    PlatformAsus A8N-VM CSM, mATX, Nvidia 6150/430 Video, socket 939, SATA RAID
    BIOS xxxxx
    RAMCorsair CM72DD512AR-400 (DDR2-400 ECC, reg.)
    2x 512 MB, CL3-3-3-10 Timings
    System Hard DriveRaid 6:
    2 Maxtor 7L300R0 MaXLine III, 7200rpm, 16MB, 300GB, IDE, 24/7 server.
    4  Western Digital Caviar RE, 7200rpm, 8MB, 320GB, SATA, 24/7


    USB attached:
    1 Maxtor onetouch USB2/Firewire 300GB
    1 Maxtor onetouch2
    USB2/Firewire300GB
    Mass Storage Controller(s)Promise SuperTrak EX8350, SATA2, 8 SATA port, Raid6 Controller
    Networking
    Graphics CardOn-Board Graphics
    NVIDIA GeForce 6150

    What kind of  performances test I will do?
    Sofware
    Performance-testc't h2benchw 3.6
    IoZone
    I/O PerformanceIOMeter
    Fileserver-Benchmark
    Webserver-Benchmark
    Database-Benchmark
    Workstation-Benchmark

    Future client using the NAS fileserver
    Clients
    Ladtop
    Windows XP professional
    HP nx7000
    100Mb NIC
    Pentium-M 1.6GHz
    1500MB Ram
    60GB Harddisk
    15,4""WXGA 
    Home desktop,
    Linux SuSe 10.1
    1000 Mb NIC
    AMD Athlon XP 3400+
    1500 Mb RAM
    Asus A78Nx Nforce2 mainboard

    Of course I will stress the box 1 week before putting any vital/useless data on it!
  • Status: in development
    Developers: 5

    homepagewww.freenas.org 
     version0.66
    Based onFreeBSD 6
    SupportCIFS (samba), FTP, NFS, RSYNC
    Software Raid0,1,5 
    Hardware Raidyes if supported by FreeBSD 6
    InterfaceWeb interface, PHP scripts
    Size16MB
    Can be installedCompact Flash, hard drive or USB key
    FilesystemUFS, FAT32, EXT2/EXT3, NTFS (limited read-only)
    HardDriveATA/SATA, SCSI, USB and Firewire
    NetworkAll supported cards by FreeBSD 6 (including wireless card!)

    Added value
    Test it without breaking your NAS server with the VMWARE image:
    FreeNAS is installed on the first hard drive (2 partitions), with a RAID 5 volume for the 3 others hard drive. The IP address configured is 192.168.1.1, with default login/password.

    Why choosing itWhy avoiding it
    Small, do not need an additional disk for the OSFuture releases?
    16MB
    FreeBSD secure out the box: the least number of buffer vulnerabilities since years!
    Very nice GUI


    Performances Tests

    in progress

  • RAID @ home raid5Presentation

    Openfiler
    is a powerful, intuitive browser-based network storage software distribution. Openfiler delivers file-based Network Attached Storage and block-based Storage Area Networking in a single framework.

    Openfiler sits atop of CentOS Linux (which is derived from sources freely provided to the public by a prominent North American Enterprise Linux vendor). It is distributed as a stand-alone Linux distribution. The entire software stack interfaces with third-party software that is all open source.

    Status: stable, in development
    # Developers: __


    homepage www.openfiler.com
     version 1.1.1 stable (2005)
    2.0beta (2006)
    Based on CentOS Linux
    Support
    • NFS,
    • SMB/CIFS,
    • HTTP/WebDAV
    • FTP
    • more
    Network directories support
    • NIS, LDAP (with support for SMB/CIFS encrypted passwords)
    • Active Directory
    • Hesiod
    • Kerberos 5.
    • more
    Software Raid 0,1,5,6
    Hardware Raid yes if supported by CentOS
    Interface Web interface, PHP scripts
    Size 4GB
    Can be installed On hard disk only because of its size
    File system UFS, FAT32, EXT2/EXT3, NTFS (limited read-only)
    HardDrive ATA/SATA, SCSI, USB and Firewire
    Network All supported by CentOS (including wireless card!)

    RAID @ home raid5  Installation

    Is straightforward, You only have to follow the flow on screen. But here is a small HowTo:

    RAID @ home raid5  HowTo: software RAID 5 install

    What I want: software RAID 5, 4 disk of 320GB (real 305GB), using NVIDIA SATA chipset (not a dedicated RAID5 board).

    Note: these pictures are not screenshots but picture taken with a sony camera...
    http://www.openfiler.com/download
    Download iso image from sourceforge and burn it to a CD Insert CD, and boot the PC
    The first step is to TEST the quality of the medium. Openfiler did not recognize the NVIDIA controller.
    choose "Add device"
    NVIDIA drivers (both Ethernet and drive controller) are at the end of the list.
    I've add both drivers manually. Then "Done" The welcome page. click "Next"
    Choose Keyboard language. I am not a novice, so let's look at the advanced configuration.
    The 4 disks are recognized. First I add some space for the Operating System. If You do not want to have a fifth disk just for the operating system, You'll have to reserve a small amount of the global space for the Openfiler system. Note: this space will be located on the first disk and wont be in the raid array...so no redundancy.
    Anyway it is uncommon to install the RAID engine on the RAID array itself.
    Lets have 2GB for System.
    And  1 GB for SWAP Then I click on th button RAID, since I have no RAID predefined only the first choice is available: "Create a RAID partition"
    I will have to create a RAID partition for each of the 4 drives, I reserved 300GB for disk SDB 300GB for disk SDC, for Disk SDA
    and for disk SDD...till all 4 disks contains a RAID partition. I click on the RAID button for the 5th times: and choose "create a RAID device"
    My disk array will be named /RAID (mount point), Raid level 5 Result, a /RAID (device /dev/md0) with an EXT3 file system.
    Nothing particular, default values are good Language support: English
    Choose TimeZone Enter a good Root password. Mine s too small but it is only a prototype for determining performances and reliability of the setup.
    Confirm all values entered by clicking Next wait till the raid array initialization

    CD get ejected, and reboot. Point your browser to https://box_ip:446/
    And administer remotely the box

    If all my explanations are not clear enough, or You want more details, visit the official installation page

    RAID @ home raid5  HowTo: hardware RAID 5 install

    in progress...

    RAID @ home raid5  Administration

    Check Openfiler Administration guide
    point your browser to https://box_ip:446/

    RAID @ home raid5  Problems encountered

    OpenFiler 1.1
    2.0beta1
    2.0beta2
    • The SATA controller was not recognized, this force me to use the 2.0Beta.
    • Unable to read or mount manually 2 different USB keys (FAT32), also unable to read CDROM (closed ISO and CDRW)
    • The network card (NFORCE 4 ) was not recognized by Openfiler 2.0Beta, I fail to copy the NVIDIA driver on the box because of point 2.
    • Is working perfectly, did not ask for any supplemental drivers

    RAID @ home raid5  Web Interface GUI

    Screenshots

    RAID @ home raid5  Performances Tests

    in progress


    RAID @ home raid5  Conclusions

    Why choosing it Why avoiding it
    Enterprise NAS features out of the box You do not need enterprise NAS features
    Very nice WEB GUI 4GB is too much and need an additional small disk only for starting the OS
    A lot of functionalities
    Limited choice of file system:
    • no Reiserfs, the swiss knife of all filesystem.
    • no JFS, XFS more adapted for big files
    A big communities of users and developers, good online documentation.
    No AMD64 version, but it's really not an issue.
    Very easy to have a software RAID5 arrays setup working.
    Stable, Linux 2.6.9 kernel base.
    GPL but an Enterprise version (with support) is also available.


     
  • ZFS has so much promise that it sound to good to be true! I will make an extensive try of it soon.

    From ZFS: Threat or Menace? Pt. I

    .... In a storage industry where the hardware cost to protect data keeps rising, ZFS represents a software solution to the problem of wobbly disks and data corruption. Thus it is a threat to hardened disk array model of very expensive engineering on the outside to protect the soft underbelly of ever-cheaper disks on the inside...
    and part 2 is also here

    And I also found some benchmarks against EXT3, ResierFS, UFS

    will publish soon a lot of ZFS howton as well.