You are browsing a read-only backup copy of Wikitech. The live site can be found at wikitech.wikimedia.org
Application servers: Difference between revisions
imported>Krinkle mNo edit summary |
imported>Krinkle No edit summary |
||
(17 intermediate revisions by 11 users not shown) | |||
Line 1: | Line 1: | ||
{{Navigation Wikimedia infrastructure|expand=mw}} | |||
{{See|See also '''[[Application servers/Runbook]]''' for how to perform common tasks, or diagnose issues.}} | |||
The '''Application servers''' (or '''app servers''') are the several hundred Apache servers that run [[MediaWiki]] (PHP application). | |||
== | ==Service== | ||
Puppet roles: | |||
* | * <code>mediawiki::appserver</code>, <code>mediawiki::canary_appserver</code> | ||
* <code>mediawiki::appserver::api</code>, <code>mediawiki::appserver::canary_api</code> | |||
* <code>mediawiki::maintenance</code> | |||
* <code>mediawiki::jobrunner</code> | |||
* | Relevant puppet classes: | ||
* <code>[https://gerrit.wikimedia.org/g/operations/puppet/+/HEAD/modules/profile/manifests/mediawiki/webserver.pp profile::mediawiki::webserver]</code>, this provisions Apache, and any other packages or resources needed by MediaWiki on app servers. | |||
** | ** <code>[https://gerrit.wikimedia.org/g/operations/puppet/+/HEAD/modules/profile/manifests/mediawiki/httpd.pp profile::mediawiki::httpd]</code>, the Apache service. | ||
** <code>[https://gerrit.wikimedia.org/r/plugins/gitiles/operations/puppet/+/HEAD/modules/mediawiki/manifests/web/prod_sites.pp mediawiki::web::prod_sites]</code>, the Apache configuration for all production websites (including wikipedia.org). | |||
</ | ** Additional Apache configurations are at [https://github.com/wikimedia/operations-puppet/tree/production/modules/mediawiki/files/apache/sites modules/mediawiki/files/apache/sites/]. Prior to 2012, Apache configuration were in a Subversion repository. | ||
* | |||
==Architecture== | |||
{{See also|MediaWiki at WMF|HTTP timeouts#App servers}} | |||
The application servers are load-balanced via [[LVS]]. Connections between our CDN (HTTP cache proxies) and app servers are encrypted with TLS, which is terminated locally on the app server using [[Envoy]]. Envoy then hands the request off to the local Apache. | |||
[ | |||
'''Apache''' is in charge of handling redirects, rewrite rules, and determining the [[MediaWiki at WMF#Document root|document root]]. It then uses <code>php-fpm</code> to invoke the MediaWiki software. | |||
The Apache [https://httpd.apache.org/docs/2.4/mpm.html MPM] we use is [https://httpd.apache.org/docs/2.4/mod/worker.html mod_worker]</code>, which decides how <code>php-fpm</code> processes are spawned. | |||
==Logging== | ==Logging== | ||
Apache errors are logged to / | Apache errors are logged to <code>/srv/mw-log/apache2.log</code> on <code>mwlog1001</code>. | ||
Apache access logs are mostly disabled. Statistics are drawn from [[Varnish]] front ends instead. | Apache access logs are mostly disabled. Statistics are drawn from [[Varnish]] front ends instead. | ||
== | == Hardware repair == | ||
{{Outdated-inline|year=2015}} | |||
When taking down application servers (running mediawiki) for things like disk replacement or other hardware repair, _do not forget to_: | When taking down application servers (running mediawiki) for things like disk replacement or other hardware repair, _do not forget to_: | ||
* before: remove from dsh group | * before: remove from dsh group | ||
Line 146: | Line 42: | ||
See [[pybal]]. You can just grep for the server name and set 'enabled': False and save. | See [[pybal]]. You can just grep for the server name and set 'enabled': False and save. | ||
* before: check nobody is scapping right now (best: announce with a !log line in IRC) | * before: check nobody is scapping right now (best: announce with a !log line in IRC) | ||
This is an IRC thing on | This is an IRC thing on libera.chat in {{irc|wikimedia-dev}}/{{irc|wikimedia-tech}}/{{irc|wikimedia-operations}} | ||
* during: acknowledge Icinga monitoring checks (best: with related ticket number as comment) | * during: acknowledge Icinga monitoring checks (best: with related ticket number as comment) | ||
Do this by logging in via browser on icinga.wikimedia.org. search for the hostname, check all services and use the "acknowledge" option. You'll see the IRC bots outputting this as well and they will stop repeating things over and over in the channels. | Do this by logging in via browser on icinga.wikimedia.org. search for the hostname, check all services and use the "acknowledge" option. You'll see the IRC bots outputting this as well and they will stop repeating things over and over in the channels. | ||
Line 159: | Line 55: | ||
[[Category:Servers by usage| Apache]] | [[Category:Servers by usage| Apache]] | ||
[[Category:MediaWiki production| ]] | |||
[[Category:SRE Service Operations]] |
Revision as of 02:30, 1 May 2022
The Application servers (or app servers) are the several hundred Apache servers that run MediaWiki (PHP application).
Service
Puppet roles:
mediawiki::appserver
,mediawiki::canary_appserver
mediawiki::appserver::api
,mediawiki::appserver::canary_api
mediawiki::maintenance
mediawiki::jobrunner
Relevant puppet classes:
profile::mediawiki::webserver
, this provisions Apache, and any other packages or resources needed by MediaWiki on app servers.profile::mediawiki::httpd
, the Apache service.mediawiki::web::prod_sites
, the Apache configuration for all production websites (including wikipedia.org).- Additional Apache configurations are at modules/mediawiki/files/apache/sites/. Prior to 2012, Apache configuration were in a Subversion repository.
Architecture
The application servers are load-balanced via LVS. Connections between our CDN (HTTP cache proxies) and app servers are encrypted with TLS, which is terminated locally on the app server using Envoy. Envoy then hands the request off to the local Apache.
Apache is in charge of handling redirects, rewrite rules, and determining the document root. It then uses php-fpm
to invoke the MediaWiki software.
The Apache MPM we use is mod_worker, which decides how php-fpm
processes are spawned.
Logging
Apache errors are logged to /srv/mw-log/apache2.log
on mwlog1001
.
Apache access logs are mostly disabled. Statistics are drawn from Varnish front ends instead.
Hardware repair
![]() | This information is outdated. (last update: 2015) |
When taking down application servers (running mediawiki) for things like disk replacement or other hardware repair, _do not forget to_:
- before: remove from dsh group
These are in puppet, operations/puppet repo, in modules/dsh/files/group. The important one for Mediawiki sync is "mediawiki-installation".
- before: de-pool in pybal
- TODO: Document what to do if it's a scap proxy (see hieradata/common/dsh/config.yaml)
See pybal. You can just grep for the server name and set 'enabled': False and save.
- before: check nobody is scapping right now (best: announce with a !log line in IRC)
This is an IRC thing on libera.chat in #wikimedia-dev connect/#wikimedia-tech connect/#wikimedia-operations connect
- during: acknowledge Icinga monitoring checks (best: with related ticket number as comment)
Do this by logging in via browser on icinga.wikimedia.org. search for the hostname, check all services and use the "acknowledge" option. You'll see the IRC bots outputting this as well and they will stop repeating things over and over in the channels.
- after: re-add to dsh groups
Revert the above.
- after: re-pool in pybal
Revert the above.