HTTP 500 (Internal Server Error) with simultaneous MySQL requests via apache

I have a Wikipedia database where:

  • One (1) host works mysqldby starting the database; I installed the package mariadb-server.
  • I saved 16 million pages in 4 different tables (page, text, revision, redirection, each of which contains 16 million rows, and the last about 7 million). Size /var/lib/mysql/ibdata1: 88 GiB.
  • Requests are submitted via the http server ( apache2) using MediaWiki , as in wikipedia.org.
  • One single-threaded worker on another machine sends 231 million requests to the database via http with a timeout of 200-500 ms; many single timeout requests even at 200 ms.

The problem is that most requests are not served due to the "HTTP 500" (Internal Server Error). Several requests (100-200) are served without problems, but when I start requests with more than 1,000 requests, I get an internal server error in most cases.

Here is a snapshot during the current experiment:

  • 38,086 queries HTTP 200 OK.
  • 1,200,226 queries: HTTP 500 Internal Server Error
  • 74,280 requests: timeout

In particular, here is a short excerpt from /var/log/apache2/error.logthe server mysqld:

[Mon Apr 18 02:42:43.492142 2016] [:error] [pid 70738] [client 172.16.96.23:41031] PHP Fatal error:  Maximum execution time of 30 seconds exceeded in /home/wikiadmin/mediawiki-1.26.2/includes/cache/LocalisationCache.php on line 262
[Mon Apr 18 02:42:53.184116 2016] [:error] [pid 70665] [client 172.16.96.23:57976] PHP Fatal error:  Maximum execution time of 30 seconds exceeded in /home/wikiadmin/mediawiki-1.26.2/includes/parser/Preprocessor_DOM.php on line 1123
[Mon Apr 18 02:43:19.389313 2016] [:error] [pid 70745] [client 172.16.96.6:38824] PHP Fatal error:  Maximum execution time of 30 seconds exceeded in /home/wikiadmin/mediawiki-1.26.2/includes/Sanitizer.php on line 1087
[Mon Apr 18 02:43:22.188122 2016] [:error] [pid 69251] [client 172.16.96.6:55869] PHP Fatal error:  Maximum execution time of 30 seconds exceeded in /home/wikiadmin/mediawiki-1.26.2/includes/title/MediaWikiTitleCodec.php on line 377
[Mon Apr 18 02:43:38.404148 2016] [:error] [pid 70919] [client 172.16.96.6:60524] PHP Fatal error:  Maximum execution time of 30 seconds exceeded in /home/wikiadmin/mediawiki-1.26.2/includes/parser/Preprocessor_DOM.php on line 1124
[Mon Apr 18 02:43:42.188143 2016] [:error] [pid 69534] [client 172.16.96.6:51519] PHP Fatal error:  Maximum execution time of 30 seconds exceeded in /home/wikiadmin/mediawiki-1.26.2/includes/parser/Preprocessor_DOM.php on line 1119
[Mon Apr 18 02:42:23.004116 2016] [:error] [pid 70550] [client 172.16.96.23:35259] PHP Fatal error:  Maximum execution time of 30 seconds exceeded in /home/wikiadmin/mediawiki-1.26.2/includes/Message.php on line 260

, , . MySQL , , (i) ; (ii) MySQL ..; , , , .

MySQL HTTP/MediaWiki?

+4
3

, , . , , .

, , - TCP/IP. : , - Apache. , , . Windows 72 , .

500 , Apache , -, PHP, 30- . PHP. , php.ini. . - - , Apache/PHP/mediawiki, . PHP , , .

, MySQL MariaDb . . , , .

-, . , ... , , , -. : , .

, , , , - ( Running Apache/PHP/mediawiki), . AWS Elastic Beanstalk - . .

- , . .

- , , , . .

+2

mysql, HTTP/mediawiki. , .

231 - . . 1000 . , ? , .

+1

Apache HTTP. https://serverfault.com/questions/7778/suggest-a-lightning-fast-feature-light-secure-linux-web-server-to-serve-static http-. opcache php. , mysqli pdo mysql php. , , . InnoDB. -, Google. .

+1

All Articles