Spaces-API icon indicating copy to clipboard operation
Spaces-API copied to clipboard

Rate Limiting

Open jasperf opened this issue 5 years ago • 1 comments

Just bumped into this package and I am really excited. We tried using Laravel with DigitalOcean Spaces but we ran into rate limiting issues deleting, listing and get HEAD data real quick hitting 503s and 413s. Was wondering if this package deals well with these exceptions and perhaps offers better listing, caching options to deal with DigitalOcean in a way that does not cause

Exception message: Error executing "DeleteObject" on "https://app-staging.ams3.digitaloceanspaces.com/app-staging/5f2e5e54e31b9_2020-08-14-02-00-02.zip"; AWS HTTP error: Server error: DELETE https://app-staging.ams3.digitaloceanspaces.com/app-staging/5f2e5e54e31b9_2020-08-14-02-00-02.zip resulted in a 503 Slow Down response: 
<?xml version="1.0" encoding="UTF-8"?> <Error> <Code>SlowDown</Code> 
<Message>Reduce your request rate.</Message> </Erro (truncated...) SlowDown (server): Reduce your request rate. - <?xml version="1.0" encoding="UTF-8"?> <Error> <Code>SlowDown</Code> <Message>Reduce your request rate.</Message> </Error>

and

Aws\S3\Exception\S3Exception · Error executing "HeadObject" on "https://app.ams3.digitaloceanspaces.com/backups/production/laravel-332/2020-08-07%2002%3A19%3A30.zip"; AWS HTTP error: Server error: `HEAD https://app.ams3.digitaloceanspaces.com/backups/production/laravel-332/2020-08-07%2002%3A19%3A30.zip` resulted in a `503 Service Unavailable` response (server): 503 Service Unavailable -
Jobs/ProjectExport.php:48App\Jobs\ProjectExport::handle

// Clean files

$allFiles = \Storage::disk('do_backup')->allFiles($storagePath);

if (count($allFiles) > 5) {

    \Storage::disk('do_backup')->delete($allFiles[0]);

}

// Add files

Jobs/ProjectBackupJob.php:43App\Jobs\ProjectBackupJob::handle
Console/Commands/BackupProjects.php:45App\Console\Commands\BackupProjects::App\Console\Commands\{closure}
Console/Commands/BackupProjects.php:48App\Console\Commands\BackupProjects::handle
Caused By: GuzzleHttp\Exception\ServerException · Server error: `HEAD https://app.ams3.digitaloceanspaces.com/backups/production/laravel-332/2020-08-07%2002%3A19%3A30.zip` resulted in a `503 Service Unavailable` response
Jobs/ProjectExport.php:48App\Jobs\ProjectExport::handle

exceptions

jasperf avatar Jan 26 '21 01:01 jasperf

I am open to this idea.

I will investigate the feasibility of implementing this.

MacroMan avatar Aug 05 '21 08:08 MacroMan

This library is now deprecated and this feature will not be implemented. We recommend using the official SDK or the Laravel package

MacroMan avatar Dec 15 '23 11:12 MacroMan