[MapServer-users] GetMap request inside python script; measuring speed of WMS?

David Hoese dhoese at gmail.com
Tue Jan 24 12:59:02 PST 2023


I did something recently to compare my MapServer performance with local mounted storage for geotiffs and S3 geotiffs. I ended up building a Python script using Locust:

https://locust.io/

I ended up putting something together that worked for what I wanted and could scale to different numbers of fake users and be deployed across my Kubernetes cluster. Bottom line for your original question is to use the `requests` library to make a URL request from within Python. The locust python library gives you access to the `requests` library to do that, but with all of the load testing stuff you may want to do in the long run.

The overall suggestions from all the responses you've gotten so far are more important to consider though: don't just get a response time for a single request, but for many requests. Don't just do the same request over and over again, make it semi-random to avoid reporting the results of internal caching in MapServer.

Dave


On 1/24/23 04:36, Marcin Niemyjski via MapServer-users wrote:
> Hello,
> 
> I want to measure how long does it takes for my WMS to response to GetMap request. I have prepared list of extents in form of python list for example:
> ['38.04778703973034,-17.714089101743628,39.04778703973034,-16.714089101743628', '38.04778703973034,-17.714089101743628,39.04778703973034,-16.714089101743628'...]
> 
> I'm aiming into itterating over this list and passing it's elements into GetMap request inside python script and then request GetMap and measure how long does it takes to perfome it.
> 
> Here starts my question: How to do GetMap request inside python script, is it possible? The question is not about creating the url but about function wich does request.
> Maybe somebody can recommend me some other way of measuring speed of WMS?
> 
> I would like show my k8s cluster service as use-case at FOSS4G 2023 and i need some statistics for presentation 🙂
> 
> Best,
> Marcin
> 
> 
> 
> 
> <https://outlook.office.com/bookwithme/user/6347c7def05a478ba013ae948648789d@cloudferro.com?anonymous&ep=signature> 		Book time to meet with me <https://outlook.office.com/bookwithme/user/6347c7def05a478ba013ae948648789d@cloudferro.com?anonymous&ep=signature> 	
> 
> 
> _______________________________________________
> MapServer-users mailing list
> MapServer-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users


More information about the MapServer-users mailing list