Results 1 to 4 of 4

Thread: Load Tester

  1. #1
    Join Date
    Nov 2006

    Load Tester

    I've been looking for a web site load tester to help me optimize my php code.
    I've read some howtos and such that help me prevent writting code thats too resource intense, but I am about to take the site live and am trying to get a realistic feel for how much server resources its going to take per visitor.

    I've seen some people talking about "my site does XX queries per visitor on average." Im not really sure how to get those #'s and also is there a way (maybe a script or something i could setup) that would give me the estimated time it takes to perform each query ?
    Im in a shared hosting environment is why im worried about it. I want to avoid having to move to a vps/semi-dedicated/dedicated before absolutely necessary.

    Im not really planning on the site to be huge or anything ,its a personal endeavor, I just mainly want to practice practical php coding instead of developing bad habits so soon. So if any one could point me to a tool that would let me somehow measure resources taken and/or database query response time, that would be great.

    Any help is appreciated

  2. #2
    I've used JMeter, even though it is written in Java it isn't exclusively for testing Java apps. It has a lot more power in that realm of course but can be used to hit whatever types of pages you'd like to test.

  3. #3
    Join Date
    Dec 2002
    chica go go
    apachebench is good for testing how your website will run when you start getting thousands of hits per second. Best part is, it comes with apache, and exists under the name of "ab".


    [email protected][~] $ ab -h
    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
        -p postfile     File containg data to POST
        -T content-type Content-type header for POSTing
        -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: zop'
                        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
        -h              Display usage information (this message)
    While running it, check your server load, and your MySQL usage (mysqladmin processlist). After it processes all your requests, it'll give you a little report.

  4. #4
    Join Date
    Nov 2006
    Alright thanks guys, ill try both out and see how it does.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts