You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Messaging from ecampApp to worker queue via RabbitMQ
No need to maintain own server: CloudAMQP has a free tier. Officially not recommended for production, but I believe it should well cover the few messages we need it for. https://www.cloudamqp.com/plans.html
Why swoole: Without swoole, we cannot easily run multiple workers on the same node, which probably would lead to inefficient usage of CPU resources. The only way to scale would be to run multiple worker nodes (expensive) or finding another method to run multiple php workers in parallel (not found any good solutions).
if we use swoole-jobs: I haven't fully checked the message format that is exchanged via RabbitMQ. In case this is a special format, then we might need swoole-jobs as a dependency in the main app to generate the messages
The text was updated successfully, but these errors were encountered:
Outsource PDF printing into background job worker
Proposed concept
Use a separate git repository for print job
Digitalocean App Worker (5$) pointing to the new repo
https://docs.digitalocean.com/products/app-platform/how-to/manage-workers/
PDF Print Worker based on swoole-jobs (easy worker management within PHP)
https://github.com/kcloze/swoole-jobs
Messaging from ecampApp to worker queue via RabbitMQ
No need to maintain own server: CloudAMQP has a free tier. Officially not recommended for production, but I believe it should well cover the few messages we need it for.
https://www.cloudamqp.com/plans.html
Worker stores PDF to Digitalocean Spaces (5$), compatible with AWS S3 API
https://www.digitalocean.com/products/spaces/
Client can poll S3 bucket until PDF is generated
Why swoole: Without swoole, we cannot easily run multiple workers on the same node, which probably would lead to inefficient usage of CPU resources. The only way to scale would be to run multiple worker nodes (expensive) or finding another method to run multiple php workers in parallel (not found any good solutions).
Alternative
Use some linux tooling (e.g. supervisord) to run multiple instances of the PHP workers, e.g.
https://github.com/slashfan/docker-supervisor-php-workers
In that case we wouldn't need swoole but can just write our workers in plain old PHP, e.g something link this demo:
https://devcenter.heroku.com/articles/php-workers
Open points
The text was updated successfully, but these errors were encountered: