📜 ⬆️ ⬇️

Load testing site using WCAT

Having once again gone all the way from choosing a CMS to testing, I thought that this whole way is well described. Here, it is very difficult to find intelligible information about testing, without an offer, to put all the money on it or not to do it at all. I hope my article will encourage testing professionals to correct this situation and write about testing. Especially about testing in a project whose budget is small.
Those habrovchane who have long been engaged in the development of sites may (I hope) will find my article quite banal and for granted. But users who take only the first steps will be able to learn for themselves a bit of useful.
What we get by following the steps below can be found here .

A couple of words about CMS

The site should be supported by editors who have learned about the existence of computers quite recently and even the Word interface causes them a slight shock. HTML, the basics of the site, the basics of programming and much more, which turns the work in the CMS from creativity and research into work on the site using the tool - this is not my case.
At the same time the site is filled with forms, buttons, javascript'ami, moving elements and other-other.
Therefore, the content management system should be as customizable as possible, but very convenient for the editor.
I rummaged through a huge number of existing free and some paid CMSs and found nothing more appropriate in my case than Umbraco.
The .NET platform on which Umbraco is written is more of a trick than a challenge for me.

Stress Testing

Errors on the site can be corrected, the content can be added, the design is completely changed. But if the site does not withstand the anticipated load, then you will have to redo it completely. Therefore, load testing is extremely important when developing a site. I advise you to do it more than once and to do the first runs already at the stage of developing prototypes.

WCAT is a free utility from Microsoft for load testing a site.
Actually, the key for me was free and Microsoft. Microsoft - only for reasons that the site is on MS-solutions.
Plus, the system (or utility) is very well described by Microsoft and is really convenient.

Test system configuration

At the prototype stage, testing can be performed directly on the development environment. But the closer the launch, the more you want to drive the system under load on the target system. What we have is the target system: A virtual server at the hoster with decent parameters. All the machines with which we can create the load are located in the office. In principle, too much load on the site is not expected, so you can use only one machine to create a load. I emphasize - we are testing not a local, but a remote system.

How to test

WCAT makes it very easy and simple to create a load in the style: warm-up, load, waste. But I really wanted to get the graphs of the system, depending on the load created.
And the task of processing WCAT logs is solved by writing a small utility for processing logs.



CPAU is a utility of type runas, but with the ability to transfer a password on the command line.
We create the settings.ubr and umbraco.ubr files (the names are not fundamental) in the image and subtlety of the nested WCAT \ samples folder.
In the umbraco.ubr file there is an enumeration of requests that the test client should make. Personally, I did just. I restarted IIS, wandered around the site, imitating the user, then simply transferred the requests from the log to the file, adding the necessary environment. WCAT is a very serious utility and allows you to configure all the necessary authentication and advanced parameters for the request. How to do this is very detailed in the documentation. But in my case, everything is simple and trite. Requests without authentication and almost everywhere 200 OK in response.
We are ready by writing a command like:
wcctl.exe -t umbraco.ubr -f settings.ubr -v 10 -s www.example.com -p 80 -c 1 -o report.xml -r report.xsl -x
and then the team
and start testing. But I wanted to test the behavior of the system under different loads.
In addition, we are waiting for a big ambush. We will not be able to connect to the counters of the target system (via WMI) and will only be able to see the response time, without knowing what is going on inside.
Therefore, further begins Voodooism.
Create a pair of bat files.
1) test.bat
@echo OFF
wcctl.exe -t umbraco.ubr -f settings.ubr -v %1 -s www.example.com -p 80 -c 1 -o report%1.xml -r report.xsl -x

2) rem_test.bat
@echo OFF
net use \\IP-\ipc$ /user: \administrator ""
for /L %%c in (1, 10, 301) DO (
ping -n 60 > NUL
cpau -u \administrator -p "" -ex "test.bat %%c"
ping -n 60 > NUL
net use /DELETE \\IP-\ipc$

The first file is clear and primitive.
About the second more:
We connect to the target machine with the rights of its user, but on our own we remain with the rights of the local user. With runas, this launch takes place with the / netonly key.
ping 'and needed for the delay - first we wait until the kernel starts, and then it will be unloaded.

Some lyrics: by the way, with the help of runas, you can make Windows Home work in a domain with domain user rights. It is enough to pay off the explorer and run it with the runas command with the domain user and the / netonly key.


So, run rem_test.bat and get a bunch of files like report11.xml. They can be opened and viewed (do not forget to report report.xsl from the WCAT folder to report)
But we need graphics. In this pile of files we will understand a very long time.
What to do?
Everything is very simple.
Download Microsoft Visual C # Express Edition and write a simple utility.
Perhaps I will not include its code here. Who wants - can download the project, as well as all the files described by me - here .


Thus, the cost of testing was 1 day for setting up, configuring and testing and not a penny more.
I still hope to find developers and stop developing on my own, especially since this is not included in the list of my current interests. If you know Umbraco well and want to apply knowledge to yours and not only good - write me in a personal or on dima (at) kurilo.su.

PS While writing the post, I thought that I would receive comments like: “judging by the schedule, you tested the bandwidth of your ISP channel in the office” or “you cannot test it this way, you need to make a stand for load tests”. But I received a number of comments that there are simpler utilities, I learned the opinion of a professional tester (judging by the site) that it is better to pay money to the bourgeois office (I do not argue that it is better and, probably, I will use the advice later). And a bunch of cons without explanation.
Apparently, the topic of testing the site in non-industrial conditions is irrelevant. Judging by the trend, everyone works with highly loaded systems, no-SQL databases and other functional languages. I'll take note.

Source: https://habr.com/ru/post/105230/

All Articles