Asp. Net: Concurrency Testing

We have a website on which companies must upload zip files, and after downloading the file, the application checks some things in the database and then creates some inserts.

The problem is that, given the high level of concurrency, the site works very poorly, and after talking with the infrastructure team, we decided to redesign and redesign the asp.net web application.

So, we are developing an application, and to avoid the concurrency problem that we had, I would like to know how I can test concurrency (telling many people about uploading files to a website is not an option) and monitor ...

This is the first time I am doing something like this, so I will appreciate ideas, articles, etc.

+4
source share
2 answers

A short simple and simple answer by Jmeter or, for example, NeoLoad . You can also consider Visual Studio web tests as an option if you have an Ultimate version.

However, I personally just started by coding this in C # and parallel execution. I don’t know your background, but since there is a [C #] tag ...

    private volatile int threads;

    [TestMethod]
    private void Main()
    {
        const int threadCount = 10;
        for (int i = 0; i < threadCount; i++)
        {
            ++threads;
            new Thread(LoadFile).Start();
        }
        while (threads > 0)
        {
            Thread.Sleep(10);
        }
    }

    private void LoadFile()
    {
        var watch = Stopwatch.StartNew();
        //todo: do POST call
        Console.WriteLine(watch.ElapsedMilliseconds);
        --threads;
    }

Take this as a starting point , it is definitely not something ready / ready for production. Registration, time accumulation, number of threads, replacing volatile int with EventWaitHandles ...

Hope this helps.

+2
source

Problem

, , ... , ...

, - . , -, . .


-, .

, , , .

, , , , - , , , , ,

0

All Articles