What is relationship of railgun and 520 error?

My site periodically displays 520 errors.
These errors have been correlated to slow page loads.

I’ve discovered that these errors go away if I disable railgun.

Railgun timeout is set to 100 seconds, and I believe that the default for Cloudflare is 100 seconds yet according to my http access logs the request is completing (returning a 200 code) in less than 70 seconds.

Anyone familiar with the roll Railgun plays in determining timeouts and why disabling Railgun would reduce the frequency of server origin errors?

did you properly whitelist CF ips and 2408 port etc Installation — Railgun 5.3.3 documentation

Railgun runs on port 2408 via TCP by default and this port will need to be open to connections from Cloudflare IPs. If you are unfamiliar with networking, please reach out to your hosting provider to determine the proper way to open the port for your environment. You can script out adding rules for software firewalls as follows (use with caution):