nhatkhoa
By:
nhatkhoa

Apache keep stop working after few hours on 2gb VPS . Plz help

March 9, 2015 5.2k views
Apache Configuration Management WordPress

i got a 2gb ram droplet. it running ubuntu 12.10
i installed wordpress MU on this vps

the droplet usually crash after every few hours now. i tried to tuning Apache config but still not help.

I Tried add 2gb and 4gb swap but still not help. use memcache, wordpress super cache, even used cloudflare CDN to help save bandwith and load but it still cannot works well.

My sites haven't got much traffic. only 6000 pageviews/ day from 5k/visitor.

I'm not understand how to solve this issue. Here is my apache config and mysql config:

Timeout 15
MaxKeepAliveRequests 50
KeepAliveTimeout 10

<IfModule mpm_prefork_module>
StartServers 1
MinSpareServers 2
MaxSpareServers 4
MaxClients 50
MaxRequestsPerChild 3000
</IfModule>

<IfModule mpm_worker_module>
StartServers 1
MinSpareThreads 2
MaxSpareThreads 8
ThreadLimit 16
ThreadsPerChild 4
MaxClients 50
MaxRequestsPerChild 400
</IfModule>

<IfModule mpm_event_module>
StartServers 1
MinSpareThreads 2
MaxSpareThreads 4
ThreadLimit 16
ThreadsPerChild 4
MaxClients 50
MaxRequestsPerChild 400
</IfModule>

===================
MySQL fine tune:

* Fine Tuning

keybuffer = 32M
max
allowedpacket = 4M
thread
stack = 256K
threadcachesize = 4M

This replaces the startup script and checks MyISAM tables if needed

the first time they are touched

myisam-recover = BACKUP

max_connections = 50

table_cache = 256

thread_concurrency = 10

* Query Cache Configuration

querycachelimit = 8M
querycachesize = 8M

[mysqldump]
quick
quote-names
maxallowedpacket = 32M

[mysql]

no-auto-rehash # faster start of mysql but no tab completition

[isamchk]
key_buffer = 32M

if you know how to fix it, please help me. Thanks

