Mondoze Knowledge Base

Search our articles or browse by category below

Why are Railgun requests showing as Stream?

Last modified: October 5, 2022
You are here:
Estimated reading time: 1 min

Why Are Railgun Requests Showing as Stream?

The presence of stream in place of a compression ratio indicates that the response from the origin was greater than the value set in the stream.size parameter within the railgun.conf file (default value is 250000 bytes). 

This status results in the request not being compress and serve in a streaming fashion.

*Please refer to our Reading and Interpreting the ‘Cf-Railgun’ Header article for additional technical information on the Cf-Railgun header.

Troubleshooting

If a continual/repeated stream status is occurring for requests, please check for the following conditions that are common causes:

-MirageLMemcached does not work, or the listener has trouble connecting to it. Please execute the following order to validate the running of memcached:

ps aux | grep memcached

If you are connecting Railgun to memcached using a loopback inet connection to localhost, confirm there are not any firewall rules that would prevent connections. If using a unix socket, make sure the permissions and ownerships on the sock file are set correctly.

– Memcache wasn’t given enough memory.

By default, memcache is configure to only use 64MB of memory. We generally recommend Railgun be configure to have between 512MB and 2GB of memory allocate.

– The file the visitor is trying to access is larger than 250KB.

By default, rg-listener will stream files larger than 250KB, rather than try to compress them. This is because we decide that it would be faster/less computationally expensive for them to be stream. This can be increase using the stream. Size setting in the Railgun configuration settings. `Please note this can’t be increase beyond 1MB`.

– When the response body is zero bytes, or the request is simply too small to compress.

If the request is serve with a response body of zero bytes (common for 301/302 redirects for example), then the request will be serve without compression. The same case would apply if the response was only several KB in size, as that would be more computationally expensive to compress, then simply serving the data uncompress to the client.

– The MIME type of the response was not of a type that Railgun supports.If the response doesn’t match one of these content types, it will not be compressed:

  • Anything beginning with "text/"
  • Any "application/" type that ends with the string "+xml"
  • "application/json"
  • "application/ecmascript"
  • "application/javascript"
  • "application/x-javascript"
  • "application/xml"
  • "application/dart"

*Please note that the MIME type is determined by the Content-Type header sent by the origin.

Was this article helpful?
Dislike 0
Views: 52