понедельник, 23 марта 2020 г.

Magento Site Load-Testing via Jmeter

1) gather links of the site;

All needed links are in url_rewrite table. I need the result file with random link lines from the table.
So, I will use RAND() function in select query. It will be enough if I use only category, product, cms_page links, so I will use such entity_type from the table as ones. I need avoid duplicates, so I will use distinct in the query.

    Finally, the result query is
mysql -uuser_name -p -hdatabase -e "select distinct request_path from url_rewrite where entity_type='caterory' or entity_type='product' or entity_type='cms_page' order by RAND();" db_name > load_test.log

2) I noticed that product records begins with slash as the fist character. I need to remove it.
 Such script should help there

./remove_first_slash.sh > load_test-ready.log

#!/bin/bash
for request_path in $(cat load_test.log); do
    tmp_val=$(echo "$request_path" | cut -c -1)
    if [[ "$tmp_val" == "/" ]]; then
        tmp_clear=$(echo "$request_path" | cut -c 2-)
        echo "$tmp_clear"
        continue
    fi
    echo "$request_path"
done

3) use it with Jmeter

Tips&tricks:

I got unexpected good results with higher concurrent users number after previous bad with lower ones.
The reason were FPC cache (redis in my case) and OpCache.
So, tricks are cleaning FPC and OpCache caches before each test.
In my case,
redis-cli -p 6380 FLUSHALL 
and restarting php

Комментариев нет:

Отправить комментарий