Open jqnatividad opened 3 years ago
While considering this, its also noteworthy that both nginx and uwsgi also support the more efficient brotli compression format.
https://medium.com/oyotech/how-brotli-compression-gave-us-37-latency-improvement-14d41e50fee4
https://uwsgi-docs.readthedocs.io/en/latest/Changelog-2.0.16.html?highlight=brotli https://docs.nginx.com/nginx/admin-guide/dynamic-modules/brotli/
and all modern browsers support it as well. https://caniuse.com/brotli
and python requests brotli support is imminent: https://github.com/psf/requests/issues/4525
CKAN version 2.9.1
Describe the bug It's not strictly a bug, but I'm filing it as one, given the high payoff.
CKAN is widely used to distribute data. OOTB,
max_resource_size
is set to 10mb. Nowadays, that setting is miniscule and even when CKAN is configured to handle large files (>500mb), several related problems/issues present themselves:resource_create
andresource_update
file uploads can only handles up to 2gb files (otherwise, you get anOverflow error: string longer then 2147483647 bytes
)These issues can be mitigated by using chunked/streaming uploads. Doing so is another issue by itself and will also require rework by existing Filestore API clients.
Several users have also migrated to alternate filestores like ckanext-cloudstorage to overcome this limitation.
But large file handling can be largely mitigated by adding native support for resource precompression in the Filestore API, in a way that is transparent to existing Filestore API clients.
With a big benefit for all CKAN users - developers, publishers, and downstream users alike:
To do so, the following needs to be implemented:
gzip_static on
for the filestore location nginx will serve the precompressed gz file transparently. If there is no precompressed file or the client doesn't support gzip, the original uncompressed file is served by nginx automatically. In this way, existing Filestore API clients like datapusher and ckanapi need not be modified (as python requests automatically handles gzip-encoded responses).The only potential downside is the increased filestore storage footprint - as you now need to store both the compressed and uncompressed variants. IMHO, storage is very cheap and bandwidth/performance far more expensive/valuable.
But even here, we can use
gzip static always
, and force nginx to always serve the gzipped file, eliminating the need for storing the uncompressed variant - effectively reducing your filestore storage requirements as well!It's also noteworthy that uwsgi supports gzip precompression with the
static-gzip-all
setting - https://ugu.readthedocs.io/en/latest/compress.html