4 comments
  • Is anything being recorded in your apache error log when the process crashes?

  • logs please!!

  • Hi

    here is an part of error log, full log was too long so i uploaded it to my site as txt, you can view it here:
    http://honda-wave.com/errorlog.txt

    [Mon Mar 09 21:18:01 2015] [notice] child pid 9155 exit signal Segmentation fault (11)
    [Mon Mar 09 21:18:28 2015] [error] [client 108.162.221.159] WordPress database error Table 'wordpress.wp42590761options' doesn't exist for query SELECT optionvalue $
    [Mon Mar 09 21:18:47 2015] [error] [client 108.162.221.172] WordPress database error Table 'wordpress.wp66904293options' doesn't exist for query SELECT optionvalue $
    [Mon Mar 09 21:20:15 2015] [notice] child pid 9220 exit signal Segmentation fault (11)
    [Mon Mar 09 21:24:06 2015] [notice] child pid 9285 exit signal Segmentation fault (11)
    [Mon Mar 09 21:25:30 2015] [notice] child pid 9221 exit signal Segmentation fault (11)
    [Mon Mar 09 21:28:24 2015] [error] [client 173.245.56.105] WordPress database error Table 'wordpress.wp42590761options' doesn't exist for query SELECT optionvalue F$
    [Mon Mar 09 21:28:30 2015] [error] [client 173.245.50.98] WordPress database error Table 'wordpress.wp66904293options' doesn't exist for query SELECT optionvalue FR$
    [Mon Mar 09 21:30:40 2015] [error] [client 108.162.221.162] WordPress database error Table 'wordpress.wp66904293options' doesn't exist for query SELECT optionvalue $
    [Mon Mar 09 21:40:20 2015] [notice] child pid 9125 exit signal Segmentation fault (11)
    [Mon Mar 09 21:41:07 2015] [error] [client 108.162.208.202] PHP Fatal error: Maximum execution time of 30 seconds exceeded in /home/wordpress/publichtml/wp-includes/$
    [Mon Mar 09 21:41:10 2015] [error] [client 108.162.221.162] WordPress database error Table 'wordpress.wp66904293options' doesn't exist for query SELECT optionvalue $
    [Mon Mar 09 21:42:34 2015] [error] [client 173.245.50.98] WordPress database error Table 'wordpress.wp66904293options' doesn't exist for query SELECT optionvalue FR$
    [Mon Mar 09 21:45:12 2015] [error] [client 128.199.139.157] PHP Fatal error: Maximum execution time of 30 seconds exceeded in /home/wordpress/publichtml/wp-includes/$
    [Mon Mar 09 21:47:52 2015] [notice] child pid 9455 exit signal Segmentation fault (11)
    [Mon Mar 09 21:48:43 2015] [error] [client 128.199.139.157] PHP Fatal error: Maximum execution time of 30 seconds exceeded in /home/wordpress/publichtml/wp-includes/$
    [Mon Mar 09 23:59:46 2015] [notice] caught SIGTERM, shutting down
    PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525/mcrypt.so' - /usr/lib/php5/20100525/mcrypt.so: cannot open shared object file: No suc$
    PHP Warning: Module 'memcache' already loaded in Unknown on line 0
    [Mon Mar 09 23:59:47 2015] [notice] Apache/2.2.22 (Ubuntu) PHP/5.4.6-1ubuntu1.8 configured -- resuming normal operations
    [Mon Mar 09 23:59:56 2015] [error] [client 108.162.221.225] WordPress database error Table 'wordpress.wp66904293options' doesn't exist for query SELECT optionvalue $
    [Tue Mar 10 00:00:49 2015] [error] [client 128.199.139.157] PHP Fatal error: Maximum execution time of 30 seconds exceeded in /home/wordpress/publichtml/wp-includes/$
    [Tue Mar 10 00:02:25 2015] [error] [client 128.199.139.157] PHP Fatal error: Maximum execution time of 30 seconds exceeded in /home/wordpress/publichtml/wp-includes/$
    [Tue Mar 10 00:05:19 2015] [error] [client 108.162.208.182] PHP Fatal error: Maximum execution time of 30 seconds exceeded in /home/wordpress/publichtml/wp-includes/$
    [Tue Mar 10 00:05:47 2015] [error] [client 108.162.221.162] WordPress database error Table 'wordpress.wp66904293options' doesn't exist for query SELECT optionvalue $
    [Tue Mar 10 00:06:29 2015] [error] [client 108.162.221.173] WordPress database error Table 'wordpress.wp42590761options' doesn't exist for query SELECT optionvalue $

  • @nhatkhoa you have many errors there you should fix, but I see this one you REALLY NEED TO FIX

    [Sun Mar 08 02:24:25 2015] [error] server reached MaxClients setting, consider raising the MaxClients setting
    

    Also this is not normal, so you may need to check your WP, maybe some of the plugins are causing long execution times.

    [error] [client 128.199.139.157] PHP Fatal error:  Maximum execution time of 30 seconds exceeded in /home/wordpress/public_html/wp-includes/option.php on line 0
    there are plenty others like thios on the log
    

    Also this is wrong, need to be fix

    [error] [client 192.0.82.32] WordPress database error Table 'wordpress.wp_66904293_options' doesn't exist for query SELECT option_value FROM wp_66904293_options WHERE
    

    So, first solve the problems and then optimize your apache. How many websites you have at your droplet? all sites pass trough Cloudflare? can you check how many connections are on any given time?

    Apache is not the best for high load websites, maybe you should try nginx, or to install a varnish in between apache and Cloudflare, but you need to fix all those WP errors, try disabling all plugins and try one at the times till you see whats causing the long execution times, and the errors from missing databases.

    Is this install fresh or has some time going adding and removing sites?

2 Answers

Hi

here is an part of error log, full log was too long so i uploaded it to my site as txt, you can view it here:
http://honda-wave.com/errorlog.txt

[Mon Mar 09 21:18:01 2015] [notice] child pid 9155 exit signal Segmentation fault (11)
[Mon Mar 09 21:18:28 2015] [error] [client 108.162.221.159] WordPress database error Table 'wordpress.wp42590761options' doesn't exist for query SELECT optionvalue $
[Mon Mar 09 21:18:47 2015] [error] [client 108.162.221.172] WordPress database error Table 'wordpress.wp
66904293options' doesn't exist for query SELECT optionvalue $
[Mon Mar 09 21:20:15 2015] [notice] child pid 9220 exit signal Segmentation fault (11)
[Mon Mar 09 21:24:06 2015] [notice] child pid 9285 exit signal Segmentation fault (11)
[Mon Mar 09 21:25:30 2015] [notice] child pid 9221 exit signal Segmentation fault (11)
[Mon Mar 09 21:28:24 2015] [error] [client 173.245.56.105] WordPress database error Table 'wordpress.wp42590761options' doesn't exist for query SELECT optionvalue F$
[Mon Mar 09 21:28:30 2015] [error] [client 173.245.50.98] WordPress database error Table 'wordpress.wp
66904293options' doesn't exist for query SELECT optionvalue FR$
[Mon Mar 09 21:30:40 2015] [error] [client 108.162.221.162] WordPress database error Table 'wordpress.wp66904293options' doesn't exist for query SELECT optionvalue $
[Mon Mar 09 21:40:20 2015] [notice] child pid 9125 exit signal Segmentation fault (11)
[Mon Mar 09 21:41:07 2015] [error] [client 108.162.208.202] PHP Fatal error: Maximum execution time of 30 seconds exceeded in /home/wordpress/public
html/wp-includes/$
[Mon Mar 09 21:41:10 2015] [error] [client 108.162.221.162] WordPress database error Table 'wordpress.wp66904293options' doesn't exist for query SELECT optionvalue $
[Mon Mar 09 21:42:34 2015] [error] [client 173.245.50.98] WordPress database error Table 'wordpress.wp
66904293options' doesn't exist for query SELECT optionvalue FR$
[Mon Mar 09 21:45:12 2015] [error] [client 128.199.139.157] PHP Fatal error: Maximum execution time of 30 seconds exceeded in /home/wordpress/publichtml/wp-includes/$
[Mon Mar 09 21:47:52 2015] [notice] child pid 9455 exit signal Segmentation fault (11)
[Mon Mar 09 21:48:43 2015] [error] [client 128.199.139.157] PHP Fatal error: Maximum execution time of 30 seconds exceeded in /home/wordpress/public
html/wp-includes/$
[Mon Mar 09 23:59:46 2015] [notice] caught SIGTERM, shutting down
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525/mcrypt.so' - /usr/lib/php5/20100525/mcrypt.so: cannot open shared object file: No suc$
PHP Warning: Module 'memcache' already loaded in Unknown on line 0
[Mon Mar 09 23:59:47 2015] [notice] Apache/2.2.22 (Ubuntu) PHP/5.4.6-1ubuntu1.8 configured -- resuming normal operations
[Mon Mar 09 23:59:56 2015] [error] [client 108.162.221.225] WordPress database error Table 'wordpress.wp66904293options' doesn't exist for query SELECT optionvalue $
[Tue Mar 10 00:00:49 2015] [error] [client 128.199.139.157] PHP Fatal error: Maximum execution time of 30 seconds exceeded in /home/wordpress/public
html/wp-includes/$
[Tue Mar 10 00:02:25 2015] [error] [client 128.199.139.157] PHP Fatal error: Maximum execution time of 30 seconds exceeded in /home/wordpress/publichtml/wp-includes/$
[Tue Mar 10 00:05:19 2015] [error] [client 108.162.208.182] PHP Fatal error: Maximum execution time of 30 seconds exceeded in /home/wordpress/public
html/wp-includes/$
[Tue Mar 10 00:05:47 2015] [error] [client 108.162.221.162] WordPress database error Table 'wordpress.wp66904293options' doesn't exist for query SELECT optionvalue $
[Tue Mar 10 00:06:29 2015] [error] [client 108.162.221.173] WordPress database error Table 'wordpress.wp
42590761options' doesn't exist for query SELECT optionvalue $

I have the same issue. For your information, this kind of errors only happen with Digital Ocean. I used to use AWS and it was working o.k even with same machine configuration

Have another answer? Share your knowledge.