My Spryker Application runs into Gateway Timeouts ...
# help
f
My Spryker Application runs into Gateway Timeouts (504) in one endpoint which serves a big file from s3 (~400MB). Now I think I have two options: • Extend the nginx timeout of this endpoint. I know this is possible with nginx but the Spryker architecture doesn't seem to allow it, right? I know of the
deploy.yaml
directive
services: nginx: timeout: XY
but this sets this timeout globally, which is not what I want. • Optimize our application code to start serving the file immediately instead of after download by the server. I have done this but it didn't bring the desired result. (Code example in first thread comment)
Copy code
$outputStream = fopen('<php://output>', 'wb');

$fileStream = $this->flysystemService->readStream(
    DataImportConstants::IMPORT_FILESYSTEM_S3,
    $this->config->getEmarsysS3CsvPath()
);

stream_set_write_buffer($outputStream, 0);
stream_set_chunk_size($fileStream, self::STREAM_CHUNK_SIZE);
stream_copy_to_stream($fileStream, $outputStream);

if (is_resource($fileStream)) {
    fclose($fileStream);
}
if (is_resource($outputStream)) {
    fclose($outputStream);
}
q
Hi, I would suggest, you leave the implementation out of scope and put a DNS + Cloudfront in AWS directly to the S3. This saves resources and time. E.G. we put all the feeds under feeds.domain.tld/feeds/special1.csv which is just pointing to the S3. With the CloudFront in front you don't need to make that bucket public as well.
f
We tried doing that, it seems like Spryker PaaS configuration does not allow for that. We have already asked Spryker about this.