From 885e7019f81fcfac27936a1c394267f2a98d2e0c Mon Sep 17 00:00:00 2001 From: Khushboo Verma <43381712+vermakhushboo@users.noreply.github.com> Date: Wed, 1 May 2024 23:37:18 +0530 Subject: [PATCH 1/3] Update chunk size to 10 MB --- app/http.php | 2 +- app/init.php | 2 +- composer.lock | 24 ++++++++++++------------ 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/app/http.php b/app/http.php index c1b491056a..4d5718e94b 100644 --- a/app/http.php +++ b/app/http.php @@ -32,7 +32,7 @@ $http = new Server( mode: SWOOLE_PROCESS, ); -$payloadSize = 6 * (1024 * 1024); // 6MB +$payloadSize = 10 * (1024 * 1024); // 10MB $workerNumber = swoole_cpu_num() * intval(System::getEnv('_APP_WORKER_PER_CORE', 6)); $http diff --git a/app/init.php b/app/init.php index 9e5e0f5b0a..e02e4fa585 100644 --- a/app/init.php +++ b/app/init.php @@ -200,7 +200,7 @@ const APP_AUTH_TYPE_JWT = 'JWT'; const APP_AUTH_TYPE_KEY = 'Key'; const APP_AUTH_TYPE_ADMIN = 'Admin'; // Response related -const MAX_OUTPUT_CHUNK_SIZE = 2 * 1024 * 1024; // 2MB +const MAX_OUTPUT_CHUNK_SIZE = 10 * 1024 * 1024; // 10MB // Function headers const FUNCTION_ALLOWLIST_HEADERS_REQUEST = ['content-type', 'agent', 'content-length', 'host']; const FUNCTION_ALLOWLIST_HEADERS_RESPONSE = ['content-type', 'content-length']; diff --git a/composer.lock b/composer.lock index 9dbcd5c5ec..5e51ea7528 100644 --- a/composer.lock +++ b/composer.lock @@ -2005,16 +2005,16 @@ }, { "name": "utopia-php/migration", - "version": "0.4.0", + "version": "0.4.1", "source": { "type": "git", "url": "https://github.com/utopia-php/migration.git", - "reference": "a72f27bd3dde68752fb185d306c4820e1b8d9657" + "reference": "ae3cfe93f6d313105d226aeb68806660c806a925" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/migration/zipball/a72f27bd3dde68752fb185d306c4820e1b8d9657", - "reference": "a72f27bd3dde68752fb185d306c4820e1b8d9657", + "url": "https://api.github.com/repos/utopia-php/migration/zipball/ae3cfe93f6d313105d226aeb68806660c806a925", + "reference": "ae3cfe93f6d313105d226aeb68806660c806a925", "shasum": "" }, "require": { @@ -2047,9 +2047,9 @@ ], "support": { "issues": "https://github.com/utopia-php/migration/issues", - "source": "https://github.com/utopia-php/migration/tree/0.4.0" + "source": "https://github.com/utopia-php/migration/tree/0.4.1" }, - "time": "2024-02-25T12:35:21+00:00" + "time": "2024-05-01T13:19:18+00:00" }, { "name": "utopia-php/mongo", @@ -2991,16 +2991,16 @@ }, { "name": "laravel/pint", - "version": "v1.15.2", + "version": "v1.15.3", "source": { "type": "git", "url": "https://github.com/laravel/pint.git", - "reference": "2c9f8004899815f3f0ee3cb28ef7281e2b589134" + "reference": "3600b5d17aff52f6100ea4921849deacbbeb8656" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/pint/zipball/2c9f8004899815f3f0ee3cb28ef7281e2b589134", - "reference": "2c9f8004899815f3f0ee3cb28ef7281e2b589134", + "url": "https://api.github.com/repos/laravel/pint/zipball/3600b5d17aff52f6100ea4921849deacbbeb8656", + "reference": "3600b5d17aff52f6100ea4921849deacbbeb8656", "shasum": "" }, "require": { @@ -3053,7 +3053,7 @@ "issues": "https://github.com/laravel/pint/issues", "source": "https://github.com/laravel/pint" }, - "time": "2024-04-23T15:42:34+00:00" + "time": "2024-04-30T15:02:26+00:00" }, { "name": "matthiasmullie/minify", @@ -5529,5 +5529,5 @@ "platform-overrides": { "php": "8.3" }, - "plugin-api-version": "2.6.0" + "plugin-api-version": "2.3.0" } From 89daa5e479ac34e7fe508e6aa8ac7b3da860323f Mon Sep 17 00:00:00 2001 From: Khushboo Verma <43381712+vermakhushboo@users.noreply.github.com> Date: Thu, 2 May 2024 14:30:18 +0530 Subject: [PATCH 2/3] Update payload size to 11 MB to accomodate 10 MB chunk size --- app/http.php | 2 +- tests/e2e/Services/Storage/StorageBase.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/http.php b/app/http.php index 4d5718e94b..12554aa3a7 100644 --- a/app/http.php +++ b/app/http.php @@ -32,7 +32,7 @@ $http = new Server( mode: SWOOLE_PROCESS, ); -$payloadSize = 10 * (1024 * 1024); // 10MB +$payloadSize = 11 * (1024 * 1024); // 11MB $workerNumber = swoole_cpu_num() * intval(System::getEnv('_APP_WORKER_PER_CORE', 6)); $http diff --git a/tests/e2e/Services/Storage/StorageBase.php b/tests/e2e/Services/Storage/StorageBase.php index 78548ca1ac..ce5f44d5a0 100644 --- a/tests/e2e/Services/Storage/StorageBase.php +++ b/tests/e2e/Services/Storage/StorageBase.php @@ -125,11 +125,11 @@ trait StorageBase /** * Failure - * Test for Chunk above 5MB + * Test for Chunk above 10MB */ $source = __DIR__ . "/../../../resources/disk-a/large-file.mp4"; $totalSize = \filesize($source); - $chunkSize = 6 * 1024 * 1024; + $chunkSize = 11 * 1024 * 1024; $handle = @fopen($source, "rb"); $fileId = 'unique()'; $mimeType = mime_content_type($source); From 87fb11914e82b9351e9ba24aebe2b6e4b76167d3 Mon Sep 17 00:00:00 2001 From: Khushboo Verma <43381712+vermakhushboo@users.noreply.github.com> Date: Thu, 2 May 2024 19:38:45 +0530 Subject: [PATCH 3/3] Update chunk size to 7 MB --- app/http.php | 2 +- app/init.php | 2 +- tests/e2e/Services/Storage/StorageBase.php | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/http.php b/app/http.php index 12554aa3a7..b0c6a76e69 100644 --- a/app/http.php +++ b/app/http.php @@ -32,7 +32,7 @@ $http = new Server( mode: SWOOLE_PROCESS, ); -$payloadSize = 11 * (1024 * 1024); // 11MB +$payloadSize = 8 * (1024 * 1024); // 8MB $workerNumber = swoole_cpu_num() * intval(System::getEnv('_APP_WORKER_PER_CORE', 6)); $http diff --git a/app/init.php b/app/init.php index e02e4fa585..44b2393359 100644 --- a/app/init.php +++ b/app/init.php @@ -200,7 +200,7 @@ const APP_AUTH_TYPE_JWT = 'JWT'; const APP_AUTH_TYPE_KEY = 'Key'; const APP_AUTH_TYPE_ADMIN = 'Admin'; // Response related -const MAX_OUTPUT_CHUNK_SIZE = 10 * 1024 * 1024; // 10MB +const MAX_OUTPUT_CHUNK_SIZE = 7 * 1024 * 1024; // 7MB // Function headers const FUNCTION_ALLOWLIST_HEADERS_REQUEST = ['content-type', 'agent', 'content-length', 'host']; const FUNCTION_ALLOWLIST_HEADERS_RESPONSE = ['content-type', 'content-length']; diff --git a/tests/e2e/Services/Storage/StorageBase.php b/tests/e2e/Services/Storage/StorageBase.php index ce5f44d5a0..5a181072a1 100644 --- a/tests/e2e/Services/Storage/StorageBase.php +++ b/tests/e2e/Services/Storage/StorageBase.php @@ -125,11 +125,11 @@ trait StorageBase /** * Failure - * Test for Chunk above 10MB + * Test for Chunk above 7MB */ $source = __DIR__ . "/../../../resources/disk-a/large-file.mp4"; $totalSize = \filesize($source); - $chunkSize = 11 * 1024 * 1024; + $chunkSize = 8 * 1024 * 1024; $handle = @fopen($source, "rb"); $fileId = 'unique()'; $mimeType = mime_content_type($source);