morty icon indicating copy to clipboard operation
morty copied to clipboard

Fix Image Proxy 'TCP Timeout' Error

Open ryouko-dev opened this issue 3 years ago • 0 comments

This will fix issue #106. The changes are as follows:

Inside of config/config.go:

Disable IPV6 due to it not working correctly with most image-based search engines. Change RequestTimeout to something higher to prevent timeouts. Does not change responsiveness of image searches. Enable FollowRedirect. There were some rare cases where having it disabled caused issues with loading images.

Inside of morty.go:

Add MaxConnsPerHost: 4. This will limit connections per host to 4. Images still load quickly. Change time.Second to time.Minute. This adds far more time for an image to load and causes less timeouts.

This should fix most issues with timeouts from image-based search engines. Through my testing so far, I have found that at most one image will timeout from a search even after loading 5+ pages of images. This could be higher in some cases as I haven't tested more than a few days but should generally be small enough to not bother the user.

Unsure if this is required or not but I have changed the following settings in /etc/searx/settings.yml as well just to make sure that the hosts configuration is the same. Unsure if this changes anything so please do let me know.

outgoing:
    pool_connections : 100 
    pool_maxsize : 4

Changes should work without any other configuration.

ryouko-dev avatar May 31 '21 23:05 ryouko-dev