Dear Dave,
i can help you more, when you answer my questions:
- Does the truncation happen as well with downloads from the file-storage?
- Do you have writer threads configured?
- What version of NaviServer do you use?
From you reply is see just cases, where the debug output shows log lines from the input side (from different ip addresses). i would recommend to add ns_log entries before and after the ns_return statement when you send the CSV file.
What exactly is "an Amazon ECB"? I assume this is something like a reverse proxy. It the communication via SSL? How does your comment with the 504 error (usually this means "no response from upstream server") fit together with the partial result of the 500k. I can't believe you get a truncated result in the body the 504 error reply.
Do you see an entry for the request in the access.log?