Openfaas functions - open file limit

Hello. I am writing an openfaas function that runs locust tests. In the log files I am getting this warning:

System open file limit ‘1024’ is below minimum setting ‘10000’. It’s not high enough for load testing, and the OS didn’t allow locust to increase it by itself.

I have increased the amout of open files on my system and locust does not show this error any more when I run locust outside openfaas.

But no matter what I do, the open files limit is set to 1024 when I run locust through my openfaas function.

How can I increase the open files limit for an openfaas function?