run the metacpan-api app.psgi, not the api.pl #247
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, metacpan-api has an app.psgi for the Catalyst app. This has most of the end points. There is also an api.pl script which runs Mojolicious. This hosts a Minion admin interface, a few end points which are duplicates of the Catalyst end points, and mounts the app.psgi to handle everything else.
This setup uses the Mojolicious MountPSGI plugin. This plugin is rather limited and has some issues. It ends up loading the PSGI app the first time it is requested. This means in a prefork setup, none of the memory is shared. This is wasteful, but also means creating worker processes is very slow. And if it is slow enough, the worker won't respond to the heartbeat check, and the parent process will kill it before it is even ready.
The problems with MountPSGI could be fixed, but the Mojolicious app is also just adding complexity without providing any real value in its current state. The end points it provides are duplicates.
We aren't using the Minion integration to dispatch tasks anywhere in the API. And its admin interface doesn't really belong in the same service as the API server.
Simplify the way metacpan-api is hosted by just running the Catalyst app. This avoids the problems with the MountPSGI plugin. Replacing the Minion admin interface is a task left for a different time.
Using Mojolicous in the future would be reasonable, but it should be done as a proper conversion.