Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: Apache Issue
PostPosted: Fri Feb 28, 2014 6:32 am 
Offline
Senior Newbie

Joined: Fri Feb 28, 2014 6:14 am
Posts: 5
Hi Guys,

I'm not sure if this is the right forum to post this but I am currently trying to troubleshoot an issue with Apache.

I'm not overly familiar with it, beyond it's initial setup it has worked fine for me for a year.

The issue manifested last night where connections to all my domains started timing out. I was still able to ssh in and access my webmin panel, just not any of the hosted domains.

I did a bit of combing of logs and got the following

Code:
PHP Warning:  file(http://www.principiadiscordia.com/list.html): failed to open stream: HTTP request failed!  in /var/www/principiadiscordia.com/index.php on line 4 failed to open stream: HTTP request failed!


I wasn't sure if this was related or if the issue was Apache. I performed a reboot of the machine.

For approximately 10 minutes everything seemed fine and then the pages timed out again.

I stopped apache via webmin, and restarted it, everything seemed nippy again.

The site went down about 20 minutes later, after I had gone to bed and stayed down till morning. Since then I've restarted apache 4 times and am trying to track down the root cause.

Some things I've seen in the logs that seem promising are:

When I restart apache
Code:
[error] server reached MaxClients setting, consider raising the MaxClients setting


When I use:
Code:
tail -f /var/log/apache2/error.log


I get
Code:
[Fri Feb 28 11:00:45 2014] [error] server reached MaxClients setting, consider raising the MaxClients setting
[Fri Feb 28 11:02:21 2014] [notice] caught SIGTERM, shutting down
[Fri Feb 28 11:02:25 2014] [notice] Apache/2.2.16 (Debian) PHP/5.3.3-7+squeeze18 with Suhosin-Patch configured -- resuming normal operations
[Fri Feb 28 11:02:26 2014] [error] server reached MaxClients setting, consider raising the MaxClients setting
[Fri Feb 28 11:14:53 2014] [notice] child pid 28220 exit signal Bus error (7)


I think sigterm is me restarting Apache, but I'm not sure if the rest are related.

So far all I really have to go on is the maxclients but I'm not certain.

As I said, I'm not sure if this is the forum to ask but if anyone has some suggestions or has seen something similar it would be very much appreciated.

Regards,
Faust


Top
   
 Post subject: Re: Apache Issue
PostPosted: Fri Feb 28, 2014 9:27 am 
Offline
Senior Newbie

Joined: Fri Feb 28, 2014 6:14 am
Posts: 5
Ok I think I've isolated the problem, and I don't think it's apache.

Static Pages are loading, but php pages take a long time or completely fail.


Top
   
 Post subject: Re: Apache Issue
PostPosted: Fri Feb 28, 2014 9:59 am 
Offline
Senior Member

Joined: Fri Feb 17, 2012 8:20 pm
Posts: 365
[Fri Feb 28 11:00:45 2014] [error] server reached MaxClients setting, consider raising the MaxClients setting

^ Issue right there. PHP pages take longer so maxclients is reached earlier. With static pages, they're quickly handled so you won't get that issue. Your site has become busier/receives more traffic, that's why you're seeing it now, and not before.

You can try raising that value in your apache config, but it usually means more RAM usage as well.


Top
   
 Post subject: Re: Apache Issue
PostPosted: Fri Feb 28, 2014 10:04 am 
Offline
Senior Newbie

Joined: Fri Feb 28, 2014 6:14 am
Posts: 5
Perfect,

I'll raise then number of clients and let you know how I get on.


Top
   
 Post subject: Re: Apache Issue
PostPosted: Fri Feb 28, 2014 4:35 pm 
Offline
Senior Newbie

Joined: Fri Feb 28, 2014 6:14 am
Posts: 5
Ok, that has helped a little: the site isn't becoming inaccessible any more. However I'm spotting paces that I get "The connection was reset"

Specifically in SMF when I try to access the package manager.

I upgraded to php5.3.3-7 about a week ago, I'm wondering if this could be related, but probably not an Apache thing.

Code:
PHP 5.3.3-7+squeeze18 with Suhosin-Patch (cli) (built: Dec 12 2013 09:20:04) 
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
    with Suhosin v0.9.32.1, Copyright (c) 2007-2010, by SektionEins GmbH


Im seeing a lot of
Code:
child pid 10909 exit signal Segmentation fault (11)


Top
   
 Post subject: Re: Apache Issue
PostPosted: Fri Feb 28, 2014 5:14 pm 
Offline
Senior Member

Joined: Fri Feb 17, 2012 8:20 pm
Posts: 365
Well are you monitoring your RAM? Are you sure you're not simply going oom now?


Top
   
 Post subject: Re: Apache Issue
PostPosted: Fri Feb 28, 2014 5:29 pm 
Offline
Senior Newbie

Joined: Fri Feb 28, 2014 6:14 am
Posts: 5
Nuvini wrote:
Well are you monitoring your RAM? Are you sure you're not simply going oom now?


I've given it a look with free -m

Code:
             total       used       free     shared    buffers     cached
Mem:         15999       2267      13731          0         57       1439
-/+ buffers/cache:        770      15228
Swap:        12286          0      12286



It isn't quite the exact amount I see from the webmin menu.

I've set my php.ini to safe mode and things are running stably again, so something in my configuration is the problem. Be it extensions or just my settings.

I think I'm getting closer and that it may have been two issues overlapping here.
If I find what the culprit is I'll post it.


Top
   
 Post subject: Re: Apache Issue
PostPosted: Mon Mar 17, 2014 9:10 pm 
Offline
Senior Newbie

Joined: Wed Jan 22, 2014 8:11 pm
Posts: 6
Website: http://eightyfiveconsulting.com
Location: Orange, CA
If you are still getting timeouts, switching to fast-cgi/php-fpm for handling PHP might fix some issues as well. Apache is really inefficient at handing out dynamic content like php. Like others have said, as your traffic grows these problems with PHP will become more obvious and consistent.

_________________
http://eightyfiveconsulting.com


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group