Skip to content

Commit 159c6dd

Browse files
committed
run the metacpan-api app.psgi, not the api.pl
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.
1 parent d69dff2 commit 159c6dd

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

hieradata/common.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ metacpan::web::starman:
125125
- "st.aticpan.org"
126126
starman_port: 5000
127127
starman_workers: 2
128-
starman_init_template: 'starman/init.api.erb'
128+
starman_init_template: 'starman/init.pl.erb'
129129
vhost_extra_proxies:
130130
proxy_cpan_index:
131131
location: '/v1/cpan'

hieradata/env/production.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ metacpan::web::starman:
3131

3232
metacpan-api:
3333
git_enable: true
34-
starman_workers: 14
34+
starman_workers: 30
3535

3636
sco-redirect:
3737
git_enable: true

0 commit comments

Comments
 (0)