CAPABILITY GENERATOR

LambdaTestTesting Locally Hosted Pages ● How To Set The Open File Limit While Using Proxy?

How To Set The Open File Limit While Using Proxy?


If you are using a proxy service with LambdaTest for cross browser testing then you may get the following warning.

File descriptor limit is too low! Increase you limit to at least 2000.

This warning is sent across to help you avoid a lack of available file handles. If this warning is ignored for a long time then you might have issues connecting your proxy with LambdaTest. This would also be reflected in the LambdaTest logs if you fail to connect your proxy with LambdaTest. The logs would be reflecting the below error message.

accept tcp 127.0.0.1:9090: accept: too many open files.

We recommend that you expand the open file limit to 2000 for a seamless browser testing experience.

How To Expand The Open File Limit Using macOS/Linux?


You can increase the open file limit either temporarily or permanently for your profile. In case of temporary modification, your profile settings will be restored once the terminal is shut down.

Increasing The Open File Limit Temporarily

Step 1: Gain Sudo rights and run the below command to set the open file limit to 2000.

Note: If your system is capable of handling a higher limit then please feel free to set the limit above 2000. However, 2000 is the minimum recommendation.

Step 2: Next, we need to verify if the setting are modified by running the below command.

Step 3: Restart the proxy server and you’re ready to go!

Increasing The Open File Limit Permanently

Step 1: For increasing the file limit permanently, you’d have to edit the profile settings. You would have to set the file limit in the your .bash_profile or .bashrc-type file. Use the same command

Step 2: Execute source ~/.your_bash_profile.

Step 3: Run the command ulimit -n to verify if the setting are modified.

Step 4: Restart the proxy server and you're ready to go!