zenodo / zenodo-rdm

Zenodo, powered by InvenioRDM
https://zenodo.org
GNU General Public License v2.0
36 stars 25 forks source link

Testing IIP served image tiles endpoints #846

Closed 0einstein0 closed 1 month ago

0einstein0 commented 2 months ago

Testing Tool used: https://locust.io/ https://docs.locust.io/en/stable/

Users: 100 Images: 10 pyramidal tiff Endpoint1: Image with various dimensions,scale and rotation Endpoint2: Thumbnails Endpoint3: Info.json

locustfile.py

from locust import HttpUser, task, between
import random

class ImageEndpointUser(HttpUser):
    wait_time = between(1, 2)

    @task
    def test_image_endpoints_1(self):
        self.access_image_endpoint(1)

    @task
    def test_image_endpoints_2(self):
        self.access_image_endpoint(2)

    @task
    def test_image_endpoints_3(self):
        self.access_image_endpoint(3)

    @task
    def test_image_endpoints_4(self):
        self.access_image_endpoint(4)

    @task
    def test_image_endpoints_5(self):
        self.access_image_endpoint(5)

    @task
    def test_image_endpoints_6(self):
        self.access_image_endpoint(6)

    @task
    def test_image_endpoints_7(self):
        self.access_image_endpoint(7)

    @task
    def test_image_endpoints_8(self):
        self.access_image_endpoint(8)

    @task
    def test_image_endpoints_9(self):
        self.access_image_endpoint(9)

    @task
    def test_image_endpoints_10(self):
        self.access_image_endpoint(10)

    def access_image_endpoint(self, index):
        img_name = f"img{index}.tif"
        x = random.randint(1, 2000)  
        y = random.randint(1, 2000)
        h = random.randint(1, 2000) 
        w = random.randint(1, 2000) 
        s = 256 * random.choice([1,2,4,8]) 
        r = random.choice([0, 90, 180, 270]) 
        endpoint1 = f"/iiif/{img_name}/{x},{y},{h},{w}/^{s},/{r}/default.jpg"
        endpoint2 = f"/iiif/{img_name}/full/,120/0/default.jpg"
        endpoint3 = f"/iiif/{img_name}/info.json"
        print(endpoint1)
        self.client.get(endpoint1, name=f"/iiif/{img_name}")
        self.client.get(endpoint2, name=f"/iiif/{img_name}/default.jpg")
        self.client.get(endpoint3, name=f"/iiif/{img_name}/info.json")

Results report_1714039493.141505.pdf

Request Statistics Type Name # Requests # Fails Median (ms) Average (ms) Min (ms) Max (ms) Average size (bytes) Current RPS Current Failures/s
GET Aggregated 63007 6 1200 1593.6 3 6073 45240.72 54.8 0
Response Time Statistics Method Name 50%ile (ms) 60%ile (ms) 70%ile (ms) 80%ile (ms) 90%ile (ms) 95%ile (ms) 99%ile (ms) 100%ile (ms)
GET Aggregated 1200 1800 2400 3000 3600 4000 4700 6100

total_requests_per_second_1714039239 141

slint commented 1 month ago

This is deployed on production now, so I think we're good on performance :)