Locust.io Load Testing getting “Connection aborted

2020-06-11 12:59发布

问题:

I'm using Locust.io to load test an application. I will get a random error that I am unable to pinpoint the problem:

1) ConnectionError(ProtocolError(\'Connection aborted.\', BadStatusLine("\'\'",)),)

2) ConnectionError(ProtocolError('Connection aborted.', error(104, 'Connection reset by peer')),)

The first one is the one that happens a few times every 1,000,000 request or so and seems to happen in groups where there will be 5-20 all at once and then its is fine. the second only happens every couple days or so.

The CPU and memory are well below all the servers max load for the database server, app server and the machine running locust.io.

The servers are medium sized Linode servers running Ubuntu 14.04. The app is Django and the database in PostgreSQL. I have already increased the maximum open file limit but am wondering if something else needs to be increased on the server that could be leading to the occasional errors.

From what I have been able to gather from searching the error is that it might have something to do with python requests library.

-Any help would be greatly appreciated.

回答1:

BadStatusLine is most likely a server side issue. See for example this answer https://stackoverflow.com/a/1767954/1591921 It could be some sort of flood/DoS protection on the server.

Connection reset by peer could also be any number of things, but it is most likely a server/network issue, not an issue on the loadgen side (perhaps connections are idle for too long, or there is a max connection age somewhere)

I dont think there are any general answers to this question, it all depends on your system under test.