www.webdeveloper.com
Results 1 to 5 of 5

Thread: How to write a PHP Script for the load testing ?

  1. #1
    Join Date
    May 2014
    Posts
    2

    Question How to write a PHP Script for the load testing ?

    Hi,

    Can you tell me the step to be followed in writing a php script for LOAD Testing ? I have "DOT Net" web application, it can be accessed by more than 100 users at a time. I needs to find the load(performance) of the application when accessed by multiple users at a time. I need a PHP script. Can anybody help me out. Thanks

  2. #2
    Join Date
    Apr 2008
    Location
    Earth
    Posts
    31
    As in you want to record how many users are accessing the site or you want to record load time of pages on your site?

    To record time, record time at the top of your script, record time at the end of your script. Then subtract to find how long it took to load. Here is a tutorial for that:

    http://www.phpjabbers.com/measuring-...ime-php17.html

    Then You just need to save the results.. either database or a text file. But do the saving AFTER the end time log. You dont want to count the time to calculate and record.

  3. #3
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,220
    PHP by itself may not be the best load testing language, as it is (normally) single-threaded. If, for example, you use it to make numerous cURL requests against the site being tested, it will only send one request at a time. For heavier testing involving parallel requests, you might want to look into a language/tool that supports multi-threading and therefore could submit multiple parallel request to the system under test.

    A nice little tool I've used in the past and with a good price (free) is Apache JMeter. But, if you are set on doing something in PHP, as mentioned above, start by looking at its cURL extension.
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  4. #4
    Join Date
    May 2014
    Posts
    1
    I wouldn't recommend writing a performance test using PHP as it is pretty much "re-inventing the wheel" action. There is a variety of tools which are designed for performance testing. The best of free ones is Apache JMeter which provides out-of-the-box record and replay functionality, supports headers, cookies, cache, downloading embedded resources, redirects, authentication, parametrization, correlation, etc.

    For ASP.NET specifics you might want to see ASP.NET Login Testing with JMeter which highlights the most common problems in details and provides resolutions and best practices.

  5. #5
    Join Date
    May 2014
    Posts
    2
    Hi,

    Thanks . Its easy to work on Apache JMeter tool. Any working guide on Apache JMeter tool. I can able to find the load on any system of any application

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles